mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 14:54:51 +02:00
Make async flow logic handle missing client transaction IDs
Per EPP RFC 5730, the <clTRID> element is optional. However, we weren't handling it not being specified in asynchronous contact/host deletions because we were adding it directly as a parameter value on a task, which does not allow null and thus threw a NullPointerException. This fixes handling for nulls (the parameter isn't set at all) and adds a test. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=194123259
This commit is contained in:
parent
f56355c9e8
commit
33505f4df7
16 changed files with 196 additions and 47 deletions
|
@ -163,16 +163,17 @@ public abstract class ResourceFlowTestCase<F extends Flow, R extends EppResource
|
|||
/** Asserts the presence of a single enqueued async contact or host deletion */
|
||||
protected <T extends EppResource> void assertAsyncDeletionTaskEnqueued(
|
||||
T resource, String requestingClientId, Trid trid, boolean isSuperuser) throws Exception {
|
||||
assertTasksEnqueued(
|
||||
"async-delete-pull",
|
||||
new TaskMatcher()
|
||||
.etaDelta(Duration.standardSeconds(75), Duration.standardSeconds(105)) // expected: 90
|
||||
.param("resourceKey", Key.create(resource).getString())
|
||||
.param("requestingClientId", requestingClientId)
|
||||
.param("clientTransactionId", trid.getClientTransactionId())
|
||||
.param("serverTransactionId", trid.getServerTransactionId())
|
||||
.param("isSuperuser", Boolean.toString(isSuperuser))
|
||||
.param("requestedTime", clock.nowUtc().toString()));
|
||||
TaskMatcher expected = new TaskMatcher()
|
||||
.etaDelta(Duration.standardSeconds(75), Duration.standardSeconds(105)) // expected: 90
|
||||
.param("resourceKey", Key.create(resource).getString())
|
||||
.param("requestingClientId", requestingClientId)
|
||||
.param("serverTransactionId", trid.getServerTransactionId())
|
||||
.param("isSuperuser", Boolean.toString(isSuperuser))
|
||||
.param("requestedTime", clock.nowUtc().toString());
|
||||
if (trid.getClientTransactionId().isPresent()) {
|
||||
expected.param("clientTransactionId", trid.getClientTransactionId().get());
|
||||
}
|
||||
assertTasksEnqueued("async-delete-pull", expected);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue