mirror of
https://github.com/google/nomulus.git
synced 2025-08-05 17:28:25 +02:00
Remove unnecessary generic type arguments
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=175155365
This commit is contained in:
parent
8dcc2d6833
commit
2aa897e698
140 changed files with 355 additions and 465 deletions
|
@ -116,7 +116,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
Set<ImmutableObject> ibEntities = persistLotsOfDomains("ib-any.test");
|
||||
runMapreduce();
|
||||
assertDeleted(ibEntities);
|
||||
assertNotDeleted(ImmutableSet.<ImmutableObject>of(nic, fkiNic));
|
||||
assertNotDeleted(ImmutableSet.of(nic, fkiNic));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -254,7 +254,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
ForeignKeyIndex.load(DomainResource.class, fqdn, START_OF_TIME);
|
||||
EppResourceIndex eppIndex =
|
||||
ofy().load().entity(EppResourceIndex.create(Key.create(domain))).now();
|
||||
return ImmutableSet.<ImmutableObject>of(
|
||||
return ImmutableSet.of(
|
||||
domain, historyEntry, billingEvent, pollMessage, fki, eppIndex);
|
||||
}
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ public class MapreduceEntityCleanupActionTest
|
|||
createMapreduce("jobname");
|
||||
executeTasksUntilEmpty(QUEUE_NAME, clock);
|
||||
setJobIdJobNameAndDaysOld(
|
||||
Optional.<String>empty(), Optional.<String>empty(), Optional.<Integer>empty());
|
||||
Optional.empty(), Optional.empty(), Optional.empty());
|
||||
|
||||
action.run();
|
||||
|
||||
|
@ -349,11 +349,11 @@ public class MapreduceEntityCleanupActionTest
|
|||
executeTasksUntilEmpty(QUEUE_NAME, clock);
|
||||
clock.setTo(DateTime.now(UTC));
|
||||
action = new MapreduceEntityCleanupAction(
|
||||
Optional.<String>empty(), // jobId
|
||||
Optional.<String>empty(), // jobName
|
||||
Optional.<Integer>of(1), // numJobsToDelete
|
||||
Optional.<Integer>of(0), // daysOld
|
||||
Optional.<Boolean>empty(), // force
|
||||
Optional.empty(), // jobId
|
||||
Optional.empty(), // jobName
|
||||
Optional.of(1), // numJobsToDelete
|
||||
Optional.of(0), // daysOld
|
||||
Optional.empty(), // force
|
||||
mapreduceEntityCleanupUtil,
|
||||
clock,
|
||||
DatastoreServiceFactory.getDatastoreService(),
|
||||
|
@ -428,10 +428,10 @@ public class MapreduceEntityCleanupActionTest
|
|||
clock.setTo(DateTime.now(UTC));
|
||||
action = new MapreduceEntityCleanupAction(
|
||||
Optional.of(jobId2), // jobId
|
||||
Optional.<String>empty(), // jobName
|
||||
Optional.<Integer>empty(), // numJobsToDelete
|
||||
Optional.<Integer>empty(), // daysOld
|
||||
Optional.<Boolean>empty(), // force
|
||||
Optional.empty(), // jobName
|
||||
Optional.empty(), // numJobsToDelete
|
||||
Optional.empty(), // daysOld
|
||||
Optional.empty(), // force
|
||||
mapreduceEntityCleanupUtil,
|
||||
clock,
|
||||
DatastoreServiceFactory.getDatastoreService(),
|
||||
|
@ -453,7 +453,7 @@ public class MapreduceEntityCleanupActionTest
|
|||
@Test
|
||||
public void testDeleteOfRunningJob_fails() throws Exception {
|
||||
String jobId = createMapreduce("jobname");
|
||||
executeTasks(QUEUE_NAME, clock, Optional.<Integer>of(10));
|
||||
executeTasks(QUEUE_NAME, clock, Optional.of(10));
|
||||
setJobId(jobId);
|
||||
|
||||
action.run();
|
||||
|
@ -469,13 +469,13 @@ public class MapreduceEntityCleanupActionTest
|
|||
@Test
|
||||
public void testDeleteOfRunningJob_succeedsWithForce() throws Exception {
|
||||
String jobId = createMapreduce("jobname");
|
||||
executeTasks(QUEUE_NAME, clock, Optional.<Integer>of(10));
|
||||
executeTasks(QUEUE_NAME, clock, Optional.of(10));
|
||||
clock.setTo(DateTime.now(UTC));
|
||||
action = new MapreduceEntityCleanupAction(
|
||||
Optional.of(jobId),
|
||||
Optional.<String>empty(), // jobName
|
||||
Optional.<Integer>empty(), // numJobsToDelete
|
||||
Optional.<Integer>empty(), // daysOld
|
||||
Optional.empty(), // jobName
|
||||
Optional.empty(), // numJobsToDelete
|
||||
Optional.empty(), // daysOld
|
||||
Optional.of(true), // force
|
||||
mapreduceEntityCleanupUtil,
|
||||
clock,
|
||||
|
@ -497,7 +497,7 @@ public class MapreduceEntityCleanupActionTest
|
|||
@Test
|
||||
public void testJobIdAndJobName_fails() throws Exception {
|
||||
setJobIdJobNameAndDaysOld(
|
||||
Optional.of("jobid"), Optional.of("jobname"), Optional.<Integer>empty());
|
||||
Optional.of("jobid"), Optional.of("jobname"), Optional.empty());
|
||||
|
||||
action.run();
|
||||
|
||||
|
@ -509,7 +509,7 @@ public class MapreduceEntityCleanupActionTest
|
|||
|
||||
@Test
|
||||
public void testJobIdAndDaysOld_fails() throws Exception {
|
||||
setJobIdJobNameAndDaysOld(Optional.of("jobid"), Optional.<String>empty(), Optional.of(0));
|
||||
setJobIdJobNameAndDaysOld(Optional.of("jobid"), Optional.empty(), Optional.of(0));
|
||||
|
||||
action.run();
|
||||
|
||||
|
@ -524,10 +524,10 @@ public class MapreduceEntityCleanupActionTest
|
|||
public void testJobIdAndNumJobs_fails() throws Exception {
|
||||
action = new MapreduceEntityCleanupAction(
|
||||
Optional.of("jobid"),
|
||||
Optional.<String>empty(), // jobName
|
||||
Optional.empty(), // jobName
|
||||
Optional.of(1), // numJobsToDelete
|
||||
Optional.<Integer>empty(), // daysOld
|
||||
Optional.<Boolean>empty(), // force
|
||||
Optional.empty(), // daysOld
|
||||
Optional.empty(), // force
|
||||
mapreduceEntityCleanupUtil,
|
||||
clock,
|
||||
DatastoreServiceFactory.getDatastoreService(),
|
||||
|
@ -545,11 +545,11 @@ public class MapreduceEntityCleanupActionTest
|
|||
@Test
|
||||
public void testDeleteZeroJobs_throwsUsageError() throws Exception {
|
||||
new MapreduceEntityCleanupAction(
|
||||
Optional.<String>empty(), // jobId
|
||||
Optional.<String>empty(), // jobName
|
||||
Optional.<Integer>of(0), // numJobsToDelete
|
||||
Optional.<Integer>empty(), // daysOld
|
||||
Optional.<Boolean>empty(), // force
|
||||
Optional.empty(), // jobId
|
||||
Optional.empty(), // jobName
|
||||
Optional.of(0), // numJobsToDelete
|
||||
Optional.empty(), // daysOld
|
||||
Optional.empty(), // force
|
||||
mapreduceEntityCleanupUtil,
|
||||
clock,
|
||||
DatastoreServiceFactory.getDatastoreService(),
|
||||
|
|
|
@ -86,7 +86,7 @@ public class TldFanoutActionTest {
|
|||
action.queue = getLast(params.get("queue"));
|
||||
action.excludes = params.containsKey("exclude")
|
||||
? ImmutableSet.copyOf(Splitter.on(',').split(params.get("exclude").get(0)))
|
||||
: ImmutableSet.<String>of();
|
||||
: ImmutableSet.of();
|
||||
action.taskEnqueuer = new TaskEnqueuer(new Retrier(null, 1));
|
||||
action.response = response;
|
||||
action.runInEmpty = params.containsKey("runInEmpty");
|
||||
|
|
|
@ -84,8 +84,8 @@ public class PublishDnsUpdatesActionTest {
|
|||
PublishDnsUpdatesAction action = new PublishDnsUpdatesAction();
|
||||
action.timeout = Duration.standardSeconds(10);
|
||||
action.tld = tld;
|
||||
action.hosts = ImmutableSet.<String>of();
|
||||
action.domains = ImmutableSet.<String>of();
|
||||
action.hosts = ImmutableSet.of();
|
||||
action.domains = ImmutableSet.of();
|
||||
action.dnsWriter = "mock";
|
||||
action.dnsWriterProxy = new DnsWriterProxy(ImmutableMap.of("mock", dnsWriter));
|
||||
action.dnsMetrics = dnsMetrics;
|
||||
|
|
|
@ -32,7 +32,6 @@ import com.google.api.services.dns.model.Change;
|
|||
import com.google.api.services.dns.model.ResourceRecordSet;
|
||||
import com.google.api.services.dns.model.ResourceRecordSetsListResponse;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.net.InetAddresses;
|
||||
|
@ -305,12 +304,12 @@ public class CloudDnsWriterTest {
|
|||
public void testLoadDomain_nonExistentDomain() throws Exception {
|
||||
writer.publishDomain("example.tld");
|
||||
|
||||
verifyZone(ImmutableSet.<ResourceRecordSet>of());
|
||||
verifyZone(ImmutableSet.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_noDsDataOrNameservers() throws Exception {
|
||||
persistResource(fakeDomain("example.tld", ImmutableSet.<HostResource>of(), 0));
|
||||
persistResource(fakeDomain("example.tld", ImmutableSet.of(), 0));
|
||||
writer.publishDomain("example.tld");
|
||||
|
||||
verifyZone(fakeDomainRecords("example.tld", 0, 0, 0, 0));
|
||||
|
@ -319,7 +318,7 @@ public class CloudDnsWriterTest {
|
|||
@Test
|
||||
public void testLoadDomain_deleteOldData() throws Exception {
|
||||
stubZone = fakeDomainRecords("example.tld", 2, 2, 2, 2);
|
||||
persistResource(fakeDomain("example.tld", ImmutableSet.<HostResource>of(), 0));
|
||||
persistResource(fakeDomain("example.tld", ImmutableSet.of(), 0));
|
||||
writer.publishDomain("example.tld");
|
||||
|
||||
verifyZone(fakeDomainRecords("example.tld", 0, 0, 0, 0));
|
||||
|
@ -378,7 +377,7 @@ public class CloudDnsWriterTest {
|
|||
writer.publishHost("ns1.example.com");
|
||||
|
||||
// external hosts should not be published in our zone
|
||||
verifyZone(ImmutableSet.<ResourceRecordSet>of());
|
||||
verifyZone(ImmutableSet.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -409,7 +408,7 @@ public class CloudDnsWriterTest {
|
|||
CloudDnsWriter spyWriter = spy(writer);
|
||||
when(mutateZoneCallable.call()).thenThrow(ZoneStateException.class).thenReturn(null);
|
||||
when(spyWriter.getMutateZoneCallback(
|
||||
Matchers.<ImmutableMap<String, ImmutableSet<ResourceRecordSet>>>any()))
|
||||
Matchers.any()))
|
||||
.thenReturn(mutateZoneCallable);
|
||||
spyWriter.commit();
|
||||
|
||||
|
@ -428,7 +427,7 @@ public class CloudDnsWriterTest {
|
|||
.build());
|
||||
writer.publishDomain("example.tld");
|
||||
|
||||
verifyZone(ImmutableSet.<ResourceRecordSet>of());
|
||||
verifyZone(ImmutableSet.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -444,7 +443,7 @@ public class CloudDnsWriterTest {
|
|||
|
||||
writer.publishDomain("example.tld");
|
||||
|
||||
verifyZone(ImmutableSet.<ResourceRecordSet>of());
|
||||
verifyZone(ImmutableSet.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -459,7 +458,7 @@ public class CloudDnsWriterTest {
|
|||
.build());
|
||||
writer.publishDomain("example.tld");
|
||||
|
||||
verifyZone(ImmutableSet.<ResourceRecordSet>of());
|
||||
verifyZone(ImmutableSet.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -18,7 +18,6 @@ import static com.google.common.collect.Iterables.getLast;
|
|||
import static com.google.common.io.BaseEncoding.base16;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assert_;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.index.DomainApplicationIndex.loadActiveApplicationsByDomainName;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.testing.DatastoreHelper.assertNoBillingEvents;
|
||||
|
@ -1092,10 +1091,7 @@ public class DomainApplicationCreateFlowTest
|
|||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistContactsAndHosts();
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
runFlow();
|
||||
|
@ -1148,10 +1144,7 @@ public class DomainApplicationCreateFlowTest
|
|||
@Test
|
||||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistContactsAndHosts();
|
||||
clock.advanceOneMilli();
|
||||
runSuperuserFlow("domain_create_sunrise_encoded_signed_mark_response.xml");
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package google.registry.flows.domain;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.EppResourceUtils.isLinked;
|
||||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.model.index.ForeignKeyIndex.loadAndGetKey;
|
||||
|
@ -163,26 +162,18 @@ public class DomainApplicationDeleteFlowTest
|
|||
|
||||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
|
||||
persistResource(
|
||||
newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
|
||||
persistResource(
|
||||
newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_delete_response.xml"));
|
||||
|
|
|
@ -17,7 +17,6 @@ package google.registry.flows.domain;
|
|||
import static com.google.common.collect.Sets.union;
|
||||
import static com.google.common.io.BaseEncoding.base16;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.testing.DatastoreHelper.assertNoBillingEvents;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
|
@ -278,7 +277,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
"domain_update_sunrise_dsdata_rem_all.xml",
|
||||
ImmutableSet.of(SOME_DSDATA, DelegationSignerData.create(
|
||||
12346, 3, 1, base16().decode("38EC35D5B3A34B44C39B"))),
|
||||
ImmutableSet.<DelegationSignerData>of());
|
||||
ImmutableSet.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -576,23 +575,17 @@ public class DomainApplicationUpdateFlowTest
|
|||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
clock.advanceOneMilli();
|
||||
|
|
|
@ -287,10 +287,7 @@ public class DomainCheckFlowTest
|
|||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
@ -299,10 +296,7 @@ public class DomainCheckFlowTest
|
|||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
persistActiveDomain("example2.tld");
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_check_one_tld_response.xml"));
|
||||
}
|
||||
|
@ -415,7 +409,7 @@ public class DomainCheckFlowTest
|
|||
*/
|
||||
@Test
|
||||
public void testAvailExtension_premiumDomainsAreUnavailableWithoutExtension() throws Exception {
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.<String>of());
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.of());
|
||||
createTld("example");
|
||||
setEppInput("domain_check_premium.xml");
|
||||
doCheckTest(create(false, "rich.example", "Premium names require EPP ext."));
|
||||
|
@ -427,7 +421,7 @@ public class DomainCheckFlowTest
|
|||
*/
|
||||
@Test
|
||||
public void testAvailExtension_premiumDomainsAvailableIfNotRequiredByTld() throws Exception {
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.<String>of());
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.of());
|
||||
createTld("example");
|
||||
persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(false).build());
|
||||
setEppInput("domain_check_premium.xml");
|
||||
|
|
|
@ -115,10 +115,7 @@ public class DomainClaimsCheckFlowTest
|
|||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
@ -128,10 +125,7 @@ public class DomainClaimsCheckFlowTest
|
|||
persistClaimsList(
|
||||
ImmutableMap.of("example2", "2013041500/2/6/9/rJ1NrDO92vDsAzf7EQzgjX4R0000000001"));
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
assertTransactionalFlow(false);
|
||||
assertNoHistory(); // Checks don't create a history event.
|
||||
assertNoBillingEvents(); // Checks are always free.
|
||||
|
@ -161,9 +155,8 @@ public class DomainClaimsCheckFlowTest
|
|||
public void testFailure_multipleTlds_oneHasEndedClaims() throws Exception {
|
||||
createTld("tld1");
|
||||
createTld("tld2");
|
||||
persistResource(Registry.get("tld2").asBuilder()
|
||||
.setClaimsPeriodEnd(clock.nowUtc().minusMillis(1))
|
||||
.build());
|
||||
persistResource(
|
||||
Registry.get("tld2").asBuilder().setClaimsPeriodEnd(clock.nowUtc().minusMillis(1)).build());
|
||||
setEppInput("domain_check_claims_multiple_tlds.xml");
|
||||
thrown.expect(ClaimsPeriodEndedException.class);
|
||||
runFlow();
|
||||
|
|
|
@ -201,7 +201,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
: clock.nowUtc().plus(Registry.get(domainTld).getAddGracePeriodLength());
|
||||
ImmutableSet<BillingEvent.Flag> billingFlags = isAnchorTenant
|
||||
? ImmutableSet.of(BillingEvent.Flag.ANCHOR_TENANT)
|
||||
: ImmutableSet.<BillingEvent.Flag>of();
|
||||
: ImmutableSet.of();
|
||||
HistoryEntry historyEntry = getHistoryEntries(domain).get(0);
|
||||
assertAboutDomains().that(domain)
|
||||
.hasRegistrationExpirationTime(
|
||||
|
@ -319,7 +319,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
String domainTld,
|
||||
String responseXmlFile,
|
||||
UserPrivileges userPrivileges) throws Exception {
|
||||
doSuccessfulTest(domainTld, responseXmlFile, userPrivileges, ImmutableMap.<String, String>of());
|
||||
doSuccessfulTest(domainTld, responseXmlFile, userPrivileges, ImmutableMap.of());
|
||||
}
|
||||
|
||||
private void doSuccessfulTest(
|
||||
|
@ -788,7 +788,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
@Test
|
||||
public void testFailure_claimsNoticeProvided_nameNotOnClaimsList() throws Exception {
|
||||
setEppInput("domain_create_claim_notice.xml");
|
||||
persistClaimsList(ImmutableMap.<String, String>of());
|
||||
persistClaimsList(ImmutableMap.of());
|
||||
persistContactsAndHosts();
|
||||
thrown.expect(UnexpectedClaimsNoticeException.class);
|
||||
runFlow();
|
||||
|
@ -1599,7 +1599,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of("irrelevant"))
|
||||
.setAllowedTlds(ImmutableSet.of("irrelevant"))
|
||||
.build());
|
||||
persistContactsAndHosts();
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
|
|
|
@ -16,7 +16,6 @@ package google.registry.flows.domain;
|
|||
|
||||
import static com.google.common.collect.MoreCollectors.onlyElement;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.flows.domain.DomainTransferFlowTestCase.persistWithPendingTransfer;
|
||||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
|
@ -261,7 +260,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
|
||||
private void doImmediateDeleteTest(GracePeriodStatus gracePeriodStatus, String responseFilename)
|
||||
throws Exception {
|
||||
doImmediateDeleteTest(gracePeriodStatus, responseFilename, ImmutableMap.<String, String>of());
|
||||
doImmediateDeleteTest(gracePeriodStatus, responseFilename, ImmutableMap.of());
|
||||
}
|
||||
|
||||
private void doImmediateDeleteTest(
|
||||
|
@ -289,7 +288,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
|
||||
@Test
|
||||
public void testSuccess_addGracePeriodResultsInImmediateDelete() throws Exception {
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.<String>of());
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.of());
|
||||
doImmediateDeleteTest(GracePeriodStatus.ADD, "domain_delete_response.xml");
|
||||
}
|
||||
|
||||
|
@ -313,12 +312,12 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
|
||||
@Test
|
||||
public void testSuccess_sunrushAddGracePeriodResultsInImmediateDelete() throws Exception {
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.<String>of());
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.of());
|
||||
doImmediateDeleteTest(GracePeriodStatus.SUNRUSH_ADD, "domain_delete_response.xml");
|
||||
}
|
||||
|
||||
private void doSuccessfulTest_noAddGracePeriod(String responseFilename) throws Exception {
|
||||
doSuccessfulTest_noAddGracePeriod(responseFilename, ImmutableMap.<String, String>of());
|
||||
doSuccessfulTest_noAddGracePeriod(responseFilename, ImmutableMap.of());
|
||||
}
|
||||
|
||||
private void doSuccessfulTest_noAddGracePeriod(
|
||||
|
@ -372,7 +371,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
|
||||
@Test
|
||||
public void testSuccess_noAddGracePeriodResultsInPendingDelete() throws Exception {
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.<String>of());
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.of());
|
||||
doSuccessfulTest_noAddGracePeriod("domain_delete_response_pending.xml");
|
||||
}
|
||||
|
||||
|
@ -415,7 +414,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
|
||||
@Test
|
||||
public void testSuccess_nonDefaultRedemptionGracePeriod() throws Exception {
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.<String>of());
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.of());
|
||||
persistResource(
|
||||
Registry.get("tld")
|
||||
.asBuilder()
|
||||
|
@ -426,7 +425,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
|
||||
@Test
|
||||
public void testSuccess_nonDefaultPendingDeleteLength() throws Exception {
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.<String>of());
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.of());
|
||||
persistResource(
|
||||
Registry.get("tld")
|
||||
.asBuilder()
|
||||
|
@ -588,7 +587,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
|
||||
@Test
|
||||
public void testUnlinkingOfResources() throws Exception {
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.<String>of());
|
||||
sessionMetadata.setServiceExtensionUris(ImmutableSet.of());
|
||||
setUpSuccessfulTest();
|
||||
// Persist the billing event so it can be retrieved for cancellation generation and checking.
|
||||
BillingEvent.OneTime graceBillingEvent =
|
||||
|
@ -597,11 +596,11 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
setUpGracePeriods(GracePeriod.forBillingEvent(GracePeriodStatus.ADD, graceBillingEvent));
|
||||
// Add a nameserver.
|
||||
HostResource host = persistResource(newHostResource("ns1.example.tld"));
|
||||
persistResource(loadByForeignKey(
|
||||
DomainResource.class, getUniqueIdFromCommand(), clock.nowUtc())
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host)))
|
||||
.build());
|
||||
persistResource(
|
||||
loadByForeignKey(DomainResource.class, getUniqueIdFromCommand(), clock.nowUtc())
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host)))
|
||||
.build());
|
||||
// Persist another domain that's already been deleted and references this contact and host.
|
||||
persistResource(
|
||||
newDomainResource("example1.tld")
|
||||
|
@ -702,10 +701,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
setUpSuccessfulTest();
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
@ -714,10 +710,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
setUpSuccessfulTest();
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_delete_response_pending.xml"));
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package google.registry.flows.domain;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.flows.domain.DomainTransferFlowTestCase.persistWithPendingTransfer;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.testing.DatastoreHelper.assertBillingEvents;
|
||||
|
@ -127,7 +126,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
}
|
||||
|
||||
private void doSuccessfulTest(String responseFilename, int renewalYears) throws Exception {
|
||||
doSuccessfulTest(responseFilename, renewalYears, ImmutableMap.<String, String>of());
|
||||
doSuccessfulTest(responseFilename, renewalYears, ImmutableMap.of());
|
||||
}
|
||||
|
||||
private void doSuccessfulTest(
|
||||
|
@ -625,10 +624,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistDomain();
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
runFlow();
|
||||
|
@ -637,10 +633,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
@Test
|
||||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistDomain();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_renew_response.xml"));
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package google.registry.flows.domain;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.testing.DatastoreHelper.assertBillingEvents;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
|
@ -510,10 +509,7 @@ public class DomainRestoreRequestFlowTest extends
|
|||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistPendingDeleteDomain();
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
runFlow();
|
||||
|
@ -522,10 +518,7 @@ public class DomainRestoreRequestFlowTest extends
|
|||
@Test
|
||||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistPendingDeleteDomain();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_update_response.xml"));
|
||||
|
|
|
@ -16,7 +16,6 @@ package google.registry.flows.domain;
|
|||
|
||||
import static com.google.common.collect.MoreCollectors.onlyElement;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.NET_ADDS_4_YR;
|
||||
import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_SUCCESSFUL;
|
||||
|
@ -309,7 +308,7 @@ public class DomainTransferApproveFlowTest
|
|||
.build())
|
||||
.toArray(BillingEvent.class));
|
||||
// There should be no grace period.
|
||||
assertGracePeriods(domain.getGracePeriods(), ImmutableMap.<GracePeriod, BillingEvent>of());
|
||||
assertGracePeriods(domain.getGracePeriods(), ImmutableMap.of());
|
||||
}
|
||||
|
||||
private void doSuccessfulTest(String tld, String commandFilename, String expectedXmlFilename)
|
||||
|
@ -497,10 +496,7 @@ public class DomainTransferApproveFlowTest
|
|||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
doSuccessfulTest("tld", "domain_transfer_approve.xml", "domain_transfer_approve_response.xml");
|
||||
}
|
||||
|
@ -508,10 +504,7 @@ public class DomainTransferApproveFlowTest
|
|||
@Test
|
||||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE,
|
||||
UserPrivileges.SUPERUSER,
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
package google.registry.flows.domain;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.RESTORED_DOMAINS;
|
||||
import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_SUCCESSFUL;
|
||||
import static google.registry.model.reporting.HistoryEntry.Type.DOMAIN_CREATE;
|
||||
|
@ -304,10 +303,7 @@ public class DomainTransferCancelFlowTest
|
|||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
doSuccessfulTest("domain_transfer_cancel.xml", "domain_transfer_cancel_response.xml");
|
||||
}
|
||||
|
@ -315,15 +311,10 @@ public class DomainTransferCancelFlowTest
|
|||
@Test
|
||||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE,
|
||||
UserPrivileges.SUPERUSER,
|
||||
readFile("domain_transfer_cancel_response.xml"));
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_transfer_cancel_response.xml"));
|
||||
}
|
||||
|
||||
// NB: No need to test pending delete status since pending transfers will get cancelled upon
|
||||
|
|
|
@ -16,7 +16,6 @@ package google.registry.flows.domain;
|
|||
|
||||
import static com.google.common.collect.MoreCollectors.onlyElement;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.NET_RENEWS_3_YR;
|
||||
import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_NACKED;
|
||||
import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_SUCCESSFUL;
|
||||
|
@ -174,10 +173,7 @@ public class DomainTransferRejectFlowTest
|
|||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
doSuccessfulTest("domain_transfer_reject.xml", "domain_transfer_reject_response.xml");
|
||||
}
|
||||
|
@ -185,14 +181,9 @@ public class DomainTransferRejectFlowTest
|
|||
@Test
|
||||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE,
|
||||
UserPrivileges.SUPERUSER,
|
||||
readFile("domain_transfer_reject_response.xml"));
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("domain_transfer_reject_response.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -276,7 +276,7 @@ public class DomainTransferRequestFlowTest
|
|||
.build());
|
||||
} else {
|
||||
// Superuser transfers with no bundled renewal have no transfer billing event.
|
||||
optionalTransferBillingEvent = Optional.<BillingEvent.OneTime>empty();
|
||||
optionalTransferBillingEvent = Optional.empty();
|
||||
}
|
||||
// Construct the autorenew events for the losing/existing client and the gaining one. Note that
|
||||
// all of the other transfer flow tests happen on day 3 of the transfer, but the initial
|
||||
|
@ -347,9 +347,7 @@ public class DomainTransferRequestFlowTest
|
|||
null),
|
||||
optionalTransferBillingEvent.get()));
|
||||
} else {
|
||||
assertGracePeriods(
|
||||
domainAfterAutomaticTransfer.getGracePeriods(),
|
||||
ImmutableMap.<GracePeriod, BillingEvent>of());
|
||||
assertGracePeriods(domainAfterAutomaticTransfer.getGracePeriods(), ImmutableMap.of());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -469,8 +467,8 @@ public class DomainTransferRequestFlowTest
|
|||
commandFilename,
|
||||
expectedXmlFilename,
|
||||
expectedExpirationTime,
|
||||
ImmutableMap.<String, String>of(),
|
||||
Optional.<Money>empty(),
|
||||
ImmutableMap.of(),
|
||||
Optional.empty(),
|
||||
extraExpectedBillingEvents);
|
||||
}
|
||||
|
||||
|
@ -484,7 +482,7 @@ public class DomainTransferRequestFlowTest
|
|||
expectedXmlFilename,
|
||||
domain.getRegistrationExpirationTime().plusYears(1),
|
||||
substitutions,
|
||||
Optional.<Money>empty());
|
||||
Optional.empty());
|
||||
}
|
||||
|
||||
private void doSuccessfulTest(String commandFilename, String expectedXmlFilename)
|
||||
|
@ -568,7 +566,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
private void runTest(String commandFilename, UserPrivileges userPrivileges) throws Exception {
|
||||
runTest(commandFilename, userPrivileges, ImmutableMap.<String, String>of());
|
||||
runTest(commandFilename, userPrivileges, ImmutableMap.of());
|
||||
}
|
||||
|
||||
private void doFailingTest(
|
||||
|
@ -577,7 +575,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
private void doFailingTest(String commandFilename) throws Exception {
|
||||
runTest(commandFilename, UserPrivileges.NORMAL, ImmutableMap.<String, String> of());
|
||||
runTest(commandFilename, UserPrivileges.NORMAL, ImmutableMap.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -756,7 +754,7 @@ public class DomainTransferRequestFlowTest
|
|||
"domain_transfer_request_response_su_ext_zero_period_nonzero_transfer_length.xml",
|
||||
domain.getRegistrationExpirationTime().plusYears(0),
|
||||
ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "5"),
|
||||
Optional.<Money>empty(),
|
||||
Optional.empty(),
|
||||
Period.create(0, Unit.YEARS),
|
||||
Duration.standardDays(5));
|
||||
}
|
||||
|
@ -772,7 +770,7 @@ public class DomainTransferRequestFlowTest
|
|||
"domain_transfer_request_response_su_ext_zero_period_zero_transfer_length.xml",
|
||||
domain.getRegistrationExpirationTime().plusYears(0),
|
||||
ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "0"),
|
||||
Optional.<Money>empty(),
|
||||
Optional.empty(),
|
||||
Period.create(0, Unit.YEARS),
|
||||
Duration.ZERO);
|
||||
}
|
||||
|
@ -788,7 +786,7 @@ public class DomainTransferRequestFlowTest
|
|||
"domain_transfer_request_response_su_ext_one_year_period_nonzero_transfer_length.xml",
|
||||
domain.getRegistrationExpirationTime().plusYears(1),
|
||||
ImmutableMap.of("PERIOD", "1", "AUTOMATIC_TRANSFER_LENGTH", "5"),
|
||||
Optional.<Money>empty(),
|
||||
Optional.empty(),
|
||||
Period.create(1, Unit.YEARS),
|
||||
Duration.standardDays(5));
|
||||
}
|
||||
|
@ -818,7 +816,7 @@ public class DomainTransferRequestFlowTest
|
|||
"domain_transfer_request_response_su_ext_zero_period_autorenew_grace.xml",
|
||||
domain.getRegistrationExpirationTime(),
|
||||
ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "0"),
|
||||
Optional.<Money>empty(),
|
||||
Optional.empty(),
|
||||
Period.create(0, Unit.YEARS),
|
||||
Duration.ZERO);
|
||||
}
|
||||
|
@ -895,10 +893,7 @@ public class DomainTransferRequestFlowTest
|
|||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
setupDomain("example", "tld");
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml");
|
||||
}
|
||||
|
@ -907,10 +902,7 @@ public class DomainTransferRequestFlowTest
|
|||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
setupDomain("example", "tld");
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
clock.advanceOneMilli();
|
||||
// We don't verify the results; just check that the flow doesn't fail.
|
||||
runTest("domain_transfer_request.xml", UserPrivileges.SUPERUSER);
|
||||
|
|
|
@ -17,7 +17,6 @@ package google.registry.flows.domain;
|
|||
import static com.google.common.collect.Sets.union;
|
||||
import static com.google.common.io.BaseEncoding.base16;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.testing.DatastoreHelper.assertBillingEvents;
|
||||
|
@ -592,7 +591,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
"domain_update_dsdata_rem_all.xml",
|
||||
ImmutableSet.of(SOME_DSDATA, DelegationSignerData.create(
|
||||
12346, 3, 1, base16().decode("38EC35D5B3A34B44C39B"))),
|
||||
ImmutableSet.<DelegationSignerData>of());
|
||||
ImmutableSet.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -975,10 +974,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistReferencedEntities();
|
||||
persistDomain();
|
||||
thrown.expect(NotAuthorizedForTldException.class);
|
||||
|
@ -988,10 +984,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
@Test
|
||||
public void testSuccess_superuserNotAuthorizedForTld() throws Exception {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar")
|
||||
.asBuilder()
|
||||
.setAllowedTlds(ImmutableSet.<String>of())
|
||||
.build());
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistReferencedEntities();
|
||||
persistDomain();
|
||||
clock.advanceOneMilli();
|
||||
|
|
|
@ -116,7 +116,7 @@ public class LoginFlowViaTlsTest extends LoginFlowTestCase {
|
|||
CidrAddressBlock.create(InetAddresses.forString("192.168.1.1"), 32),
|
||||
CidrAddressBlock.create(InetAddresses.forString("2001:db8::1"), 128)))
|
||||
.build());
|
||||
credentials = new TlsCredentials(GOOD_CERT, Optional.<String>empty(), "goo.example");
|
||||
credentials = new TlsCredentials(GOOD_CERT, Optional.empty(), "goo.example");
|
||||
doFailingTest("login_valid.xml", BadRegistrarIpAddressException.class);
|
||||
}
|
||||
|
||||
|
|
|
@ -89,8 +89,8 @@ public class RdapActionBaseTest {
|
|||
rdapJsonFormatter.addTopLevelEntries(
|
||||
builder,
|
||||
BoilerplateType.OTHER,
|
||||
ImmutableList.<ImmutableMap<String, Object>>of(),
|
||||
ImmutableList.<ImmutableMap<String, Object>>of(),
|
||||
ImmutableList.of(),
|
||||
ImmutableList.of(),
|
||||
"http://myserver.example.com/");
|
||||
return builder.build();
|
||||
}
|
||||
|
|
|
@ -159,8 +159,8 @@ public class RdapEntityActionTest {
|
|||
action.request = request;
|
||||
action.fullServletPath = "https://example.com/rdap";
|
||||
action.response = response;
|
||||
action.registrarParam = Optional.<String>empty();
|
||||
action.includeDeletedParam = Optional.<Boolean>empty();
|
||||
action.registrarParam = Optional.empty();
|
||||
action.includeDeletedParam = Optional.empty();
|
||||
action.rdapJsonFormatter = RdapTestHelper.getTestRdapJsonFormatter();
|
||||
action.rdapWhoisServer = null;
|
||||
action.sessionUtils = sessionUtils;
|
||||
|
|
|
@ -472,7 +472,7 @@ public class RdapJsonFormatterTest {
|
|||
rdapJsonFormatter.makeRdapJsonForContact(
|
||||
contactResourceTech,
|
||||
false,
|
||||
Optional.<DesignatedContact.Type>empty(),
|
||||
Optional.empty(),
|
||||
LINK_BASE,
|
||||
WHOIS_SERVER,
|
||||
clock.nowUtc(),
|
||||
|
@ -487,7 +487,7 @@ public class RdapJsonFormatterTest {
|
|||
rdapJsonFormatter.makeRdapJsonForContact(
|
||||
contactResourceNotLinked,
|
||||
false,
|
||||
Optional.<DesignatedContact.Type>empty(),
|
||||
Optional.empty(),
|
||||
LINK_BASE,
|
||||
WHOIS_SERVER,
|
||||
clock.nowUtc(),
|
||||
|
@ -626,8 +626,8 @@ public class RdapJsonFormatterTest {
|
|||
rdapJsonFormatter.addTopLevelEntries(
|
||||
builder,
|
||||
RdapJsonFormatter.BoilerplateType.OTHER,
|
||||
ImmutableList.<ImmutableMap<String, Object>>of(),
|
||||
ImmutableList.<ImmutableMap<String, Object>>of(),
|
||||
ImmutableList.of(),
|
||||
ImmutableList.of(),
|
||||
LINK_BASE);
|
||||
assertThat(builder.build()).isEqualTo(loadJson("rdapjson_toplevel.json"));
|
||||
}
|
||||
|
@ -640,7 +640,7 @@ public class RdapJsonFormatterTest {
|
|||
builder,
|
||||
RdapJsonFormatter.BoilerplateType.OTHER,
|
||||
ImmutableList.of(rdapJsonFormatter.getJsonHelpNotice("/tos", LINK_BASE)),
|
||||
ImmutableList.<ImmutableMap<String, Object>>of(),
|
||||
ImmutableList.of(),
|
||||
LINK_BASE);
|
||||
assertThat(builder.build()).isEqualTo(loadJson("rdapjson_toplevel.json"));
|
||||
}
|
||||
|
@ -652,8 +652,8 @@ public class RdapJsonFormatterTest {
|
|||
rdapJsonFormatter.addTopLevelEntries(
|
||||
builder,
|
||||
RdapJsonFormatter.BoilerplateType.DOMAIN,
|
||||
ImmutableList.<ImmutableMap<String, Object>>of(),
|
||||
ImmutableList.<ImmutableMap<String, Object>>of(),
|
||||
ImmutableList.of(),
|
||||
ImmutableList.of(),
|
||||
LINK_BASE);
|
||||
assertThat(builder.build()).isEqualTo(loadJson("rdapjson_toplevel_domain.json"));
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ public class RdapJsonFormatterTest {
|
|||
builder,
|
||||
RdapJsonFormatter.BoilerplateType.DOMAIN,
|
||||
ImmutableList.of(rdapJsonFormatter.getJsonHelpNotice("/tos", LINK_BASE)),
|
||||
ImmutableList.<ImmutableMap<String, Object>>of(),
|
||||
ImmutableList.of(),
|
||||
LINK_BASE);
|
||||
assertThat(builder.build()).isEqualTo(loadJson("rdapjson_toplevel_domain.json"));
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ public class RdapNameserverActionTest {
|
|||
}
|
||||
|
||||
private Object generateActualJson(String name) {
|
||||
return generateActualJson(name, Optional.<String>empty(), Optional.<Boolean>empty());
|
||||
return generateActualJson(name, Optional.empty(), Optional.empty());
|
||||
}
|
||||
|
||||
private Object generateActualJson(
|
||||
|
@ -315,7 +315,7 @@ public class RdapNameserverActionTest {
|
|||
public void testNameserver_found_sameRegistrarRequested() throws Exception {
|
||||
assertThat(
|
||||
generateActualJson(
|
||||
"ns1.cat.lol", Optional.of("TheRegistrar"), Optional.<Boolean>empty()))
|
||||
"ns1.cat.lol", Optional.of("TheRegistrar"), Optional.empty()))
|
||||
.isEqualTo(
|
||||
generateExpectedJsonWithTopLevelEntries(
|
||||
"ns1.cat.lol",
|
||||
|
@ -342,14 +342,14 @@ public class RdapNameserverActionTest {
|
|||
|
||||
@Test
|
||||
public void testDeletedNameserver_notFound_includeDeletedSetFalse() throws Exception {
|
||||
generateActualJson("nsdeleted.cat.lol", Optional.<String>empty(), Optional.of(false));
|
||||
generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(false));
|
||||
assertThat(response.getStatus()).isEqualTo(404);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeletedNameserver_notFound_notLoggedIn() throws Exception {
|
||||
when(sessionUtils.checkRegistrarConsoleLogin(request, userAuthInfo)).thenReturn(false);
|
||||
generateActualJson("nsdeleted.cat.lol", Optional.<String>empty(), Optional.of(true));
|
||||
generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(true));
|
||||
assertThat(response.getStatus()).isEqualTo(404);
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ public class RdapNameserverActionTest {
|
|||
public void testDeletedNameserver_notFound_loggedInAsDifferentRegistrar() throws Exception {
|
||||
when(sessionUtils.checkRegistrarConsoleLogin(request, userAuthInfo)).thenReturn(true);
|
||||
when(sessionUtils.getRegistrarClientId(request)).thenReturn("otherregistrar");
|
||||
generateActualJson("nsdeleted.cat.lol", Optional.<String>empty(), Optional.of(true));
|
||||
generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(true));
|
||||
assertThat(response.getStatus()).isEqualTo(404);
|
||||
}
|
||||
|
||||
|
@ -366,7 +366,7 @@ public class RdapNameserverActionTest {
|
|||
when(sessionUtils.checkRegistrarConsoleLogin(request, userAuthInfo)).thenReturn(true);
|
||||
when(sessionUtils.getRegistrarClientId(request)).thenReturn("TheRegistrar");
|
||||
assertThat(
|
||||
generateActualJson("nsdeleted.cat.lol", Optional.<String>empty(), Optional.of(true)))
|
||||
generateActualJson("nsdeleted.cat.lol", Optional.empty(), Optional.of(true)))
|
||||
.isEqualTo(
|
||||
generateExpectedJsonWithTopLevelEntries(
|
||||
"nsdeleted.cat.lol",
|
||||
|
@ -385,7 +385,7 @@ public class RdapNameserverActionTest {
|
|||
when(sessionUtils.getRegistrarClientId(request)).thenReturn("irrelevant");
|
||||
newRdapNameserverAction(
|
||||
"nsdeleted.cat.lol",
|
||||
Optional.<String>empty(),
|
||||
Optional.empty(),
|
||||
Optional.of(true),
|
||||
AuthResult.create(AuthLevel.USER, adminUserAuthInfo))
|
||||
.run();
|
||||
|
|
|
@ -56,7 +56,7 @@ public class RdapTestHelper {
|
|||
switch (contactNoticeType) {
|
||||
case DOMAIN:
|
||||
noticesBuilder.add(
|
||||
ImmutableMap.<String, Object>of(
|
||||
ImmutableMap.of(
|
||||
"title", "Contacts Hidden",
|
||||
"description",
|
||||
ImmutableList.of("Domain contacts are visible only to the owning registrar."),
|
||||
|
@ -64,7 +64,7 @@ public class RdapTestHelper {
|
|||
break;
|
||||
case CONTACT:
|
||||
noticesBuilder.add(
|
||||
ImmutableMap.<String, Object>of(
|
||||
ImmutableMap.of(
|
||||
"title", "Contact Personal Data Hidden",
|
||||
"description",
|
||||
ImmutableList.of(
|
||||
|
@ -75,7 +75,7 @@ public class RdapTestHelper {
|
|||
break;
|
||||
}
|
||||
noticesBuilder.add(
|
||||
ImmutableMap.<String, Object>of(
|
||||
ImmutableMap.of(
|
||||
"title", "RDAP Terms of Service",
|
||||
"description",
|
||||
ImmutableList.of(
|
||||
|
@ -119,7 +119,7 @@ public class RdapTestHelper {
|
|||
ImmutableList.Builder<ImmutableMap<String, Object>> remarksBuilder =
|
||||
getBuilderWithOthersAdded(otherRemarks);
|
||||
remarksBuilder.add(
|
||||
ImmutableMap.<String, Object>of(
|
||||
ImmutableMap.of(
|
||||
"description",
|
||||
ImmutableList.of(
|
||||
"This response conforms to the RDAP Operational Profile for gTLD Registries and"
|
||||
|
@ -139,20 +139,20 @@ public class RdapTestHelper {
|
|||
getBuilderWithOthersAdded(otherRemarks);
|
||||
if (addNoContactRemark) {
|
||||
remarksBuilder.add(
|
||||
ImmutableMap.<String, Object>of(
|
||||
ImmutableMap.of(
|
||||
"title", "Contacts Hidden",
|
||||
"description",
|
||||
ImmutableList.of("Domain contacts are visible only to the owning registrar."),
|
||||
"type", "object truncated due to unexplainable reasons"));
|
||||
}
|
||||
remarksBuilder.add(
|
||||
ImmutableMap.<String, Object>of(
|
||||
ImmutableMap.of(
|
||||
"description",
|
||||
ImmutableList.of(
|
||||
"This response conforms to the RDAP Operational Profile for gTLD Registries and"
|
||||
+ " Registrars version 1.0")));
|
||||
remarksBuilder.add(
|
||||
ImmutableMap.<String, Object>of(
|
||||
ImmutableMap.of(
|
||||
"title",
|
||||
"EPP Status Codes",
|
||||
"description",
|
||||
|
@ -167,7 +167,7 @@ public class RdapTestHelper {
|
|||
"href", "https://icann.org/epp",
|
||||
"type", "text/html"))));
|
||||
remarksBuilder.add(
|
||||
ImmutableMap.<String, Object>of(
|
||||
ImmutableMap.of(
|
||||
"description",
|
||||
ImmutableList.of(
|
||||
"URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf"),
|
||||
|
|
|
@ -53,7 +53,6 @@ import google.registry.model.poll.PollMessage.Autorenew;
|
|||
import google.registry.model.rde.RdeMode;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.transfer.TransferData;
|
||||
import google.registry.model.transfer.TransferData.TransferServerApproveEntity;
|
||||
import google.registry.model.transfer.TransferStatus;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
|
@ -331,7 +330,7 @@ public class DomainResourceToXjcConverterTest {
|
|||
.setMsg("Domain was auto-renewed.")
|
||||
.setParent(historyEntry)
|
||||
.build())))
|
||||
.setServerApproveEntities(ImmutableSet.<Key<? extends TransferServerApproveEntity>>of(
|
||||
.setServerApproveEntities(ImmutableSet.of(
|
||||
Key.create(billingEvent)))
|
||||
.setTransferRequestTime(DateTime.parse("1919-01-01T00:00:00Z"))
|
||||
.setTransferStatus(TransferStatus.PENDING)
|
||||
|
|
|
@ -48,7 +48,6 @@ import google.registry.model.poll.PollMessage;
|
|||
import google.registry.model.poll.PollMessage.Autorenew;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.transfer.TransferData;
|
||||
import google.registry.model.transfer.TransferData.TransferServerApproveEntity;
|
||||
import google.registry.model.transfer.TransferStatus;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.util.Idn;
|
||||
|
@ -173,7 +172,7 @@ final class RdeFixtures {
|
|||
.setMsg("Domain was auto-renewed.")
|
||||
.setParent(historyEntry)
|
||||
.build())))
|
||||
.setServerApproveEntities(ImmutableSet.<Key<? extends TransferServerApproveEntity>>of(
|
||||
.setServerApproveEntities(ImmutableSet.of(
|
||||
Key.create(billingEvent)))
|
||||
.setTransferRequestTime(DateTime.parse("1919-01-01T00:00:00Z"))
|
||||
.setTransferStatus(TransferStatus.PENDING)
|
||||
|
|
|
@ -151,11 +151,11 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
action.pendingDepositChecker.rdeInterval = Duration.standardDays(1);
|
||||
action.response = response;
|
||||
action.transactionCooldown = Duration.ZERO;
|
||||
action.directory = Optional.<String>empty();
|
||||
action.modeStrings = ImmutableSet.<String>of();
|
||||
action.tlds = ImmutableSet.<String>of();
|
||||
action.watermarks = ImmutableSet.<DateTime>of();
|
||||
action.revision = Optional.<Integer>empty();
|
||||
action.directory = Optional.empty();
|
||||
action.modeStrings = ImmutableSet.of();
|
||||
action.tlds = ImmutableSet.of();
|
||||
action.watermarks = ImmutableSet.of();
|
||||
action.revision = Optional.empty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -246,7 +246,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
clock.setTo(DateTime.parse("2000-01-01TZ"));
|
||||
action.manual = true;
|
||||
action.directory = Optional.of("test/");
|
||||
action.modeStrings = ImmutableSet.<String>of();
|
||||
action.modeStrings = ImmutableSet.of();
|
||||
action.tlds = ImmutableSet.of("lol");
|
||||
action.watermarks = ImmutableSet.of(clock.nowUtc());
|
||||
thrown.expect(BadRequestException.class);
|
||||
|
@ -273,7 +273,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
action.manual = true;
|
||||
action.directory = Optional.of("test/");
|
||||
action.modeStrings = ImmutableSet.of("full");
|
||||
action.tlds = ImmutableSet.<String>of();
|
||||
action.tlds = ImmutableSet.of();
|
||||
action.watermarks = ImmutableSet.of(clock.nowUtc());
|
||||
thrown.expect(BadRequestException.class);
|
||||
action.run();
|
||||
|
|
|
@ -74,7 +74,7 @@ public class RdeContactImportActionTest extends MapreduceTestCase<RdeContactImpo
|
|||
response,
|
||||
IMPORT_BUCKET_NAME,
|
||||
IMPORT_FILE_NAME,
|
||||
Optional.<Integer>of(3));
|
||||
Optional.of(3));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -66,14 +66,14 @@ public class RdeContactInputTest {
|
|||
@Test
|
||||
public void testZeroContactsDefaultShards_returnsOneReader() throws Exception {
|
||||
pushToGcs(DEPOSIT_0_CONTACT);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 1);
|
||||
assertNumberOfReaders(Optional.empty(), 1);
|
||||
}
|
||||
|
||||
/** Escrow file with zero contacts results in expected reader configuration */
|
||||
@Test
|
||||
public void testZeroContactsDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_0_CONTACT);
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), 0, 0, 100);
|
||||
assertReaderConfigurations(Optional.empty(), 0, 0, 100);
|
||||
}
|
||||
|
||||
/** Escrow file with zero contacts and 75 shards results in one reader */
|
||||
|
@ -87,14 +87,14 @@ public class RdeContactInputTest {
|
|||
@Test
|
||||
public void testOneContactDefaultShards_returnsOneReader() throws Exception {
|
||||
pushToGcs(DEPOSIT_1_CONTACT);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 1);
|
||||
assertNumberOfReaders(Optional.empty(), 1);
|
||||
}
|
||||
|
||||
/** Escrow file with one contact results in expected reader configuration */
|
||||
@Test
|
||||
public void testOneContactDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_1_CONTACT);
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), 0, 0, 100);
|
||||
assertReaderConfigurations(Optional.empty(), 0, 0, 100);
|
||||
}
|
||||
|
||||
/** Escrow file with one contact and 75 shards results in one reader */
|
||||
|
@ -108,14 +108,14 @@ public class RdeContactInputTest {
|
|||
@Test
|
||||
public void test199ContactsDefaultShards_returnsOneReader() throws Exception {
|
||||
pushToGcs(DEPOSIT_199_CONTACT);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 1);
|
||||
assertNumberOfReaders(Optional.empty(), 1);
|
||||
}
|
||||
|
||||
/** Escrow file with 199 contacts results in expected reader configuration */
|
||||
@Test
|
||||
public void test199ContactsDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_199_CONTACT);
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), 0, 0, 199);
|
||||
assertReaderConfigurations(Optional.empty(), 0, 0, 199);
|
||||
}
|
||||
|
||||
/** Escrow file with 199 contacts and 75 shards results in one reader */
|
||||
|
@ -129,15 +129,15 @@ public class RdeContactInputTest {
|
|||
@Test
|
||||
public void test200ContactsDefaultShards_returnsTwoReaders() throws Exception {
|
||||
pushToGcs(DEPOSIT_200_CONTACT);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 2);
|
||||
assertNumberOfReaders(Optional.empty(), 2);
|
||||
}
|
||||
|
||||
/** Escrow file with 200 contacts results in expected reader configurations */
|
||||
@Test
|
||||
public void test200ContactsDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_200_CONTACT);
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), 0, 0, 100);
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), 1, 100, 100);
|
||||
assertReaderConfigurations(Optional.empty(), 0, 0, 100);
|
||||
assertReaderConfigurations(Optional.empty(), 1, 100, 100);
|
||||
}
|
||||
|
||||
/** Escrow file with 200 contacts and 75 shards results in two readers */
|
||||
|
@ -151,7 +151,7 @@ public class RdeContactInputTest {
|
|||
@Test
|
||||
public void test1000ContactsDefaultShards_returns10Readers() throws Exception {
|
||||
pushToGcs(DEPOSIT_1000_CONTACT);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 10);
|
||||
assertNumberOfReaders(Optional.empty(), 10);
|
||||
}
|
||||
|
||||
/** Escrow file with 1000 contacts results in expected reader configurations */
|
||||
|
@ -159,7 +159,7 @@ public class RdeContactInputTest {
|
|||
public void test1000ContactsDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_1000_CONTACT);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), i, i * 100, 100);
|
||||
assertReaderConfigurations(Optional.empty(), i, i * 100, 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ public class RdeContactInputTest {
|
|||
@Test
|
||||
public void test10000ContactsDefaultShards_returns50Readers() throws Exception {
|
||||
pushToGcs(DEPOSIT_10000_CONTACT);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 50);
|
||||
assertNumberOfReaders(Optional.empty(), 50);
|
||||
}
|
||||
|
||||
/** Escrow file with 10000 contacts results in expected reader configurations */
|
||||
|
@ -182,7 +182,7 @@ public class RdeContactInputTest {
|
|||
public void test10000ContactsDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_10000_CONTACT);
|
||||
for (int i = 0; i < 50; i++) {
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), i, i * 200, 200);
|
||||
assertReaderConfigurations(Optional.empty(), i, i * 200, 200);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
response,
|
||||
IMPORT_BUCKET_NAME,
|
||||
IMPORT_FILE_NAME,
|
||||
Optional.<Integer>of(3));
|
||||
Optional.of(3));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -68,7 +68,7 @@ public class RdeHostImportActionTest extends MapreduceTestCase<RdeHostImportActi
|
|||
@Before
|
||||
public void before() throws Exception {
|
||||
response = new FakeResponse();
|
||||
mrRunner = new MapreduceRunner(Optional.<Integer>empty(), Optional.<Integer>empty());
|
||||
mrRunner = new MapreduceRunner(Optional.empty(), Optional.empty());
|
||||
action = new RdeHostImportAction(
|
||||
mrRunner,
|
||||
response,
|
||||
|
|
|
@ -83,14 +83,14 @@ public class RdeHostInputTest {
|
|||
@Test
|
||||
public void testZeroHostsDefaultShards_returnsOneReader() throws Exception {
|
||||
pushToGcs(DEPOSIT_0_HOST);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 1);
|
||||
assertNumberOfReaders(Optional.empty(), 1);
|
||||
}
|
||||
|
||||
/** Escrow file with zero hosts results in expected reader configuration */
|
||||
@Test
|
||||
public void testZeroHostsDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_0_HOST);
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), 0, 0, 100);
|
||||
assertReaderConfigurations(Optional.empty(), 0, 0, 100);
|
||||
}
|
||||
|
||||
/** Escrow file with zero hosts and 75 shards results in one reader */
|
||||
|
@ -104,14 +104,14 @@ public class RdeHostInputTest {
|
|||
@Test
|
||||
public void testOneHostDefaultShards_returnsOneReader() throws Exception {
|
||||
pushToGcs(DEPOSIT_1_HOST);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 1);
|
||||
assertNumberOfReaders(Optional.empty(), 1);
|
||||
}
|
||||
|
||||
/** Escrow file with one host results in expected reader configuration */
|
||||
@Test
|
||||
public void testOneHostDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_1_HOST);
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), 0, 0, 100);
|
||||
assertReaderConfigurations(Optional.empty(), 0, 0, 100);
|
||||
}
|
||||
|
||||
/** Escrow file with one host and 75 shards results in one reader */
|
||||
|
@ -125,14 +125,14 @@ public class RdeHostInputTest {
|
|||
@Test
|
||||
public void test199HostsDefaultShards_returnsOneReader() throws Exception {
|
||||
pushToGcs(DEPOSIT_199_HOST);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 1);
|
||||
assertNumberOfReaders(Optional.empty(), 1);
|
||||
}
|
||||
|
||||
/** Escrow file with 199 hosts results in expected reader configuration */
|
||||
@Test
|
||||
public void test199HostsDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_199_HOST);
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), 0, 0, 199);
|
||||
assertReaderConfigurations(Optional.empty(), 0, 0, 199);
|
||||
}
|
||||
|
||||
/** Escrow file with 199 hosts and 75 shards results in one reader */
|
||||
|
@ -146,15 +146,15 @@ public class RdeHostInputTest {
|
|||
@Test
|
||||
public void test200HostsDefaultShards_returnsTwoReaders() throws Exception {
|
||||
pushToGcs(DEPOSIT_200_HOST);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 2);
|
||||
assertNumberOfReaders(Optional.empty(), 2);
|
||||
}
|
||||
|
||||
/** Escrow file with 200 hosts results in expected reader configurations */
|
||||
@Test
|
||||
public void test200HostsDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_200_HOST);
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), 0, 0, 100);
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), 1, 100, 100);
|
||||
assertReaderConfigurations(Optional.empty(), 0, 0, 100);
|
||||
assertReaderConfigurations(Optional.empty(), 1, 100, 100);
|
||||
}
|
||||
|
||||
/** Escrow file with 200 hosts and 75 shards results in two readers */
|
||||
|
@ -168,7 +168,7 @@ public class RdeHostInputTest {
|
|||
@Test
|
||||
public void test1000HostsDefaultShards_returns10Readers() throws Exception {
|
||||
pushToGcs(DEPOSIT_1000_HOST);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 10);
|
||||
assertNumberOfReaders(Optional.empty(), 10);
|
||||
}
|
||||
|
||||
/** Escrow file with 1000 hosts results in expected reader configurations */
|
||||
|
@ -176,7 +176,7 @@ public class RdeHostInputTest {
|
|||
public void test1000HostsDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_1000_HOST);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), i, i * 100, 100);
|
||||
assertReaderConfigurations(Optional.empty(), i, i * 100, 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ public class RdeHostInputTest {
|
|||
@Test
|
||||
public void test10000HostsDefaultShards_returns50Readers() throws Exception {
|
||||
pushToGcs(DEPOSIT_10000_HOST);
|
||||
assertNumberOfReaders(Optional.<Integer>empty(), 50);
|
||||
assertNumberOfReaders(Optional.empty(), 50);
|
||||
}
|
||||
|
||||
/** Escrow file with 10000 hosts results in expected reader configurations */
|
||||
|
@ -199,7 +199,7 @@ public class RdeHostInputTest {
|
|||
public void test10000HostsDefaultShardsReaderConfigurations() throws Exception {
|
||||
pushToGcs(DEPOSIT_10000_HOST);
|
||||
for (int i = 0; i < 50; i++) {
|
||||
assertReaderConfigurations(Optional.<Integer>empty(), i, i * 200, 200);
|
||||
assertReaderConfigurations(Optional.empty(), i, i * 200, 200);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public class RdeHostLinkActionTest extends MapreduceTestCase<RdeHostLinkAction>
|
|||
inject.setStaticField(Ofy.class, "clock", clock);
|
||||
createTld("test");
|
||||
response = new FakeResponse();
|
||||
mrRunner = new MapreduceRunner(Optional.<Integer>empty(), Optional.<Integer>empty());
|
||||
mrRunner = new MapreduceRunner(Optional.empty(), Optional.empty());
|
||||
action =
|
||||
new RdeHostLinkAction(mrRunner, response, IMPORT_BUCKET_NAME, IMPORT_FILE_NAME, mapShards);
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public class LordnLogTest {
|
|||
@Test
|
||||
public void testFailure_parseEmpty() throws Exception {
|
||||
thrown.expect(Exception.class);
|
||||
LordnLog.parse(ImmutableList.<String>of());
|
||||
LordnLog.parse(ImmutableList.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -91,7 +91,7 @@ public class LordnTaskTest {
|
|||
@Test
|
||||
public void test_convertTasksToCsv_doesntFailOnEmptyTasks() throws Exception {
|
||||
assertThat(
|
||||
LordnTask.convertTasksToCsv(ImmutableList.<TaskHandle> of(), clock.nowUtc(), "col1,col2"))
|
||||
LordnTask.convertTasksToCsv(ImmutableList.of(), clock.nowUtc(), "col1,col2"))
|
||||
.isEqualTo("1,2010-05-01T10:11:12.000Z,0\ncol1,col2\n");
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ public class LordnTaskTest {
|
|||
when(queue.leaseTasks(any(LeaseOptions.class)))
|
||||
.thenThrow(TransientFailureException.class)
|
||||
.thenThrow(DeadlineExceededException.class)
|
||||
.thenReturn(ImmutableList.<TaskHandle>of(task), ImmutableList.<TaskHandle>of());
|
||||
.thenReturn(ImmutableList.of(task), ImmutableList.of());
|
||||
assertThat(LordnTask.loadAllTasks(queue, "tld")).containsExactly(task);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ import com.google.common.collect.Lists;
|
|||
import com.google.common.testing.NullPointerTester;
|
||||
import com.google.re2j.Pattern;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
@ -241,7 +240,7 @@ public class FormFieldTest {
|
|||
|
||||
@Test
|
||||
public void testAsList_empty_returnsEmpty() {
|
||||
assertThat(FormField.named("lol").asList().build().convert(ImmutableList.<String>of()).get())
|
||||
assertThat(FormField.named("lol").asList().build().convert(ImmutableList.of()).get())
|
||||
.isEmpty();
|
||||
}
|
||||
|
||||
|
@ -253,7 +252,7 @@ public class FormFieldTest {
|
|||
.emptyToNull()
|
||||
.required()
|
||||
.build()
|
||||
.convert(ImmutableList.<String>of());
|
||||
.convert(ImmutableList.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -262,7 +261,7 @@ public class FormFieldTest {
|
|||
.asList()
|
||||
.emptyToNull()
|
||||
.build()
|
||||
.convert(ImmutableList.<String>of()))
|
||||
.convert(ImmutableList.of()))
|
||||
.isEmpty();
|
||||
}
|
||||
|
||||
|
@ -377,7 +376,7 @@ public class FormFieldTest {
|
|||
FormField.named("cat").emptyToNull().required().build().extractUntyped(input).get())
|
||||
.asList()
|
||||
.build()
|
||||
.convert(ImmutableList.<Map<String, ?>>of(ImmutableMap.of("cat", "")));
|
||||
.convert(ImmutableList.of(ImmutableMap.of("cat", "")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -94,7 +94,7 @@ public class ContactSettingsTest extends RegistrarSettingsActionTestCase {
|
|||
reqJson.put("contacts",
|
||||
ImmutableList.of(AppEngineRule.makeRegistrarContact2()
|
||||
.asBuilder()
|
||||
.setTypes(ImmutableList.<RegistrarContact.Type>of())
|
||||
.setTypes(ImmutableList.of())
|
||||
.build().toJsonMap()));
|
||||
Map<String, Object> response = action.handleJsonRequest(ImmutableMap.of(
|
||||
"op", "update",
|
||||
|
|
|
@ -82,7 +82,7 @@ public class RegistrarPaymentSetupActionTest {
|
|||
CurrencyUnit.JPY, "torment");
|
||||
String blanketsOfSadness = "our hearts are beating, but no one is breathing";
|
||||
when(clientTokenGateway.generate()).thenReturn(blanketsOfSadness);
|
||||
assertThat(action.handleJsonRequest(ImmutableMap.<String, Object>of()))
|
||||
assertThat(action.handleJsonRequest(ImmutableMap.of()))
|
||||
.containsExactly(
|
||||
"status", "SUCCESS",
|
||||
"message", "Success",
|
||||
|
@ -113,7 +113,7 @@ public class RegistrarPaymentSetupActionTest {
|
|||
when(sessionUtils.getRegistrarForAuthResult(
|
||||
any(HttpServletRequest.class), any(AuthResult.class)))
|
||||
.thenReturn(registrar);
|
||||
assertThat(action.handleJsonRequest(ImmutableMap.<String, Object>of()))
|
||||
assertThat(action.handleJsonRequest(ImmutableMap.of()))
|
||||
.containsExactly(
|
||||
"status", "ERROR",
|
||||
"message", "not-using-cc-billing",
|
||||
|
|
|
@ -74,7 +74,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase
|
|||
any(HttpServletRequest.class), any(AuthResult.class)))
|
||||
.thenThrow(new ForbiddenException("Not authorized to access Registrar Console"));
|
||||
try {
|
||||
action.handleJsonRequest(ImmutableMap.<String, Object>of());
|
||||
action.handleJsonRequest(ImmutableMap.of());
|
||||
fail("expected ForbiddenException");
|
||||
} catch (ForbiddenException ex) {
|
||||
assertNoTasksEnqueued("sheet");
|
||||
|
@ -86,7 +86,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase
|
|||
*/
|
||||
@Test
|
||||
public void testRead_authorized_returnsRegistrarJson() throws Exception {
|
||||
Map<String, Object> response = action.handleJsonRequest(ImmutableMap.<String, Object>of());
|
||||
Map<String, Object> response = action.handleJsonRequest(ImmutableMap.of());
|
||||
assertThat(response).containsEntry("status", "SUCCESS");
|
||||
assertThat(response).containsEntry("results", asList(loadRegistrar(CLIENT_ID).toJsonMap()));
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ public class RegistrarSettingsActionTestCase {
|
|||
action.sessionUtils = sessionUtils;
|
||||
action.authResult = AuthResult.create(AuthLevel.USER, UserAuthInfo.create(user, false));
|
||||
action.jsonActionRunner = new JsonActionRunner(
|
||||
ImmutableMap.<String, Object>of(), new JsonResponse(new ResponseImpl(rsp)));
|
||||
ImmutableMap.of(), new JsonResponse(new ResponseImpl(rsp)));
|
||||
action.registrarChangesNotificationEmailAddresses = ImmutableList.of(
|
||||
"notification@test.example", "notification2@test.example");
|
||||
action.sendEmailUtils =
|
||||
|
|
|
@ -77,12 +77,12 @@ public class DateTimeUtilsTest {
|
|||
@Test
|
||||
public void testFailure_earliestOfEmpty() {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
earliestOf(ImmutableList.<DateTime>of());
|
||||
earliestOf(ImmutableList.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_latestOfEmpty() {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
earliestOf(ImmutableList.<DateTime>of());
|
||||
earliestOf(ImmutableList.of());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public final class RequestStatusCheckerImplTest {
|
|||
// it's a request that has just started running recently.
|
||||
@Test public void testIsRunning_unrecognized() {
|
||||
when(RequestStatusCheckerImpl.logService.fetch(expectedLogQuery("12345678")))
|
||||
.thenReturn(ImmutableList.<RequestLogs>of());
|
||||
.thenReturn(ImmutableList.of());
|
||||
assertThat(requestStatusChecker.isRunning("12345678")).isTrue();
|
||||
assertAboutLogs()
|
||||
.that(logHandler)
|
||||
|
|
|
@ -61,7 +61,7 @@ public class TeeOutputStreamTest {
|
|||
@SuppressWarnings("resource")
|
||||
public void testConstructor_failsWithEmptyIterable() {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
new TeeOutputStream(ImmutableSet.<OutputStream>of());
|
||||
new TeeOutputStream(ImmutableSet.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -34,20 +34,20 @@ public class TypeUtilsTest {
|
|||
@Test
|
||||
public void test_getClassFromString_validClass() {
|
||||
Class<? extends Serializable> clazz =
|
||||
TypeUtils.<Serializable>getClassFromString("java.util.ArrayList", Serializable.class);
|
||||
TypeUtils.getClassFromString("java.util.ArrayList", Serializable.class);
|
||||
assertThat(clazz).isEqualTo(ArrayList.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getClassFromString_notAssignableFrom() {
|
||||
thrown.expect(IllegalArgumentException.class, "ArrayList does not implement/extend Integer");
|
||||
TypeUtils.<Integer>getClassFromString("java.util.ArrayList", Integer.class);
|
||||
TypeUtils.getClassFromString("java.util.ArrayList", Integer.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getClassFromString_unknownClass() {
|
||||
thrown.expect(
|
||||
IllegalArgumentException.class, "Failed to load class com.fake.company.nonexistent.Class");
|
||||
TypeUtils.<Object>getClassFromString("com.fake.company.nonexistent.Class", Object.class);
|
||||
TypeUtils.getClassFromString("com.fake.company.nonexistent.Class", Object.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -261,7 +261,7 @@ public class XmlTestUtils {
|
|||
XML.toJSONObject(xml),
|
||||
null,
|
||||
ImmutableSet.copyOf(ignoredPaths),
|
||||
ImmutableMap.<String, String>of()).getValue();
|
||||
ImmutableMap.of()).getValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue