mirror of
https://github.com/google/nomulus
synced 2026-09-08 17:17:02 +00:00
Rename various fields and classes after migration (#1784)
Also fixed a bug introduced in #1785 where identity checked were performed instead of equality. This resulted in two sets containing the same elements not being regarded as equal and subsequent DNS updated being unnecessarily enqueued.
This commit is contained in:
@@ -33,7 +33,7 @@ import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
@@ -110,7 +110,7 @@ public class RegistryJpaReadTest {
|
||||
Read<Object[], String> read =
|
||||
RegistryJpaIO.read(
|
||||
"select d, r.emailAddress from Domain d join Registrar r on"
|
||||
+ " d.currentSponsorClientId = r.clientIdentifier where r.type = :type"
|
||||
+ " d.currentSponsorClientId = r.registrarId where r.type = :type"
|
||||
+ " and d.deletionTime > now()",
|
||||
ImmutableMap.of("type", Registrar.Type.REAL),
|
||||
false,
|
||||
@@ -152,7 +152,7 @@ public class RegistryJpaReadTest {
|
||||
Read<Domain, String> read =
|
||||
RegistryJpaIO.read(
|
||||
"select d from Domain d join Registrar r on"
|
||||
+ " d.currentSponsorClientId = r.clientIdentifier where r.type = :type"
|
||||
+ " d.currentSponsorClientId = r.registrarId where r.type = :type"
|
||||
+ " and d.deletionTime > now()",
|
||||
ImmutableMap.of("type", Registrar.Type.REAL),
|
||||
Domain.class,
|
||||
@@ -200,7 +200,7 @@ public class RegistryJpaReadTest {
|
||||
.setPersistedCurrentSponsorRegistrarId(registrar.getRegistrarId())
|
||||
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
|
||||
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password")))
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setLaunchNotice(
|
||||
LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME))
|
||||
.setSmdId("smdid")
|
||||
|
||||
@@ -355,7 +355,7 @@ class InvoicingPipelineTest {
|
||||
.isEqualTo(
|
||||
'\n'
|
||||
+ "SELECT b, r FROM BillingEvent b\n"
|
||||
+ "JOIN Registrar r ON b.clientId = r.clientIdentifier\n"
|
||||
+ "JOIN Registrar r ON b.clientId = r.registrarId\n"
|
||||
+ "JOIN Domain d ON b.domainRepoId = d.repoId\n"
|
||||
+ "JOIN Tld t ON t.tldStr = d.tld\n"
|
||||
+ "LEFT JOIN BillingCancellation c ON b.id = c.refOneTime\n"
|
||||
|
||||
@@ -39,7 +39,7 @@ import com.google.common.net.InetAddresses;
|
||||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import google.registry.dns.writer.clouddns.CloudDnsWriter.ZoneStateException;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.Host;
|
||||
import google.registry.persistence.VKey;
|
||||
@@ -267,7 +267,7 @@ public class CloudDnsWriterTest {
|
||||
|
||||
for (int i = 0; i < dsRecords; i++) {
|
||||
dsRecordData.add(
|
||||
DelegationSignerData.create(i, 3, 1, base16().decode("1234567890ABCDEF")).toRrData());
|
||||
DomainDsData.create(i, 3, 1, base16().decode("1234567890ABCDEF")).toRrData());
|
||||
}
|
||||
recordSetBuilder.add(
|
||||
new ResourceRecordSet()
|
||||
@@ -284,10 +284,10 @@ public class CloudDnsWriterTest {
|
||||
/** Returns a domain to be persisted in Datastore. */
|
||||
private static Domain fakeDomain(
|
||||
String domainName, ImmutableSet<Host> nameservers, int numDsRecords) {
|
||||
ImmutableSet.Builder<DelegationSignerData> dsDataBuilder = new ImmutableSet.Builder<>();
|
||||
ImmutableSet.Builder<DomainDsData> dsDataBuilder = new ImmutableSet.Builder<>();
|
||||
|
||||
for (int i = 0; i < numDsRecords; i++) {
|
||||
dsDataBuilder.add(DelegationSignerData.create(i, 3, 1, base16().decode("1234567890ABCDEF")));
|
||||
dsDataBuilder.add(DomainDsData.create(i, 3, 1, base16().decode("1234567890ABCDEF")));
|
||||
}
|
||||
|
||||
ImmutableSet.Builder<VKey<Host>> hostRefBuilder = new ImmutableSet.Builder<>();
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.net.InetAddresses;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.Host;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
@@ -177,8 +177,7 @@ public class DnsUpdateWriterTest {
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(persistActiveHost("ns1.example.tld").createVKey()))
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 3, 1, base16().decode("0123456789ABCDEF"))))
|
||||
ImmutableSet.of(DomainDsData.create(1, 3, 1, base16().decode("0123456789ABCDEF"))))
|
||||
.build();
|
||||
persistResource(domain);
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ public class SyncRegistrarsSheetTest {
|
||||
assertThat(rows).hasSize(2);
|
||||
|
||||
ImmutableMap<String, String> row = rows.get(0);
|
||||
assertThat(row).containsEntry("clientIdentifier", "aaaregistrar");
|
||||
assertThat(row).containsEntry("registrarId", "aaaregistrar");
|
||||
assertThat(row).containsEntry("registrarName", "AAA Registrar Inc.");
|
||||
assertThat(row).containsEntry("state", "SUSPENDED");
|
||||
assertThat(row).containsEntry("ianaIdentifier", "8");
|
||||
@@ -288,7 +288,7 @@ public class SyncRegistrarsSheetTest {
|
||||
assertThat(row).containsEntry("billingAccountMap", "{JPY=JPY7890, USD=USD1234}");
|
||||
|
||||
row = rows.get(1);
|
||||
assertThat(row).containsEntry("clientIdentifier", "anotherregistrar");
|
||||
assertThat(row).containsEntry("registrarId", "anotherregistrar");
|
||||
assertThat(row).containsEntry("registrarName", "Another Registrar LLC");
|
||||
assertThat(row).containsEntry("state", "ACTIVE");
|
||||
assertThat(row).containsEntry("ianaIdentifier", "1");
|
||||
@@ -337,7 +337,7 @@ public class SyncRegistrarsSheetTest {
|
||||
|
||||
verify(sheetSynchronizer).synchronize(eq("foobar"), rowsCaptor.capture());
|
||||
ImmutableMap<String, String> row = getOnlyElement(getOnlyElement(rowsCaptor.getAllValues()));
|
||||
assertThat(row).containsEntry("clientIdentifier", "SomeRegistrar");
|
||||
assertThat(row).containsEntry("registrarId", "SomeRegistrar");
|
||||
assertThat(row).containsEntry("registrarName", "Some Registrar");
|
||||
assertThat(row).containsEntry("state", "ACTIVE");
|
||||
assertThat(row).containsEntry("ianaIdentifier", "8");
|
||||
|
||||
@@ -161,7 +161,7 @@ import google.registry.model.domain.fee.BaseFee.FeeType;
|
||||
import google.registry.model.domain.fee.Fee;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.domain.token.AllocationToken.RegistrationBehavior;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||
@@ -860,7 +860,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||
assertAboutDomains()
|
||||
.that(domain)
|
||||
.hasExactlyDsData(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))
|
||||
.cloneWithDomainRepoId(domain.getRepoId()));
|
||||
}
|
||||
@@ -3159,15 +3159,14 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||
|
||||
@Test
|
||||
void testFailure_packageToken_registrationTooLong() throws Exception {
|
||||
AllocationToken token =
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setTokenType(PACKAGE)
|
||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||
.setAllowedTlds(ImmutableSet.of("tld"))
|
||||
.setRenewalPriceBehavior(SPECIFIED)
|
||||
.build());
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setTokenType(PACKAGE)
|
||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||
.setAllowedTlds(ImmutableSet.of("tld"))
|
||||
.setRenewalPriceBehavior(SPECIFIED)
|
||||
.build());
|
||||
persistContactsAndHosts();
|
||||
setEppInput(
|
||||
"domain_create_allocationtoken.xml",
|
||||
|
||||
@@ -64,7 +64,7 @@ import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenType;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
@@ -335,8 +335,7 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
|
||||
.asBuilder()
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
|
||||
DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
|
||||
.setNameservers(ImmutableSet.of(host1.createVKey(), host3.createVKey()))
|
||||
.build());
|
||||
doSuccessfulTest("domain_info_response_dsdata.xml", false);
|
||||
@@ -541,8 +540,7 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
|
||||
null))
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
|
||||
DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
|
||||
.build());
|
||||
doSuccessfulTest("domain_info_response_dsdata_addperiod.xml", false);
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ class DomainTransferCancelFlowTest
|
||||
.setResponseData(
|
||||
ImmutableList.of(
|
||||
new DomainTransferResponse.Builder()
|
||||
.setFullyQualifiedDomainName(getUniqueIdFromCommand())
|
||||
.setDomainName(getUniqueIdFromCommand())
|
||||
.setTransferStatus(TransferStatus.CLIENT_CANCELLED)
|
||||
.setTransferRequestTime(TRANSFER_REQUEST_TIME)
|
||||
.setGainingRegistrarId("NewRegistrar")
|
||||
|
||||
@@ -97,7 +97,7 @@ import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.host.Host;
|
||||
@@ -115,8 +115,8 @@ import org.junit.jupiter.api.Test;
|
||||
/** Unit tests for {@link DomainUpdateFlow}. */
|
||||
class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain> {
|
||||
|
||||
private static final DelegationSignerData SOME_DSDATA =
|
||||
DelegationSignerData.create(
|
||||
private static final DomainDsData SOME_DSDATA =
|
||||
DomainDsData.create(
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
@@ -148,7 +148,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
unusedContact = persistActiveContact("unused");
|
||||
}
|
||||
|
||||
private Domain persistDomainWithRegistrant() throws Exception {
|
||||
private void persistDomainWithRegistrant() throws Exception {
|
||||
Host host = loadByForeignKey(Host.class, "ns1.example.foo", clock.nowUtc()).get();
|
||||
Domain domain =
|
||||
persistResource(
|
||||
@@ -170,7 +170,6 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
.setDomain(domain)
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
return domain;
|
||||
}
|
||||
|
||||
private Domain persistDomain() throws Exception {
|
||||
@@ -467,17 +466,20 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
|
||||
private void doSecDnsSuccessfulTest(
|
||||
String xmlFilename,
|
||||
ImmutableSet<DelegationSignerData> originalDsData,
|
||||
ImmutableSet<DelegationSignerData> expectedDsData)
|
||||
ImmutableSet<DomainDsData> originalDsData,
|
||||
ImmutableSet<DomainDsData> expectedDsData,
|
||||
boolean dnsTaskEnqueued)
|
||||
throws Exception {
|
||||
doSecDnsSuccessfulTest(xmlFilename, originalDsData, expectedDsData, OTHER_DSDATA_TEMPLATE_MAP);
|
||||
doSecDnsSuccessfulTest(
|
||||
xmlFilename, originalDsData, expectedDsData, OTHER_DSDATA_TEMPLATE_MAP, dnsTaskEnqueued);
|
||||
}
|
||||
|
||||
private void doSecDnsSuccessfulTest(
|
||||
String xmlFilename,
|
||||
ImmutableSet<DelegationSignerData> originalDsData,
|
||||
ImmutableSet<DelegationSignerData> expectedDsData,
|
||||
ImmutableMap<String, String> substitutions)
|
||||
ImmutableSet<DomainDsData> originalDsData,
|
||||
ImmutableSet<DomainDsData> expectedDsData,
|
||||
ImmutableMap<String, String> substitutions,
|
||||
boolean dnsTaskEnqueued)
|
||||
throws Exception {
|
||||
setEppInput(xmlFilename, substitutions);
|
||||
persistResource(
|
||||
@@ -495,7 +497,11 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
expectedDsData.stream()
|
||||
.map(ds -> ds.cloneWithDomainRepoId(resource.getRepoId()))
|
||||
.collect(toImmutableSet()));
|
||||
assertDnsTasksEnqueued("example.tld");
|
||||
if (dnsTaskEnqueued) {
|
||||
assertDnsTasksEnqueued("example.tld");
|
||||
} else {
|
||||
assertNoDnsTasksEnqueued();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -504,7 +510,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"domain_update_dsdata_add.xml",
|
||||
null,
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableMap.of(
|
||||
"KEY_TAG",
|
||||
@@ -514,7 +520,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"DIGEST_TYPE",
|
||||
"1",
|
||||
"DIGEST",
|
||||
"A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"));
|
||||
"A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -524,7 +531,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableMap.of(
|
||||
"KEY_TAG",
|
||||
@@ -534,7 +541,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"DIGEST_TYPE",
|
||||
"1",
|
||||
"DIGEST",
|
||||
"A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"));
|
||||
"A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -551,7 +559,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"DIGEST_TYPE",
|
||||
"2",
|
||||
"DIGEST",
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"));
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -561,7 +570,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
1,
|
||||
8,
|
||||
4,
|
||||
@@ -576,10 +585,11 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"DIGEST_TYPE",
|
||||
"4",
|
||||
"DIGEST",
|
||||
"768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9"));
|
||||
"768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9"),
|
||||
true);
|
||||
}
|
||||
|
||||
// Changing any of the four fields in DelegationSignerData should result in a new object
|
||||
// Changing any of the four fields in DomainDsData should result in a new object
|
||||
@Test
|
||||
void testSuccess_secDnsAddOnlyChangeKeyTag() throws Exception {
|
||||
doSecDnsSuccessfulTest(
|
||||
@@ -587,7 +597,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346,
|
||||
2,
|
||||
2,
|
||||
@@ -601,7 +611,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"DIGEST_TYPE",
|
||||
"2",
|
||||
"DIGEST",
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"));
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -611,7 +622,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
1,
|
||||
8,
|
||||
2,
|
||||
@@ -625,7 +636,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"DIGEST_TYPE",
|
||||
"2",
|
||||
"DIGEST",
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"));
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -635,7 +647,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
1,
|
||||
2,
|
||||
4,
|
||||
@@ -650,7 +662,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"DIGEST_TYPE",
|
||||
"4",
|
||||
"DIGEST",
|
||||
"768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9"));
|
||||
"768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9"),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -660,7 +673,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
@@ -674,21 +687,22 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"DIGEST_TYPE",
|
||||
"2",
|
||||
"DIGEST",
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"));
|
||||
"9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08"),
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_secDnsAddToMaxRecords() throws Exception {
|
||||
ImmutableSet.Builder<DelegationSignerData> builder = new ImmutableSet.Builder<>();
|
||||
ImmutableSet.Builder<DomainDsData> builder = new ImmutableSet.Builder<>();
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
builder.add(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
i,
|
||||
2,
|
||||
2,
|
||||
base16().decode("9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08")));
|
||||
}
|
||||
ImmutableSet<DelegationSignerData> commonDsData = builder.build();
|
||||
ImmutableSet<DomainDsData> commonDsData = builder.build();
|
||||
|
||||
doSecDnsSuccessfulTest(
|
||||
"domain_update_dsdata_add.xml",
|
||||
@@ -697,11 +711,12 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
union(
|
||||
commonDsData,
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346,
|
||||
3,
|
||||
1,
|
||||
base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))))));
|
||||
base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))))),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -710,9 +725,10 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"domain_update_dsdata_rem.xml",
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableSet.of(SOME_DSDATA));
|
||||
ImmutableSet.of(SOME_DSDATA),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -722,9 +738,10 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"domain_update_dsdata_rem_all.xml",
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableSet.of());
|
||||
ImmutableSet.of(),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -733,26 +750,27 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"domain_update_dsdata_add_rem.xml",
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))));
|
||||
DomainDsData.create(
|
||||
12346, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_secDnsAddRemoveToMaxRecords() throws Exception {
|
||||
ImmutableSet.Builder<DelegationSignerData> builder = new ImmutableSet.Builder<>();
|
||||
ImmutableSet.Builder<DomainDsData> builder = new ImmutableSet.Builder<>();
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
builder.add(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
i,
|
||||
2,
|
||||
2,
|
||||
base16().decode("9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08")));
|
||||
}
|
||||
ImmutableSet<DelegationSignerData> commonDsData = builder.build();
|
||||
ImmutableSet<DomainDsData> commonDsData = builder.build();
|
||||
|
||||
doSecDnsSuccessfulTest(
|
||||
"domain_update_dsdata_add_rem.xml",
|
||||
@@ -760,7 +778,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
union(
|
||||
commonDsData,
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12345,
|
||||
3,
|
||||
1,
|
||||
@@ -769,11 +787,12 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
union(
|
||||
commonDsData,
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12346,
|
||||
3,
|
||||
1,
|
||||
base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))))));
|
||||
base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))))),
|
||||
true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -783,19 +802,23 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
"domain_update_dsdata_add_rem_same.xml",
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
DomainDsData.create(
|
||||
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
ImmutableSet.of(
|
||||
SOME_DSDATA,
|
||||
DelegationSignerData.create(
|
||||
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))));
|
||||
DomainDsData.create(
|
||||
12345, 3, 1, base16().decode("A94A8FE5CCB19BA61C4C0873D391E987982FBBD3"))),
|
||||
false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_secDnsRemoveAlreadyNotThere() throws Exception {
|
||||
// Removing a dsData that isn't there is a no-op.
|
||||
doSecDnsSuccessfulTest(
|
||||
"domain_update_dsdata_rem.xml", ImmutableSet.of(SOME_DSDATA), ImmutableSet.of(SOME_DSDATA));
|
||||
"domain_update_dsdata_rem.xml",
|
||||
ImmutableSet.of(SOME_DSDATA),
|
||||
ImmutableSet.of(SOME_DSDATA),
|
||||
false);
|
||||
}
|
||||
|
||||
void doServerStatusBillingTest(String xmlFilename, boolean isBillable) throws Exception {
|
||||
@@ -934,7 +957,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
@@ -948,8 +971,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
.asBuilder()
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2}),
|
||||
DelegationSignerData.create(2, 2, 6, new byte[] {0, 1, 2})))
|
||||
DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2}),
|
||||
DomainDsData.create(2, 2, 6, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertThat(thrown).hasMessageThat().contains("digestType=3");
|
||||
@@ -963,7 +986,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 1, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 1, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
@@ -980,8 +1003,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
.asBuilder()
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 2, 1, new byte[] {0, 1, 2, 3, 4}),
|
||||
DelegationSignerData.create(2, 2, 2, new byte[] {5, 6, 7})))
|
||||
DomainDsData.create(1, 2, 1, new byte[] {0, 1, 2, 3, 4}),
|
||||
DomainDsData.create(2, 2, 2, new byte[] {5, 6, 7})))
|
||||
.build());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertThat(thrown).hasMessageThat().contains("0, 1, 2, 3, 4");
|
||||
@@ -998,7 +1021,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 99, 2, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 99, 2, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
@@ -1012,8 +1035,8 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
.asBuilder()
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 998, 2, new byte[] {0, 1, 2}),
|
||||
DelegationSignerData.create(2, 99, 2, new byte[] {0, 1, 2})))
|
||||
DomainDsData.create(1, 998, 2, new byte[] {0, 1, 2}),
|
||||
DomainDsData.create(2, 99, 2, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
EppException thrown = assertThrows(InvalidDsRecordException.class, this::runFlow);
|
||||
assertThat(thrown).hasMessageThat().contains("algorithm=998");
|
||||
@@ -1023,9 +1046,9 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
|
||||
@Test
|
||||
void testFailure_secDnsTooManyDsRecords() throws Exception {
|
||||
ImmutableSet.Builder<DelegationSignerData> builder = new ImmutableSet.Builder<>();
|
||||
ImmutableSet.Builder<DomainDsData> builder = new ImmutableSet.Builder<>();
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
builder.add(DelegationSignerData.create(i, 2, 2, new byte[] {0, 1, 2}));
|
||||
builder.add(DomainDsData.create(i, 2, 2, new byte[] {0, 1, 2}));
|
||||
}
|
||||
|
||||
setEppInput("domain_update_dsdata_add.xml", OTHER_DSDATA_TEMPLATE_MAP);
|
||||
@@ -1724,7 +1747,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDnsTaskIsNotTriggeredWhenNoDSChangeSubmitted() throws Exception {
|
||||
void testDnsTaskIsNotTriggeredWhenNoDSChangeSubmitted() {
|
||||
setEppInput("domain_update_no_ds_change.xml");
|
||||
assertNoDnsTasksEnqueued();
|
||||
}
|
||||
|
||||
+1
-1
@@ -406,7 +406,7 @@ class AllocationTokenFlowUtilsTest {
|
||||
|
||||
private static DomainCommand.Create createCommand(String domainName) {
|
||||
DomainCommand.Create command = mock(DomainCommand.Create.class);
|
||||
when(command.getFullyQualifiedDomainName()).thenReturn(domainName);
|
||||
when(command.getDomainName()).thenReturn(domainName);
|
||||
return command;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||
.setResponseData(
|
||||
ImmutableList.of(
|
||||
new DomainTransferResponse.Builder()
|
||||
.setFullyQualifiedDomainName("test.example")
|
||||
.setDomainName("test.example")
|
||||
.setTransferStatus(TransferStatus.SERVER_APPROVED)
|
||||
.setGainingRegistrarId(getRegistrarIdForFlow())
|
||||
.setTransferRequestTime(clock.nowUtc().minusDays(5))
|
||||
|
||||
@@ -24,7 +24,7 @@ import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.GracePeriod.GracePeriodHistory;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.domain.secdns.DomainDsDataHistory;
|
||||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
import google.registry.persistence.VKey;
|
||||
@@ -46,7 +46,7 @@ public class BulkQueryHelper {
|
||||
.filter(gracePeriod -> gracePeriod.getDomainRepoId().equals(domainRepoId))
|
||||
.collect(toImmutableSet()),
|
||||
jpaTm()
|
||||
.loadAllOfStream(DelegationSignerData.class)
|
||||
.loadAllOfStream(DomainDsData.class)
|
||||
.filter(dsData -> dsData.getDomainRepoId().equals(domainRepoId))
|
||||
.collect(toImmutableSet()),
|
||||
jpaTm()
|
||||
|
||||
@@ -31,7 +31,7 @@ import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
@@ -160,7 +160,7 @@ public final class TestSetupHelper {
|
||||
.setPersistedCurrentSponsorRegistrarId(REGISTRAR_ID)
|
||||
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
|
||||
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password")))
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setLaunchNotice(LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME))
|
||||
.setSmdId("smdid")
|
||||
.addGracePeriod(
|
||||
|
||||
@@ -43,7 +43,7 @@ import google.registry.model.contact.Contact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
@@ -122,7 +122,7 @@ public class DomainSqlTest {
|
||||
.setPersistedCurrentSponsorRegistrarId("registrar3")
|
||||
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
|
||||
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password")))
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setLaunchNotice(
|
||||
LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME))
|
||||
.setSmdId("smdid")
|
||||
@@ -346,12 +346,11 @@ public class DomainSqlTest {
|
||||
@Test
|
||||
void testModifyDsData_addThenRemoveSuccessfully() {
|
||||
persistDomain();
|
||||
DelegationSignerData extraDsData =
|
||||
DelegationSignerData.create(2, 2, 3, new byte[] {0, 1, 2}, "4-COM");
|
||||
ImmutableSet<DelegationSignerData> unionDsData =
|
||||
DomainDsData extraDsData = DomainDsData.create(2, 2, 3, new byte[] {0, 1, 2}, "4-COM");
|
||||
ImmutableSet<DomainDsData> unionDsData =
|
||||
Sets.union(domain.getDsData(), ImmutableSet.of(extraDsData)).immutableCopy();
|
||||
|
||||
// Add an extra DelegationSignerData to dsData set.
|
||||
// Add an extra DomainDsData to dsData set.
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
@@ -361,7 +360,7 @@ public class DomainSqlTest {
|
||||
jpaTm().put(modified);
|
||||
});
|
||||
|
||||
// Verify that the persisted domain entity contains both DelegationSignerData records.
|
||||
// Verify that the persisted domain entity contains both DomainDsData records.
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
@@ -370,7 +369,7 @@ public class DomainSqlTest {
|
||||
assertEqualDomainExcept(persisted, "dsData");
|
||||
});
|
||||
|
||||
// Remove the extra DelegationSignerData record from dsData set.
|
||||
// Remove the extra DomainDsData record from dsData set.
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
@@ -604,8 +603,7 @@ public class DomainSqlTest {
|
||||
persisted
|
||||
.asBuilder()
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.build();
|
||||
updateInDb(domain);
|
||||
return jpaTm().getTransactionTime();
|
||||
|
||||
@@ -50,7 +50,7 @@ import google.registry.model.contact.Contact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
@@ -189,8 +189,7 @@ public class DomainTest {
|
||||
.setPersistedCurrentSponsorRegistrarId("NewRegistrar")
|
||||
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
|
||||
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("password")))
|
||||
.setDsData(
|
||||
ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setLaunchNotice(
|
||||
LaunchNotice.create("tcnid", "validatorId", START_OF_TIME, START_OF_TIME))
|
||||
.setTransferData(
|
||||
@@ -292,7 +291,7 @@ public class DomainTest {
|
||||
assertThat(
|
||||
DatabaseHelper.newDomain("example.com")
|
||||
.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, (byte[]) null)))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, (byte[]) null)))
|
||||
.build()
|
||||
.getDsData()
|
||||
.asList()
|
||||
@@ -302,7 +301,7 @@ public class DomainTest {
|
||||
assertThat(
|
||||
DatabaseHelper.newDomain("example.com")
|
||||
.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[] {})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, new byte[] {})))
|
||||
.build()
|
||||
.getDsData()
|
||||
.asList()
|
||||
@@ -312,7 +311,7 @@ public class DomainTest {
|
||||
assertThat(
|
||||
DatabaseHelper.newDomain("example.com")
|
||||
.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[] {1})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 1, 1, new byte[] {1})))
|
||||
.build()
|
||||
.getDsData()
|
||||
.asList()
|
||||
|
||||
@@ -34,7 +34,7 @@ import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.host.Host;
|
||||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
@@ -116,7 +116,7 @@ public class DomainHistoryTest extends EntityTestCase {
|
||||
newDomain("example.tld", "domainRepoId", contact)
|
||||
.asBuilder()
|
||||
.setNameservers(host.createVKey())
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setDnsRefreshRequestTime(Optional.of(DateTime.parse("2020-03-09T16:40:00Z")))
|
||||
.build();
|
||||
insertInDb(domain);
|
||||
|
||||
@@ -44,21 +44,25 @@ public class StatusValueAdapterTest {
|
||||
void testMarshalling() throws Exception {
|
||||
// Mangle the status value through marshalling by stuffing it in a host info response and then
|
||||
// ripping it out of the marshalled xml. Use lenient marshalling so we can omit other fields.
|
||||
String marshalled = new String(
|
||||
EppXmlTransformer.marshal(
|
||||
EppOutput.create(new EppResponse.Builder()
|
||||
.setResData(HostInfoData.newBuilder()
|
||||
.setCreationClientId("")
|
||||
.setCreationTime(START_OF_TIME)
|
||||
.setCurrentSponsorClientId("")
|
||||
.setFullyQualifiedHostName("")
|
||||
.setInetAddresses(ImmutableSet.of())
|
||||
.setRepoId("")
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED))
|
||||
.build())
|
||||
.build()),
|
||||
ValidationMode.LENIENT),
|
||||
UTF_8);
|
||||
String marshalled =
|
||||
new String(
|
||||
EppXmlTransformer.marshal(
|
||||
EppOutput.create(
|
||||
new EppResponse.Builder()
|
||||
.setResData(
|
||||
HostInfoData.newBuilder()
|
||||
.setCreationClientId("")
|
||||
.setCreationTime(START_OF_TIME)
|
||||
.setCurrentSponsorClientId("")
|
||||
.setHostName("")
|
||||
.setInetAddresses(ImmutableSet.of())
|
||||
.setRepoId("")
|
||||
.setStatusValues(
|
||||
ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED))
|
||||
.build())
|
||||
.build()),
|
||||
ValidationMode.LENIENT),
|
||||
UTF_8);
|
||||
assertThat(marshalled).contains("<host:status s=\"clientUpdateProhibited\"/>");
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
@@ -267,8 +267,7 @@ public class DomainToXjcConverterTest {
|
||||
.setCreationTimeForTest(DateTime.parse("1900-01-01T00:00:00Z"))
|
||||
.setPersistedCurrentSponsorRegistrarId("TheRegistrar")
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(123, 200, 230, base16().decode("1234567890"))))
|
||||
ImmutableSet.of(DomainDsData.create(123, 200, 230, base16().decode("1234567890"))))
|
||||
.setDomainName(Idn.toASCII("love.みんな"))
|
||||
.setLastTransferTime(DateTime.parse("1910-01-01T00:00:00Z"))
|
||||
.setLastEppUpdateRegistrarId("TheRegistrar")
|
||||
|
||||
@@ -38,7 +38,7 @@ import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
@@ -112,8 +112,7 @@ final class RdeFixtures {
|
||||
.setPersistedCurrentSponsorRegistrarId("TheRegistrar")
|
||||
.setCreationTimeForTest(clock.nowUtc())
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(123, 200, 230, base16().decode("1234567890"))))
|
||||
ImmutableSet.of(DomainDsData.create(123, 200, 230, base16().decode("1234567890"))))
|
||||
.setDomainName(Idn.toASCII("love." + tld))
|
||||
.setLastTransferTime(DateTime.parse("1990-01-01T00:00:00Z"))
|
||||
.setLastEppUpdateRegistrarId("IntoTheTempest")
|
||||
|
||||
+5
-5
@@ -89,13 +89,13 @@ public class Spec11RegistrarThreatMatchesParserTest {
|
||||
"threatType", "MALWARE",
|
||||
"platformType", "ANY_PLATFORM",
|
||||
"threatEntryMetaData", "NONE",
|
||||
"fullyQualifiedDomainName", "c.com")));
|
||||
"domainName", "c.com")));
|
||||
ThreatMatch objectWithoutExtraFields =
|
||||
ThreatMatch.fromJSON(
|
||||
new JSONObject(
|
||||
ImmutableMap.of(
|
||||
"threatType", "MALWARE",
|
||||
"fullyQualifiedDomainName", "c.com")));
|
||||
"domainName", "c.com")));
|
||||
|
||||
assertThat(objectWithExtraFields).isEqualTo(objectWithoutExtraFields);
|
||||
}
|
||||
@@ -113,7 +113,7 @@ public class Spec11RegistrarThreatMatchesParserTest {
|
||||
new JSONObject(
|
||||
ImmutableMap.of(
|
||||
"threatType", "MALWARE",
|
||||
"fullyQualifiedDomainName", "a.com")))));
|
||||
"domainName", "a.com")))));
|
||||
}
|
||||
|
||||
static RegistrarThreatMatches getMatchB() throws Exception {
|
||||
@@ -124,12 +124,12 @@ public class Spec11RegistrarThreatMatchesParserTest {
|
||||
new JSONObject(
|
||||
ImmutableMap.of(
|
||||
"threatType", "MALWARE",
|
||||
"fullyQualifiedDomainName", "b.com"))),
|
||||
"domainName", "b.com"))),
|
||||
ThreatMatch.fromJSON(
|
||||
new JSONObject(
|
||||
ImmutableMap.of(
|
||||
"threatType", "MALWARE",
|
||||
"fullyQualifiedDomainName", "c.com")))));
|
||||
"domainName", "c.com")))));
|
||||
}
|
||||
|
||||
private void setupFile(String fileWithContent, String fileDate) {
|
||||
|
||||
@@ -113,7 +113,6 @@ import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -984,32 +983,12 @@ public final class DatabaseHelper {
|
||||
return createRepoId(allocateId(), getContactAndHostRoidSuffix());
|
||||
}
|
||||
|
||||
private static <R extends ImmutableObject> void saveResource(R resource) {
|
||||
if (tm().isOfy()) {
|
||||
Consumer<ImmutableObject> saver = tm()::put;
|
||||
saver.accept(resource);
|
||||
if (resource instanceof EppResource) {
|
||||
EppResource eppResource = (EppResource) resource;
|
||||
persistEppResourceExtras(eppResource, saver);
|
||||
}
|
||||
} else {
|
||||
tm().put(resource);
|
||||
}
|
||||
}
|
||||
|
||||
private static <R extends EppResource> void persistEppResourceExtras(
|
||||
R resource, Consumer<ImmutableObject> saver) {
|
||||
assertWithMessage("Cannot persist an EppResource with a missing repoId in tests")
|
||||
.that(resource.getRepoId())
|
||||
.isNotEmpty();
|
||||
}
|
||||
|
||||
/** Persists an object in the DB for tests. */
|
||||
public static <R extends ImmutableObject> R persistResource(final R resource) {
|
||||
assertWithMessage("Attempting to persist a Builder is almost certainly an error in test code")
|
||||
.that(resource)
|
||||
.isNotInstanceOf(Buildable.Builder.class);
|
||||
tm().transact(() -> saveResource(resource));
|
||||
tm().transact(() -> tm().put(resource));
|
||||
maybeAdvanceClock();
|
||||
// Force the session cache to be cleared so that when we read the resource back, we read from
|
||||
// Datastore and not from the session cache. This is needed to trigger Objectify's load process
|
||||
@@ -1026,11 +1005,8 @@ public final class DatabaseHelper {
|
||||
.that(resource)
|
||||
.isNotInstanceOf(Buildable.Builder.class);
|
||||
}
|
||||
// Persist domains ten at a time, to avoid exceeding the entity group limit.
|
||||
for (final List<R> chunk : Iterables.partition(resources, 10)) {
|
||||
tm().transact(() -> chunk.forEach(DatabaseHelper::saveResource));
|
||||
maybeAdvanceClock();
|
||||
}
|
||||
tm().transact(() -> resources.forEach(e -> tm().put(e)));
|
||||
maybeAdvanceClock();
|
||||
// Force the session to be cleared so that when we read it back, we read from Datastore
|
||||
// and not from the transaction's session cache.
|
||||
tm().clearSessionCache();
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.google.common.truth.FailureMetadata;
|
||||
import com.google.common.truth.SimpleSubjectBuilder;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.AuthInfo;
|
||||
import google.registry.testing.TruthChainer.And;
|
||||
import java.util.Set;
|
||||
@@ -40,16 +40,15 @@ public final class DomainSubject extends AbstractEppResourceSubject<Domain, Doma
|
||||
this.actual = subject;
|
||||
}
|
||||
|
||||
public And<DomainSubject> hasFullyQualifiedDomainName(String fullyQualifiedDomainName) {
|
||||
return hasValue(
|
||||
fullyQualifiedDomainName, actual.getDomainName(), "has fullyQualifiedDomainName");
|
||||
public And<DomainSubject> hasDomainName(String domainName) {
|
||||
return hasValue(domainName, actual.getDomainName(), "has domainName");
|
||||
}
|
||||
|
||||
public And<DomainSubject> hasExactlyDsData(DelegationSignerData... dsData) {
|
||||
public And<DomainSubject> hasExactlyDsData(DomainDsData... dsData) {
|
||||
return hasExactlyDsData(ImmutableSet.copyOf(dsData));
|
||||
}
|
||||
|
||||
public And<DomainSubject> hasExactlyDsData(Set<DelegationSignerData> dsData) {
|
||||
public And<DomainSubject> hasExactlyDsData(Set<DomainDsData> dsData) {
|
||||
return hasValue(dsData, actual.getDsData(), "has dsData");
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import google.registry.model.contact.PostalInfo;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.host.Host;
|
||||
@@ -346,7 +346,7 @@ public final class FullFieldsTestEntityHelper {
|
||||
StatusValue.CLIENT_RENEW_PROHIBITED,
|
||||
StatusValue.CLIENT_TRANSFER_PROHIBITED,
|
||||
StatusValue.SERVER_UPDATE_PROHIBITED))
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, "deadface")));
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, "deadface")));
|
||||
if (registrant != null) {
|
||||
builder.setRegistrant(registrant.createVKey());
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.net.InetAddresses;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.Host;
|
||||
import google.registry.testing.DatabaseHelper;
|
||||
@@ -148,10 +148,8 @@ class GenerateDnsReportCommandTest extends CommandTestCase<GenerateDnsReportComm
|
||||
.setNameservers(ImmutableSet.of(nameserver1.createVKey(), nameserver2.createVKey()))
|
||||
.setDsData(
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(
|
||||
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")),
|
||||
DelegationSignerData.create(
|
||||
56789, 2, 4, base16().decode("69FD46E6C4A45C55D4AC"))))
|
||||
DomainDsData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")),
|
||||
DomainDsData.create(56789, 2, 4, base16().decode("69FD46E6C4A45C55D4AC"))))
|
||||
.build());
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain("foobar.xn--q9jyb4c")
|
||||
|
||||
@@ -37,7 +37,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
||||
void testSuccess() throws Exception {
|
||||
persistActiveDomain("example.tld");
|
||||
runCommand("example.tld");
|
||||
assertInStdout("fullyQualifiedDomainName=example.tld");
|
||||
assertInStdout("domainName=example.tld");
|
||||
assertInStdout("Contact=VKey<Contact>(sql:3-ROID");
|
||||
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE");
|
||||
}
|
||||
@@ -46,7 +46,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
||||
void testSuccess_expand() throws Exception {
|
||||
persistActiveDomain("example.tld");
|
||||
runCommand("example.tld", "--expand");
|
||||
assertInStdout("fullyQualifiedDomainName=example.tld");
|
||||
assertInStdout("domainName=example.tld");
|
||||
assertInStdout("sqlKey=3-ROID");
|
||||
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE");
|
||||
assertNotInStdout("LiveRef");
|
||||
@@ -57,7 +57,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
||||
createTld("xn--q9jyb4c");
|
||||
persistActiveDomain("xn--aualito-txac.xn--q9jyb4c");
|
||||
runCommand("çauçalito.みんな", "--expand");
|
||||
assertInStdout("fullyQualifiedDomainName=xn--aualito-txac.xn--q9jyb4c");
|
||||
assertInStdout("domainName=xn--aualito-txac.xn--q9jyb4c");
|
||||
assertInStdout("sqlKey=4-ROID");
|
||||
}
|
||||
|
||||
@@ -66,10 +66,10 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
||||
persistActiveDomain("example.tld");
|
||||
persistActiveDomain("example2.tld");
|
||||
runCommand("example.tld", "example2.tld");
|
||||
assertInStdout("fullyQualifiedDomainName=example.tld");
|
||||
assertInStdout("fullyQualifiedDomainName=example2.tld");
|
||||
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTItVExE");
|
||||
assertInStdout("Websafe key: " + "kind:Domain" + "@sql:rO0ABXQABTQtVExE");
|
||||
assertInStdout("domainName=example.tld");
|
||||
assertInStdout("domainName=example2.tld");
|
||||
assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTItVExE");
|
||||
assertInStdout("Websafe key: kind:Domain@sql:rO0ABXQABTQtVExE");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -112,7 +112,7 @@ class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
||||
persistActiveDomain("example.tld");
|
||||
createTld("com");
|
||||
runCommand("example.com", "example.tld");
|
||||
assertInStdout("fullyQualifiedDomainName=example.tld");
|
||||
assertInStdout("domainName=example.tld");
|
||||
assertInStdout("Domain 'example.com' does not exist or is deleted");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,16 +41,16 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
|
||||
void testSuccess() throws Exception {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
runCommand("ns1.example.tld");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.tld");
|
||||
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA");
|
||||
assertInStdout("hostName=ns1.example.tld");
|
||||
assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_expand() throws Exception {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
runCommand("ns1.example.tld", "--expand");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.tld");
|
||||
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA");
|
||||
assertInStdout("hostName=ns1.example.tld");
|
||||
assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA");
|
||||
assertNotInStdout("LiveRef");
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
persistActiveHost("ns2.example.tld");
|
||||
runCommand("ns1.example.tld", "ns2.example.tld");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.tld");
|
||||
assertInStdout("fullyQualifiedHostName=ns2.example.tld");
|
||||
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjItUk9JRA");
|
||||
assertInStdout("Websafe key: " + "kind:Host" + "@sql:rO0ABXQABjMtUk9JRA");
|
||||
assertInStdout("hostName=ns1.example.tld");
|
||||
assertInStdout("hostName=ns2.example.tld");
|
||||
assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjItUk9JRA");
|
||||
assertInStdout("Websafe key: kind:Host@sql:rO0ABXQABjMtUk9JRA");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -71,8 +71,8 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
|
||||
createTld("tld2");
|
||||
persistActiveHost("ns1.example.tld2");
|
||||
runCommand("ns1.example.tld", "ns1.example.tld2");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.tld");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.tld2");
|
||||
assertInStdout("hostName=ns1.example.tld");
|
||||
assertInStdout("hostName=ns1.example.tld2");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -100,7 +100,7 @@ class GetHostCommandTest extends CommandTestCase<GetHostCommand> {
|
||||
void testSuccess_externalHost() throws Exception {
|
||||
persistActiveHost("ns1.example.foo");
|
||||
runCommand("ns1.example.foo");
|
||||
assertInStdout("fullyQualifiedHostName=ns1.example.foo");
|
||||
assertInStdout("hostName=ns1.example.foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.beust.jcommander.ParameterException;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.Host;
|
||||
import google.registry.persistence.VKey;
|
||||
@@ -44,7 +44,7 @@ class UniformRapidSuspensionCommandTest
|
||||
private Host urs1;
|
||||
private Host urs2;
|
||||
private Domain defaultDomain;
|
||||
private ImmutableSet<DelegationSignerData> defaultDsData;
|
||||
private ImmutableSet<DomainDsData> defaultDsData;
|
||||
|
||||
@BeforeEach
|
||||
void beforeEach() {
|
||||
@@ -58,12 +58,12 @@ class UniformRapidSuspensionCommandTest
|
||||
defaultDomain = DatabaseHelper.newDomain("evil.tld");
|
||||
defaultDsData =
|
||||
ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 2, 3, new HexBinaryAdapter().unmarshal("dead")),
|
||||
DelegationSignerData.create(4, 5, 6, new HexBinaryAdapter().unmarshal("beef")));
|
||||
DomainDsData.create(1, 2, 3, new HexBinaryAdapter().unmarshal("dead")),
|
||||
DomainDsData.create(4, 5, 6, new HexBinaryAdapter().unmarshal("beef")));
|
||||
}
|
||||
|
||||
private void persistDomainWithHosts(
|
||||
Domain domain, ImmutableSet<DelegationSignerData> dsData, Host... hosts) {
|
||||
Domain domain, ImmutableSet<DomainDsData> dsData, Host... hosts) {
|
||||
ImmutableSet.Builder<VKey<Host>> hostRefs = new ImmutableSet.Builder<>();
|
||||
for (Host host : hosts) {
|
||||
hostRefs.add(host.createVKey());
|
||||
|
||||
@@ -354,7 +354,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
||||
@Test
|
||||
void testSuccess_setAllowedNameserversOverwrites() throws Exception {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(
|
||||
ImmutableSet.of("ns1.example.tld", "ns2.example.tld"))
|
||||
.build());
|
||||
@@ -366,7 +367,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
||||
@Test
|
||||
void testSuccess_addAllowedNameservers() throws Exception {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.com"))
|
||||
.build());
|
||||
runCommandForced("--add_allowed_nameservers=ns2.example.com", "xn--q9jyb4c");
|
||||
@@ -377,7 +379,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
||||
@Test
|
||||
void testSuccess_removeAllAllowedNameservers() throws Exception {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(
|
||||
ImmutableSet.of("ns1.example.com", "ns2.example.com"))
|
||||
.build());
|
||||
@@ -388,7 +391,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
||||
@Test
|
||||
void testSuccess_removeSomeAllowedNameservers() throws Exception {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(
|
||||
ImmutableSet.of("ns1.example.com", "ns2.example.com"))
|
||||
.build());
|
||||
@@ -782,7 +786,8 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
||||
@Test
|
||||
void testFailure_cantAddDuplicateAllowedNameservers() {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(
|
||||
ImmutableSet.of("ns1.example.com", "ns2.example.com"))
|
||||
.build());
|
||||
@@ -796,9 +801,9 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
||||
@Test
|
||||
void testFailure_cantRemoveAllowedNameserverThatIsntPresent() {
|
||||
persistResource(
|
||||
Registry.get("xn--q9jyb4c").asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(
|
||||
ImmutableSet.of("ns1.example.com"))
|
||||
Registry.get("xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.com"))
|
||||
.build());
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
|
||||
@@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.gcs.GcsUtils;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.Host;
|
||||
import google.registry.persistence.VKey;
|
||||
@@ -82,7 +82,7 @@ class GenerateZoneFilesActionTest {
|
||||
DatabaseHelper.newDomain("ns-and-ds.tld")
|
||||
.asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain("ns-only.tld").asBuilder().addNameservers(nameservers).build());
|
||||
@@ -110,7 +110,7 @@ class GenerateZoneFilesActionTest {
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain("ds-only.tld")
|
||||
.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
persistActiveContact("ignored_contact");
|
||||
persistActiveHost("ignored.host.tld"); // No ips.
|
||||
@@ -120,7 +120,7 @@ class GenerateZoneFilesActionTest {
|
||||
DatabaseHelper.newDomain("ignored.com")
|
||||
.asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
|
||||
GenerateZoneFilesAction action = new GenerateZoneFilesAction();
|
||||
|
||||
@@ -142,17 +142,17 @@ class ListDomainsActionTest extends ListActionTestCase {
|
||||
@Test
|
||||
void testRun_twoLinesWithIdOnlyExplicitHeader() {
|
||||
action.tlds = ImmutableSet.of("foo");
|
||||
persistActiveDomain("example1.foo", DateTime.parse("2010-03-04T16:00:00Z"));
|
||||
persistActiveDomain("example2.foo", DateTime.parse("2011-03-04T16:00:00Z"));
|
||||
persistActiveDomain("test1.foo", DateTime.parse("2010-03-04T16:00:00Z"));
|
||||
persistActiveDomain("test2.foo", DateTime.parse("2011-03-04T16:00:00Z"));
|
||||
testRunSuccess(
|
||||
action,
|
||||
Optional.empty(),
|
||||
Optional.of(true),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedDomainName$",
|
||||
"^domainName$",
|
||||
"^-+\\s*$",
|
||||
"^example1.foo\\s*$",
|
||||
"^example2.foo\\s*$");
|
||||
"^test1.foo\\s*$",
|
||||
"^test2.foo\\s*$");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -165,7 +165,7 @@ class ListDomainsActionTest extends ListActionTestCase {
|
||||
Optional.of("repoId"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedDomainName\\s+repoId\\s*$",
|
||||
"^domainName\\s+repoId\\s*$",
|
||||
"^-+\\s+-+\\s*$",
|
||||
"^example1.foo\\s+2-FOO\\s*$",
|
||||
"^example3.foo\\s+4-FOO\\s*$");
|
||||
@@ -195,7 +195,7 @@ class ListDomainsActionTest extends ListActionTestCase {
|
||||
Optional.of("repoId"),
|
||||
Optional.of(true),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedDomainName\\s+repoId\\s*$",
|
||||
"^domainName\\s+repoId\\s*$",
|
||||
"^-+\\s+-+\\s*$",
|
||||
"^example1.foo\\s+2-FOO\\s*$",
|
||||
"^example3.foo\\s+4-FOO\\s*$");
|
||||
@@ -211,7 +211,7 @@ class ListDomainsActionTest extends ListActionTestCase {
|
||||
Optional.of("*"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedDomainName\\s+.*repoId",
|
||||
"^domainName\\s+.*repoId",
|
||||
"^-+\\s+-+",
|
||||
"^example1.foo\\s+.*2-FOO",
|
||||
"^example3.foo\\s+.*4-FOO");
|
||||
@@ -227,7 +227,7 @@ class ListDomainsActionTest extends ListActionTestCase {
|
||||
Optional.of("*,repoId"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedDomainName\\s+.*repoId",
|
||||
"^domainName\\s+.*repoId",
|
||||
"^-+\\s+-+",
|
||||
"^example1.foo\\s+.*2-FOO",
|
||||
"^example3.foo\\s+.*4-FOO");
|
||||
|
||||
@@ -53,7 +53,7 @@ class ListHostsActionTest extends ListActionTestCase {
|
||||
Optional.of("repoId"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedHostName\\s+repoId\\s*$",
|
||||
"^hostName\\s+repoId\\s*$",
|
||||
"^-+\\s+-+\\s*$",
|
||||
"^example1.foo\\s+3-ROID\\s*$",
|
||||
"^example2.foo\\s+2-ROID\\s*$");
|
||||
@@ -68,7 +68,7 @@ class ListHostsActionTest extends ListActionTestCase {
|
||||
Optional.of("*"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedHostName\\s+.*repoId",
|
||||
"^hostName\\s+.*repoId",
|
||||
"^-+\\s+-+",
|
||||
"^example1.foo\\s+.*2",
|
||||
"^example2.foo\\s+.*1");
|
||||
@@ -83,7 +83,7 @@ class ListHostsActionTest extends ListActionTestCase {
|
||||
Optional.of("*,repoId"),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
"^fullyQualifiedHostName\\s+.*repoId",
|
||||
"^hostName\\s+.*repoId",
|
||||
"^-+\\s+-+",
|
||||
"^example1.foo\\s+.*2",
|
||||
"^example2.foo\\s+.*1");
|
||||
|
||||
@@ -145,7 +145,7 @@ public class RegistrarConsoleWebTest extends WebDriverTestCase {
|
||||
driver.setFormFieldsById(
|
||||
new ImmutableMap.Builder<String, String>()
|
||||
.put("emailAddress", "test1@example.com")
|
||||
.put("clientIdentifier", "ignored")
|
||||
.put("registrarId", "ignored")
|
||||
.put("whoisServer", "foo.bar.baz")
|
||||
.put("url", "blah.blar")
|
||||
.put("phoneNumber", "+1.2125650000")
|
||||
|
||||
@@ -31,7 +31,7 @@ import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.Host;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
@@ -268,7 +268,7 @@ class DomainWhoisResponseTest {
|
||||
DesignatedContact.create(DesignatedContact.Type.ADMIN, adminResourceKey),
|
||||
DesignatedContact.create(DesignatedContact.Type.TECH, techResourceKey)))
|
||||
.setNameservers(ImmutableSet.of(host1VKey, host2VKey))
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, "deadface")))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, "deadface")))
|
||||
.setGracePeriods(
|
||||
ImmutableSet.of(
|
||||
GracePeriod.create(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Map from registrar email / name to detected domain name threats:
|
||||
{"threatMatches":[{"threatType":"UNWANTED_SOFTWARE","fullyQualifiedDomainName":"anti-anti-anti-virus.dev"}],"registrarClientId":"cool-registrar","registrarEmailAddress":"cool@aid.net"}
|
||||
{"threatMatches":[{"threatType":"MALWARE","fullyQualifiedDomainName":"111.com"},{"threatType":"POTENTIALLY_HARMFUL_APPLICATION","fullyQualifiedDomainName":"bitcoin.bank"}],"registrarClientId":"hello-registrar","registrarEmailAddress":"email@hello.net"}
|
||||
{"threatMatches":[{"threatType":"THREAT_TYPE_UNSPECIFIED","fullyQualifiedDomainName":"no-eamil.com"},{"threatType":"SOCIAL_ENGINEERING","fullyQualifiedDomainName":"party-night.net"}],"registrarClientId":"kitty-registrar","registrarEmailAddress":"contact@kit.ty"}
|
||||
{"threatMatches":[{"threatType":"UNWANTED_SOFTWARE","domainName":"anti-anti-anti-virus.dev"}],"registrarClientId":"cool-registrar","registrarEmailAddress":"cool@aid.net"}
|
||||
{"threatMatches":[{"threatType":"MALWARE","domainName":"111.com"},{"threatType":"POTENTIALLY_HARMFUL_APPLICATION","domainName":"bitcoin.bank"}],"registrarClientId":"hello-registrar","registrarEmailAddress":"email@hello.net"}
|
||||
{"threatMatches":[{"threatType":"THREAT_TYPE_UNSPECIFIED","domainName":"no-eamil.com"},{"threatType":"SOCIAL_ENGINEERING","domainName":"party-night.net"}],"registrarClientId":"kitty-registrar","registrarEmailAddress":"contact@kit.ty"}
|
||||
@@ -49,7 +49,7 @@ class google.registry.model.domain.Domain {
|
||||
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$OneTime> deletePollMessage;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String fullyQualifiedDomainName;
|
||||
java.lang.String domainName;
|
||||
java.lang.String idnTableName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.lang.String smdId;
|
||||
@@ -72,7 +72,7 @@ class google.registry.model.domain.DomainBase {
|
||||
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$OneTime> deletePollMessage;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String fullyQualifiedDomainName;
|
||||
java.lang.String domainName;
|
||||
java.lang.String idnTableName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.lang.String smdId;
|
||||
@@ -104,7 +104,7 @@ class google.registry.model.host.Host {
|
||||
google.registry.persistence.VKey<google.registry.model.domain.Domain> superordinateDomain;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String fullyQualifiedHostName;
|
||||
java.lang.String hostName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.util.Set<java.net.InetAddress> inetAddresses;
|
||||
org.joda.time.DateTime deletionTime;
|
||||
@@ -117,7 +117,7 @@ class google.registry.model.host.HostBase {
|
||||
google.registry.persistence.VKey<google.registry.model.domain.Domain> superordinateDomain;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String fullyQualifiedHostName;
|
||||
java.lang.String hostName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.util.Set<java.net.InetAddress> inetAddresses;
|
||||
org.joda.time.DateTime deletionTime;
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
|
||||
-- Determine the number of domains each registrar sponsors per tld.
|
||||
|
||||
-- This is just the number of fullyQualifiedDomainNames under each
|
||||
-- This is just the number of domainNames under each
|
||||
-- tld-registrar pair.
|
||||
|
||||
SELECT
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Map from registrar email / name to detected subdomain threats:
|
||||
{"threatMatches":[{"threatType":"MALWARE","fullyQualifiedDomainName":"a.com"}],"registrarClientId":"TheRegistrar","registrarEmailAddress":"the.registrar@example.com"}
|
||||
{"threatMatches":[{"threatType":"MALWARE","fullyQualifiedDomainName":"b.com"},{"threatType":"MALWARE","fullyQualifiedDomainName":"c.com"}],"registrarClientId":"NewRegistrar","registrarEmailAddress":"new.registrar@example.com"}
|
||||
{"threatMatches":[{"threatType":"MALWARE","domainName":"a.com"}],"registrarClientId":"TheRegistrar","registrarEmailAddress":"the.registrar@example.com"}
|
||||
{"threatMatches":[{"threatType":"MALWARE","domainName":"b.com"},{"threatType":"MALWARE","domainName":"c.com"}],"registrarClientId":"NewRegistrar","registrarEmailAddress":"new.registrar@example.com"}
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
Map from registrar email to detected subdomain threats:
|
||||
{"threatMatches":[{"threatEntryMetadata":"NONE","threatType":"MALWARE","fullyQualifiedDomainName":"a.dev","platformType":"ANY_PLATFORM"}],"registrarEmailAddress":"a@fake.com"}
|
||||
{"threatMatches":[{"threatEntryMetadata":"NONE","threatType":"MALWARE","fullyQualifiedDomainName":"b.com","platformType":"ANY_PLATFORM"},{"threatEntryMetadata":"NONE","threatType":"MALWARE","fullyQualifiedDomainName":"c.com","platformType":"ANY_PLATFORM"}],"registrarEmailAddress":"b@fake.com"}
|
||||
{"threatMatches":[{"threatEntryMetadata":"NONE","threatType":"MALWARE","domainName":"a.dev","platformType":"ANY_PLATFORM"}],"registrarEmailAddress":"a@fake.com"}
|
||||
{"threatMatches":[{"threatEntryMetadata":"NONE","threatType":"MALWARE","domainName":"b.com","platformType":"ANY_PLATFORM"},{"threatEntryMetadata":"NONE","threatType":"MALWARE","domainName":"c.com","platformType":"ANY_PLATFORM"}],"registrarEmailAddress":"b@fake.com"}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"op": "update",
|
||||
"id": "TheRegistrar",
|
||||
"args": {
|
||||
"clientIdentifier": "theregistrar",
|
||||
"registrarId": "theregistrar",
|
||||
"driveFolderId": null,
|
||||
"registrarName": "The Registrar",
|
||||
"lastUpdateTime": "%LAST_UPDATE_TIME%",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"op": "update",
|
||||
"id": "TheRegistrar",
|
||||
"args": {
|
||||
"clientIdentifier": "theregistrar",
|
||||
"registrarId": "theregistrar",
|
||||
"driveFolderId": null,
|
||||
"registrarName": "The Registrar",
|
||||
"lastUpdateTime": "%LAST_UPDATE_TIME%",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
The following changes were made in registry unittest environment to the registrar TheRegistrar by user user@email.com:
|
||||
|
||||
whoisServer: null -> foo.bar.baz
|
||||
ipAddressWhitelist: null -> [1.1.1.1/32, 2.2.2.2/32, 4.4.4.4/32]
|
||||
ipAddressAllowList: null -> [1.1.1.1/32, 2.2.2.2/32, 4.4.4.4/32]
|
||||
localizedAddress.street.0: 123 Example Bőulevard -> 123 Street Rd
|
||||
localizedAddress.street.1: null -> Ste 156
|
||||
localizedAddress.city: Williamsburg -> New York
|
||||
|
||||
Reference in New Issue
Block a user