mirror of
https://github.com/google/nomulus
synced 2026-02-03 11:32:24 +00:00
Add more absent clTrid unit tests
In RFC 5730, clTrid is specified as optional. We ran into an error earlier this year in which a registrar was not passing a client transaction id and we didn't handle it correctly. So, this CL adds some tests of common EPP operations verify that they work correctly when the clTrid is not specified. This also slightly improves some flow logic to make it more obvious at first glance that clTrid is indeed optional. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=202000845
This commit is contained in:
@@ -16,7 +16,6 @@ package google.registry.model.eppcommon;
|
||||
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.googlecode.objectify.annotation.Embed;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import java.util.Optional;
|
||||
@@ -40,6 +39,7 @@ public class Trid extends ImmutableObject {
|
||||
|
||||
/** The client transaction id, if provided by the client, otherwise null. */
|
||||
@XmlElement(name = "clTRID", namespace = "urn:ietf:params:xml:ns:epp-1.0")
|
||||
@Nullable
|
||||
String clientTransactionId;
|
||||
|
||||
public String getServerTransactionId() {
|
||||
@@ -50,7 +50,6 @@ public class Trid extends ImmutableObject {
|
||||
return Optional.ofNullable(clientTransactionId);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public static Trid create(@Nullable String clientTransactionId, String serverTransactionId) {
|
||||
checkArgumentNotNull(serverTransactionId, "serverTransactionId cannot be null");
|
||||
Trid instance = new Trid();
|
||||
|
||||
Reference in New Issue
Block a user