mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 20:17:51 +02:00
Remove more unnecessary "throws" declarations
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201243722
This commit is contained in:
parent
47322b7fcd
commit
ad73f3d167
61 changed files with 318 additions and 331 deletions
|
@ -127,7 +127,7 @@ public final class KmsUpdater {
|
|||
* <p>The operations in this method are organized so that existing {@link KmsSecretRevision}
|
||||
* entities remain primary and decryptable if a failure occurs.
|
||||
*/
|
||||
public void update() throws IOException {
|
||||
public void update() {
|
||||
checkState(!secretValues.isEmpty(), "At least one Keyring value must be persisted");
|
||||
|
||||
persistEncryptedValues(encryptValues(secretValues));
|
||||
|
@ -139,8 +139,7 @@ public final class KmsUpdater {
|
|||
*
|
||||
* @see google.registry.config.RegistryConfigSettings#kms
|
||||
*/
|
||||
private ImmutableMap<String, EncryptResponse> encryptValues(Map<String, byte[]> keyValues)
|
||||
throws IOException {
|
||||
private ImmutableMap<String, EncryptResponse> encryptValues(Map<String, byte[]> keyValues) {
|
||||
ImmutableMap.Builder<String, EncryptResponse> encryptedValues = new ImmutableMap.Builder<>();
|
||||
for (Map.Entry<String, byte[]> entry : keyValues.entrySet()) {
|
||||
String secretName = entry.getKey();
|
||||
|
|
|
@ -272,7 +272,7 @@ abstract class CreateOrUpdateTldCommand extends MutatingCommand {
|
|||
protected abstract void initTldCommand();
|
||||
|
||||
@Override
|
||||
protected final void init() throws Exception {
|
||||
protected final void init() {
|
||||
assertAllowedEnvironment();
|
||||
initTldCommand();
|
||||
String duplicates = Joiner.on(", ").join(findDuplicates(mainParameters));
|
||||
|
|
|
@ -66,8 +66,7 @@ final class LoadSnapshotCommand extends BigqueryCommand {
|
|||
* Starts load jobs for the given snapshot kinds, and returns a map of kind name to
|
||||
* ListenableFuture representing the result of the load job for that kind.
|
||||
*/
|
||||
private Map<String, ListenableFuture<?>> loadSnapshotKinds(List<String> kindNames)
|
||||
throws Exception {
|
||||
private Map<String, ListenableFuture<?>> loadSnapshotKinds(List<String> kindNames) {
|
||||
ImmutableMap.Builder<String, ListenableFuture<?>> builder = new ImmutableMap.Builder<>();
|
||||
for (String kind : kindNames) {
|
||||
String filename = String.format(
|
||||
|
@ -79,7 +78,7 @@ final class LoadSnapshotCommand extends BigqueryCommand {
|
|||
}
|
||||
|
||||
/** Starts a load job for the specified kind name, sourcing data from the given GCS file. */
|
||||
private ListenableFuture<?> loadSnapshotFile(String filename, String kindName) throws Exception {
|
||||
private ListenableFuture<?> loadSnapshotFile(String filename, String kindName) {
|
||||
return bigquery().load(
|
||||
bigquery().buildDestinationTable(kindName)
|
||||
.description("Datastore snapshot import for " + kindName + ".")
|
||||
|
|
|
@ -61,7 +61,7 @@ public final class TeeOutputStream extends OutputStream {
|
|||
|
||||
/** Closes the stream. Any calls to a {@code write()} method after this will throw. */
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
public void close() {
|
||||
isClosed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class CommitLogCheckpointActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRun_noCheckpointEverWritten_writesCheckpointAndEnqueuesTask() throws Exception {
|
||||
public void testRun_noCheckpointEverWritten_writesCheckpointAndEnqueuesTask() {
|
||||
task.run();
|
||||
assertTasksEnqueued(
|
||||
QUEUE_NAME,
|
||||
|
@ -80,8 +80,7 @@ public class CommitLogCheckpointActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRun_checkpointWrittenBeforeNow_writesCheckpointAndEnqueuesTask()
|
||||
throws Exception {
|
||||
public void testRun_checkpointWrittenBeforeNow_writesCheckpointAndEnqueuesTask() {
|
||||
DateTime oneMinuteAgo = now.minusMinutes(1);
|
||||
persistResource(CommitLogCheckpointRoot.create(oneMinuteAgo));
|
||||
task.run();
|
||||
|
@ -95,7 +94,7 @@ public class CommitLogCheckpointActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRun_checkpointWrittenAfterNow_doesntOverwrite_orEnqueueTask() throws Exception {
|
||||
public void testRun_checkpointWrittenAfterNow_doesntOverwrite_orEnqueueTask() {
|
||||
DateTime oneMinuteFromNow = now.plusMinutes(1);
|
||||
persistResource(CommitLogCheckpointRoot.create(oneMinuteFromNow));
|
||||
task.run();
|
||||
|
|
|
@ -52,7 +52,7 @@ public class CommitLogFanoutActionTest {
|
|||
.build();
|
||||
|
||||
@Test
|
||||
public void testSuccess() throws Exception {
|
||||
public void testSuccess() {
|
||||
CommitLogFanoutAction action = new CommitLogFanoutAction();
|
||||
action.taskQueueUtils = new TaskQueueUtils(new Retrier(null, 1));
|
||||
action.endpoint = ENDPOINT;
|
||||
|
|
|
@ -99,7 +99,7 @@ public class TldFanoutActionTest {
|
|||
persistResource(Registry.get("example").asBuilder().setTldType(TldType.TEST).build());
|
||||
}
|
||||
|
||||
private static void assertTasks(String... tasks) throws Exception {
|
||||
private static void assertTasks(String... tasks) {
|
||||
assertTasksEnqueued(
|
||||
QUEUE,
|
||||
Stream.of(tasks).map(
|
||||
|
@ -111,7 +111,7 @@ public class TldFanoutActionTest {
|
|||
.collect(toImmutableList()));
|
||||
}
|
||||
|
||||
private static void assertTaskWithoutTld() throws Exception {
|
||||
private static void assertTaskWithoutTld() {
|
||||
assertTasksEnqueued(
|
||||
QUEUE,
|
||||
new TaskMatcher()
|
||||
|
@ -120,7 +120,7 @@ public class TldFanoutActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_methodPostIsDefault() throws Exception {
|
||||
public void testSuccess_methodPostIsDefault() {
|
||||
run(getParamsMap("runInEmpty", ""));
|
||||
assertTasksEnqueued(QUEUE, new TaskMatcher().method("POST"));
|
||||
}
|
||||
|
@ -131,25 +131,25 @@ public class TldFanoutActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_runInEmpty() throws Exception {
|
||||
public void testSuccess_runInEmpty() {
|
||||
run(getParamsMap("runInEmpty", ""));
|
||||
assertTaskWithoutTld();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_forEachRealTld() throws Exception {
|
||||
public void testSuccess_forEachRealTld() {
|
||||
run(getParamsMap("forEachRealTld", ""));
|
||||
assertTasks("com", "net", "org");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_forEachTestTld() throws Exception {
|
||||
public void testSuccess_forEachTestTld() {
|
||||
run(getParamsMap("forEachTestTld", ""));
|
||||
assertTasks("example");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_forEachTestTldAndForEachRealTld() throws Exception {
|
||||
public void testSuccess_forEachTestTldAndForEachRealTld() {
|
||||
run(getParamsMap(
|
||||
"forEachTestTld", "",
|
||||
"forEachRealTld", ""));
|
||||
|
@ -157,13 +157,13 @@ public class TldFanoutActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_runEverywhere() throws Exception {
|
||||
public void testSuccess_runEverywhere() {
|
||||
run(getParamsMap("forEachTestTld", "", "forEachRealTld", ""));
|
||||
assertTasks("com", "net", "org", "example");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_excludeRealTlds() throws Exception {
|
||||
public void testSuccess_excludeRealTlds() {
|
||||
run(getParamsMap(
|
||||
"forEachRealTld", "",
|
||||
"exclude", "com,net"));
|
||||
|
@ -171,7 +171,7 @@ public class TldFanoutActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_excludeTestTlds() throws Exception {
|
||||
public void testSuccess_excludeTestTlds() {
|
||||
run(getParamsMap(
|
||||
"forEachTestTld", "",
|
||||
"exclude", "example"));
|
||||
|
@ -179,7 +179,7 @@ public class TldFanoutActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_excludeNonexistentTlds() throws Exception {
|
||||
public void testSuccess_excludeNonexistentTlds() {
|
||||
run(getParamsMap(
|
||||
"forEachTestTld", "",
|
||||
"forEachRealTld", "",
|
||||
|
@ -221,14 +221,14 @@ public class TldFanoutActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_additionalArgsFlowThroughToPostParams() throws Exception {
|
||||
public void testSuccess_additionalArgsFlowThroughToPostParams() {
|
||||
run(getParamsMap("forEachTestTld", "", "newkey", "newval"));
|
||||
assertTasksEnqueued(QUEUE,
|
||||
new TaskMatcher().url("/the/servlet").param("newkey", "newval"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_returnHttpResponse() throws Exception {
|
||||
public void testSuccess_returnHttpResponse() {
|
||||
run(getParamsMap("forEachRealTld", "", "endpoint", "/the/servlet"));
|
||||
|
||||
List<TaskStateInfo> taskList =
|
||||
|
@ -247,7 +247,7 @@ public class TldFanoutActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_returnHttpResponse_runInEmpty() throws Exception {
|
||||
public void testSuccess_returnHttpResponse_runInEmpty() {
|
||||
run(getParamsMap("runInEmpty", "", "endpoint", "/the/servlet"));
|
||||
|
||||
List<TaskStateInfo> taskList =
|
||||
|
|
|
@ -73,7 +73,7 @@ public final class DnsInjectionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testReadDnsQueueAction_injectsAndWorks() throws Exception {
|
||||
public void testReadDnsQueueAction_injectsAndWorks() {
|
||||
persistActiveSubordinateHost("ns1.example.lol", persistActiveDomain("example.lol"));
|
||||
clock.advanceOneMilli();
|
||||
dnsQueue.addDomainRefreshTask("example.lol");
|
||||
|
@ -83,7 +83,7 @@ public final class DnsInjectionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRefreshDns_domain_injectsAndWorks() throws Exception {
|
||||
public void testRefreshDns_domain_injectsAndWorks() {
|
||||
persistActiveDomain("example.lol");
|
||||
when(req.getParameter("type")).thenReturn("domain");
|
||||
when(req.getParameter("name")).thenReturn("example.lol");
|
||||
|
@ -101,7 +101,7 @@ public final class DnsInjectionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRefreshDns_host_injectsAndWorks() throws Exception {
|
||||
public void testRefreshDns_host_injectsAndWorks() {
|
||||
persistActiveSubordinateHost("ns1.example.lol", persistActiveDomain("example.lol"));
|
||||
when(req.getParameter("type")).thenReturn("host");
|
||||
when(req.getParameter("name")).thenReturn("ns1.example.lol");
|
||||
|
|
|
@ -49,7 +49,7 @@ public class DnsQueueTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_addHostRefreshTask_success() throws Exception {
|
||||
public void test_addHostRefreshTask_success() {
|
||||
createTld("tld");
|
||||
dnsQueue.addHostRefreshTask("octopus.tld");
|
||||
assertTasksEnqueued(
|
||||
|
@ -79,7 +79,7 @@ public class DnsQueueTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_addDomainRefreshTask_success() throws Exception {
|
||||
public void test_addDomainRefreshTask_success() {
|
||||
createTld("tld");
|
||||
dnsQueue.addDomainRefreshTask("octopus.tld");
|
||||
assertTasksEnqueued(
|
||||
|
|
|
@ -106,7 +106,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testHost_published() throws Exception {
|
||||
public void testHost_published() {
|
||||
action = createAction("xn--q9jyb4c");
|
||||
action.hosts = ImmutableSet.of("ns1.example.xn--q9jyb4c");
|
||||
|
||||
|
@ -132,7 +132,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testDomain_published() throws Exception {
|
||||
public void testDomain_published() {
|
||||
action = createAction("xn--q9jyb4c");
|
||||
action.domains = ImmutableSet.of("example.xn--q9jyb4c");
|
||||
|
||||
|
@ -158,7 +158,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testAction_acquiresCorrectLock() throws Exception {
|
||||
public void testAction_acquiresCorrectLock() {
|
||||
persistResource(Registry.get("xn--q9jyb4c").asBuilder().setNumDnsPublishLocks(4).build());
|
||||
action = createAction("xn--q9jyb4c");
|
||||
action.lockIndex = 2;
|
||||
|
@ -176,7 +176,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testPublish_commitFails() throws Exception {
|
||||
public void testPublish_commitFails() {
|
||||
action = createAction("xn--q9jyb4c");
|
||||
action.domains = ImmutableSet.of("example.xn--q9jyb4c", "example2.xn--q9jyb4c");
|
||||
action.hosts =
|
||||
|
@ -203,7 +203,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testHostAndDomain_published() throws Exception {
|
||||
public void testHostAndDomain_published() {
|
||||
action = createAction("xn--q9jyb4c");
|
||||
action.domains = ImmutableSet.of("example.xn--q9jyb4c", "example2.xn--q9jyb4c");
|
||||
action.hosts = ImmutableSet.of(
|
||||
|
@ -235,7 +235,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testWrongTld_notPublished() throws Exception {
|
||||
public void testWrongTld_notPublished() {
|
||||
action = createAction("xn--q9jyb4c");
|
||||
action.domains = ImmutableSet.of("example.com", "example2.com");
|
||||
action.hosts = ImmutableSet.of("ns1.example.com", "ns2.example.com", "ns1.example2.com");
|
||||
|
@ -261,7 +261,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLockIsntAvailable() throws Exception {
|
||||
public void testLockIsntAvailable() {
|
||||
action = createAction("xn--q9jyb4c");
|
||||
action.domains = ImmutableSet.of("example.com", "example2.com");
|
||||
action.hosts = ImmutableSet.of("ns1.example.com", "ns2.example.com", "ns1.example2.com");
|
||||
|
@ -284,7 +284,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testParam_invalidLockIndex() throws Exception {
|
||||
public void testParam_invalidLockIndex() {
|
||||
persistResource(Registry.get("xn--q9jyb4c").asBuilder().setNumDnsPublishLocks(4).build());
|
||||
action = createAction("xn--q9jyb4c");
|
||||
action.domains = ImmutableSet.of("example.com");
|
||||
|
@ -309,7 +309,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRegistryParam_mismatchedMaxLocks() throws Exception {
|
||||
public void testRegistryParam_mismatchedMaxLocks() {
|
||||
persistResource(Registry.get("xn--q9jyb4c").asBuilder().setNumDnsPublishLocks(4).build());
|
||||
action = createAction("xn--q9jyb4c");
|
||||
action.domains = ImmutableSet.of("example.com");
|
||||
|
@ -334,7 +334,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testWrongDnsWriter() throws Exception {
|
||||
public void testWrongDnsWriter() {
|
||||
action = createAction("xn--q9jyb4c");
|
||||
action.domains = ImmutableSet.of("example.com", "example2.com");
|
||||
action.hosts = ImmutableSet.of("ns1.example.com", "ns2.example.com", "ns1.example2.com");
|
||||
|
|
|
@ -147,8 +147,7 @@ public class ReadDnsQueueActionTest {
|
|||
.param(DNS_TARGET_TYPE_PARAM, TargetType.DOMAIN.toString());
|
||||
}
|
||||
|
||||
private void assertTldsEnqueuedInPushQueue(ImmutableMultimap<String, String> tldsToDnsWriters)
|
||||
throws Exception {
|
||||
private void assertTldsEnqueuedInPushQueue(ImmutableMultimap<String, String> tldsToDnsWriters) {
|
||||
// By default, the publishDnsUpdates tasks will be enqueued one hour after the update items were
|
||||
// created in the pull queue. This is because of the clock.advanceBy in run()
|
||||
assertTasksEnqueued(
|
||||
|
@ -169,7 +168,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_methodPostIsDefault() throws Exception {
|
||||
public void testSuccess_methodPostIsDefault() {
|
||||
dnsQueue.addDomainRefreshTask("domain.com");
|
||||
dnsQueue.addDomainRefreshTask("domain.net");
|
||||
dnsQueue.addDomainRefreshTask("domain.example");
|
||||
|
@ -185,7 +184,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_allSingleLockTlds() throws Exception {
|
||||
public void testSuccess_allSingleLockTlds() {
|
||||
dnsQueue.addDomainRefreshTask("domain.com");
|
||||
dnsQueue.addDomainRefreshTask("domain.net");
|
||||
dnsQueue.addDomainRefreshTask("domain.example");
|
||||
|
@ -198,7 +197,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_moreUpdatesThanQueueBatchSize() throws Exception {
|
||||
public void testSuccess_moreUpdatesThanQueueBatchSize() {
|
||||
// The task queue has a batch size of 1000 (that's the maximum number of items you can lease at
|
||||
// once).
|
||||
ImmutableList<String> domains =
|
||||
|
@ -225,7 +224,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_twoDnsWriters() throws Exception {
|
||||
public void testSuccess_twoDnsWriters() {
|
||||
persistResource(
|
||||
Registry.get("com")
|
||||
.asBuilder()
|
||||
|
@ -240,7 +239,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_differentUpdateTimes_usesMinimum() throws Exception {
|
||||
public void testSuccess_differentUpdateTimes_usesMinimum() {
|
||||
clock.setTo(DateTime.parse("3000-02-03TZ"));
|
||||
dnsQueue.addDomainRefreshTask("domain1.com");
|
||||
clock.setTo(DateTime.parse("3000-02-04TZ"));
|
||||
|
@ -265,7 +264,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_oneTldPaused_returnedToQueue() throws Exception {
|
||||
public void testSuccess_oneTldPaused_returnedToQueue() {
|
||||
persistResource(Registry.get("net").asBuilder().setDnsPaused(true).build());
|
||||
dnsQueue.addDomainRefreshTask("domain.com");
|
||||
dnsQueue.addDomainRefreshTask("domain.net");
|
||||
|
@ -279,7 +278,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_oneTldUnknown_returnedToQueue() throws Exception {
|
||||
public void testSuccess_oneTldUnknown_returnedToQueue() {
|
||||
dnsQueue.addDomainRefreshTask("domain.com");
|
||||
dnsQueue.addDomainRefreshTask("domain.example");
|
||||
QueueFactory.getQueue(DNS_PULL_QUEUE_NAME)
|
||||
|
@ -299,7 +298,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_corruptTaskTldMismatch_published() throws Exception {
|
||||
public void testSuccess_corruptTaskTldMismatch_published() {
|
||||
// TODO(mcilwain): what's the correct action to take in this case?
|
||||
dnsQueue.addDomainRefreshTask("domain.com");
|
||||
dnsQueue.addDomainRefreshTask("domain.example");
|
||||
|
@ -320,7 +319,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_corruptTaskNoTld_discarded() throws Exception {
|
||||
public void testSuccess_corruptTaskNoTld_discarded() {
|
||||
dnsQueue.addDomainRefreshTask("domain.com");
|
||||
dnsQueue.addDomainRefreshTask("domain.example");
|
||||
QueueFactory.getQueue(DNS_PULL_QUEUE_NAME)
|
||||
|
@ -339,7 +338,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_corruptTaskNoName_discarded() throws Exception {
|
||||
public void testSuccess_corruptTaskNoName_discarded() {
|
||||
dnsQueue.addDomainRefreshTask("domain.com");
|
||||
dnsQueue.addDomainRefreshTask("domain.example");
|
||||
QueueFactory.getQueue(DNS_PULL_QUEUE_NAME)
|
||||
|
@ -358,7 +357,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_corruptTaskNoType_discarded() throws Exception {
|
||||
public void testSuccess_corruptTaskNoType_discarded() {
|
||||
dnsQueue.addDomainRefreshTask("domain.com");
|
||||
dnsQueue.addDomainRefreshTask("domain.example");
|
||||
QueueFactory.getQueue(DNS_PULL_QUEUE_NAME)
|
||||
|
@ -377,7 +376,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_corruptTaskWrongType_discarded() throws Exception {
|
||||
public void testSuccess_corruptTaskWrongType_discarded() {
|
||||
dnsQueue.addDomainRefreshTask("domain.com");
|
||||
dnsQueue.addDomainRefreshTask("domain.example");
|
||||
QueueFactory.getQueue(DNS_PULL_QUEUE_NAME)
|
||||
|
@ -397,7 +396,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_zone_getsIgnored() throws Exception {
|
||||
public void testSuccess_zone_getsIgnored() {
|
||||
dnsQueue.addHostRefreshTask("ns1.domain.com");
|
||||
dnsQueue.addDomainRefreshTask("domain.net");
|
||||
dnsQueue.addZoneRefreshTask("example");
|
||||
|
@ -418,7 +417,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_manyDomainsAndHosts() throws Exception {
|
||||
public void testSuccess_manyDomainsAndHosts() {
|
||||
for (int i = 0; i < 150; i++) {
|
||||
// 0: domain; 1: host 1; 2: host 2
|
||||
for (int thingType = 0; thingType < 3; thingType++) {
|
||||
|
@ -489,7 +488,7 @@ public class ReadDnsQueueActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_lockGroupsHostBySuperordinateDomain() throws Exception {
|
||||
public void testSuccess_lockGroupsHostBySuperordinateDomain() {
|
||||
dnsQueue.addDomainRefreshTask("hello.multilock.uk");
|
||||
dnsQueue.addHostRefreshTask("ns1.abc.hello.multilock.uk");
|
||||
dnsQueue.addHostRefreshTask("ns2.hello.multilock.uk");
|
||||
|
|
|
@ -310,14 +310,14 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_nonExistentDomain() throws Exception {
|
||||
public void testLoadDomain_nonExistentDomain() {
|
||||
writer.publishDomain("example.tld");
|
||||
|
||||
verifyZone(ImmutableSet.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_noDsDataOrNameservers() throws Exception {
|
||||
public void testLoadDomain_noDsDataOrNameservers() {
|
||||
persistResource(fakeDomain("example.tld", ImmutableSet.of(), 0));
|
||||
writer.publishDomain("example.tld");
|
||||
|
||||
|
@ -325,7 +325,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_deleteOldData() throws Exception {
|
||||
public void testLoadDomain_deleteOldData() {
|
||||
stubZone = fakeDomainRecords("example.tld", 2, 2, 2, 2);
|
||||
persistResource(fakeDomain("example.tld", ImmutableSet.of(), 0));
|
||||
writer.publishDomain("example.tld");
|
||||
|
@ -334,7 +334,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_withExternalNs() throws Exception {
|
||||
public void testLoadDomain_withExternalNs() {
|
||||
persistResource(
|
||||
fakeDomain("example.tld", ImmutableSet.of(persistResource(fakeHost("0.external"))), 0));
|
||||
writer.publishDomain("example.tld");
|
||||
|
@ -343,7 +343,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_withDsData() throws Exception {
|
||||
public void testLoadDomain_withDsData() {
|
||||
persistResource(
|
||||
fakeDomain("example.tld", ImmutableSet.of(persistResource(fakeHost("0.external"))), 1));
|
||||
writer.publishDomain("example.tld");
|
||||
|
@ -352,7 +352,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_withInBailiwickNs_IPv4() throws Exception {
|
||||
public void testLoadDomain_withInBailiwickNs_IPv4() {
|
||||
persistResource(
|
||||
fakeDomain(
|
||||
"example.tld",
|
||||
|
@ -367,7 +367,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_withInBailiwickNs_IPv6() throws Exception {
|
||||
public void testLoadDomain_withInBailiwickNs_IPv6() {
|
||||
persistResource(
|
||||
fakeDomain(
|
||||
"example.tld",
|
||||
|
@ -382,7 +382,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_withNameserveThatEndsWithDomainName() throws Exception {
|
||||
public void testLoadDomain_withNameserveThatEndsWithDomainName() {
|
||||
persistResource(
|
||||
fakeDomain(
|
||||
"example.tld",
|
||||
|
@ -394,7 +394,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadHost_externalHost() throws Exception {
|
||||
public void testLoadHost_externalHost() {
|
||||
writer.publishHost("ns1.example.com");
|
||||
|
||||
// external hosts should not be published in our zone
|
||||
|
@ -402,7 +402,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadHost_removeStaleNsRecords() throws Exception {
|
||||
public void testLoadHost_removeStaleNsRecords() {
|
||||
// Initialize the zone with both NS records
|
||||
stubZone = fakeDomainRecords("example.tld", 2, 0, 0, 0);
|
||||
|
||||
|
@ -435,7 +435,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_withClientHold() throws Exception {
|
||||
public void testLoadDomain_withClientHold() {
|
||||
persistResource(
|
||||
fakeDomain(
|
||||
"example.tld",
|
||||
|
@ -450,7 +450,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_withServerHold() throws Exception {
|
||||
public void testLoadDomain_withServerHold() {
|
||||
persistResource(
|
||||
fakeDomain(
|
||||
"example.tld",
|
||||
|
@ -466,7 +466,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testLoadDomain_withPendingDelete() throws Exception {
|
||||
public void testLoadDomain_withPendingDelete() {
|
||||
persistResource(
|
||||
fakeDomain(
|
||||
"example.tld",
|
||||
|
@ -481,7 +481,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testDuplicateRecords() throws Exception {
|
||||
public void testDuplicateRecords() {
|
||||
// In publishing DNS records, we can end up publishing information on the same host twice
|
||||
// (through a domain change and a host change), so this scenario needs to work.
|
||||
persistResource(
|
||||
|
|
|
@ -102,7 +102,7 @@ public class BigqueryPollJobActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_enqueuePollTask() throws Exception {
|
||||
public void testSuccess_enqueuePollTask() {
|
||||
new BigqueryPollJobEnqueuer(TASK_QUEUE_UTILS).enqueuePollTask(
|
||||
new JobReference().setProjectId(PROJECT_ID).setJobId(JOB_ID));
|
||||
assertTasksEnqueued(BigqueryPollJobAction.QUEUE, newPollJobTaskMatcher("GET"));
|
||||
|
|
|
@ -93,8 +93,7 @@ public class CheckSnapshotActionTest {
|
|||
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
|
||||
}
|
||||
|
||||
private static void assertLoadTaskEnqueued(String id, String file, String kinds)
|
||||
throws Exception {
|
||||
private static void assertLoadTaskEnqueued(String id, String file, String kinds) {
|
||||
assertTasksEnqueued(
|
||||
"export-snapshot",
|
||||
new TaskMatcher()
|
||||
|
@ -106,7 +105,7 @@ public class CheckSnapshotActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_enqueuePollTask() throws Exception {
|
||||
public void testSuccess_enqueuePollTask() {
|
||||
CheckSnapshotAction.enqueuePollTask(
|
||||
"some_snapshot_name", ImmutableSet.of("one", "two", "three"));
|
||||
assertTasksEnqueued(
|
||||
|
@ -147,7 +146,7 @@ public class CheckSnapshotActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testPost_forCompleteBackup_enqueuesLoadTask() throws Exception {
|
||||
public void testPost_forCompleteBackup_enqueuesLoadTask() {
|
||||
|
||||
action.run();
|
||||
assertLoadTaskEnqueued(
|
||||
|
@ -155,7 +154,7 @@ public class CheckSnapshotActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testPost_forCompleteAutoBackup_enqueuesLoadTask_usingBackupName() throws Exception {
|
||||
public void testPost_forCompleteAutoBackup_enqueuesLoadTask_usingBackupName() {
|
||||
action.snapshotName = "auto_snapshot_somestring";
|
||||
when(backupService.findByName("auto_snapshot_somestring")).thenReturn(backupInfo);
|
||||
|
||||
|
@ -165,7 +164,7 @@ public class CheckSnapshotActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testPost_forCompleteBackup_withExtraKindsToLoad_enqueuesLoadTask() throws Exception {
|
||||
public void testPost_forCompleteBackup_withExtraKindsToLoad_enqueuesLoadTask() {
|
||||
action.kindsToLoadParam = "one,foo";
|
||||
|
||||
action.run();
|
||||
|
@ -174,7 +173,7 @@ public class CheckSnapshotActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testPost_forCompleteBackup_withEmptyKindsToLoad_skipsLoadTask() throws Exception {
|
||||
public void testPost_forCompleteBackup_withEmptyKindsToLoad_skipsLoadTask() {
|
||||
action.kindsToLoadParam = "";
|
||||
|
||||
action.run();
|
||||
|
|
|
@ -78,7 +78,7 @@ public class DatastoreBackupServiceTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_launchBackup() throws Exception {
|
||||
public void testSuccess_launchBackup() {
|
||||
backupService.launchNewBackup(
|
||||
"export-snapshot", "backup1", "somebucket", ImmutableSet.of("foo", "bar"));
|
||||
assertTasksEnqueued("export-snapshot",
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ExportSnapshotActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testPost_launchesBackup_andEnqueuesPollTask() throws Exception {
|
||||
public void testPost_launchesBackup_andEnqueuesPollTask() {
|
||||
action.run();
|
||||
verify(backupService)
|
||||
.launchNewBackup(
|
||||
|
|
|
@ -96,7 +96,7 @@ public class LoadSnapshotActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_enqueueLoadTask() throws Exception {
|
||||
public void testSuccess_enqueueLoadTask() {
|
||||
enqueueLoadSnapshotTask(
|
||||
"id12345", "gs://bucket/snapshot.backup_info", ImmutableSet.of("one", "two", "three"));
|
||||
assertTasksEnqueued(
|
||||
|
|
|
@ -84,7 +84,7 @@ public class UpdateSnapshotViewActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_createViewUpdateTask() throws Exception {
|
||||
public void testSuccess_createViewUpdateTask() {
|
||||
getQueue(QUEUE).add(createViewUpdateTask("some_dataset", "12345_fookind", "fookind"));
|
||||
assertTasksEnqueued(QUEUE,
|
||||
new TaskMatcher()
|
||||
|
|
|
@ -246,18 +246,18 @@ public abstract class FlowTestCase<F extends Flow> extends ShardableTestCase {
|
|||
|
||||
public void assertPollMessages(
|
||||
String clientId,
|
||||
PollMessage... expected) throws Exception {
|
||||
PollMessage... expected) {
|
||||
assertPollMessagesHelper(getPollMessages(clientId), expected);
|
||||
}
|
||||
|
||||
public void assertPollMessages(
|
||||
String clientId,
|
||||
DateTime now,
|
||||
PollMessage... expected) throws Exception {
|
||||
PollMessage... expected) {
|
||||
assertPollMessagesHelper(getPollMessages(clientId, now), expected);
|
||||
}
|
||||
|
||||
public void assertPollMessages(PollMessage... expected) throws Exception {
|
||||
public void assertPollMessages(PollMessage... expected) {
|
||||
assertPollMessagesHelper(getPollMessages(), expected);
|
||||
}
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ public abstract class ResourceFlowTestCase<F extends Flow, R extends EppResource
|
|||
|
||||
/** Asserts the presence of a single enqueued async contact or host deletion */
|
||||
protected <T extends EppResource> void assertAsyncDeletionTaskEnqueued(
|
||||
T resource, String requestingClientId, Trid trid, boolean isSuperuser) throws Exception {
|
||||
T resource, String requestingClientId, Trid trid, boolean isSuperuser) {
|
||||
TaskMatcher expected = new TaskMatcher()
|
||||
.etaDelta(Duration.standardSeconds(75), Duration.standardSeconds(105)) // expected: 90
|
||||
.param("resourceKey", Key.create(resource).getString())
|
||||
|
|
|
@ -49,7 +49,7 @@ public class ContactTransferApproveFlowTest
|
|||
extends ContactTransferFlowTestCase<ContactTransferApproveFlow, ContactResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("contact_transfer_approve.xml");
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
setupContactWithPendingTransfer();
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ContactTransferCancelFlowTest
|
|||
extends ContactTransferFlowTestCase<ContactTransferCancelFlow, ContactResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
this.setEppInput("contact_transfer_cancel.xml");
|
||||
setClientIdForFlow("NewRegistrar");
|
||||
setupContactWithPendingTransfer();
|
||||
|
|
|
@ -41,7 +41,7 @@ public class ContactTransferQueryFlowTest
|
|||
extends ContactTransferFlowTestCase<ContactTransferQueryFlow, ContactResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("contact_transfer_query.xml");
|
||||
clock.setTo(DateTime.parse("2000-06-10T22:00:00.0Z"));
|
||||
setClientIdForFlow("NewRegistrar");
|
||||
|
|
|
@ -48,7 +48,7 @@ public class ContactTransferRejectFlowTest
|
|||
extends ContactTransferFlowTestCase<ContactTransferRejectFlow, ContactResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("contact_transfer_reject.xml");
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
setupContactWithPendingTransfer();
|
||||
|
|
|
@ -1845,79 +1845,79 @@ public class DomainApplicationCreateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_uppercase() throws Exception {
|
||||
public void testFailure_uppercase() {
|
||||
doFailingDomainNameTest("Example.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badCharacter() throws Exception {
|
||||
public void testFailure_badCharacter() {
|
||||
doFailingDomainNameTest("test_example.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDash() throws Exception {
|
||||
public void testFailure_leadingDash() {
|
||||
doFailingDomainNameTest("-example.tld", LeadingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_trailingDash() throws Exception {
|
||||
public void testFailure_trailingDash() {
|
||||
doFailingDomainNameTest("example-.tld", TrailingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooLong() throws Exception {
|
||||
public void testFailure_tooLong() {
|
||||
doFailingDomainNameTest(Strings.repeat("a", 64) + ".tld", DomainLabelTooLongException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDot() throws Exception {
|
||||
public void testFailure_leadingDot() {
|
||||
doFailingDomainNameTest(".example.tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDotTld() throws Exception {
|
||||
public void testFailure_leadingDotTld() {
|
||||
doFailingDomainNameTest("foo..tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooManyParts() throws Exception {
|
||||
public void testFailure_tooManyParts() {
|
||||
doFailingDomainNameTest("foo.example.tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooFewParts() throws Exception {
|
||||
public void testFailure_tooFewParts() {
|
||||
doFailingDomainNameTest("tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameExistsAsTld_lowercase() throws Exception {
|
||||
public void testFailure_domainNameExistsAsTld_lowercase() {
|
||||
createTlds("foo.tld", "tld");
|
||||
doFailingDomainNameTest("foo.tld", DomainNameExistsAsTldException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameExistsAsTld_uppercase() throws Exception {
|
||||
public void testFailure_domainNameExistsAsTld_uppercase() {
|
||||
createTlds("foo.tld", "tld");
|
||||
doFailingDomainNameTest("FOO.TLD", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidPunycode() throws Exception {
|
||||
public void testFailure_invalidPunycode() {
|
||||
doFailingDomainNameTest("xn--abcdefg.tld", InvalidPunycodeException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_dashesInThirdAndFourthPosition() throws Exception {
|
||||
public void testFailure_dashesInThirdAndFourthPosition() {
|
||||
doFailingDomainNameTest("ab--cdefg.tld", DashesInThirdAndFourthException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tldDoesNotExist() throws Exception {
|
||||
public void testFailure_tldDoesNotExist() {
|
||||
doFailingDomainNameTest("foo.nosuchtld", TldDoesNotExistException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidIdnCodePoints() throws Exception {
|
||||
public void testFailure_invalidIdnCodePoints() {
|
||||
// ❤☀☆☂☻♞☯.tld
|
||||
doFailingDomainNameTest("xn--k3hel9n7bxlu1e.tld", InvalidIdnDomainLabelException.class);
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
unusedContact = persistActiveContact("unused");
|
||||
}
|
||||
|
||||
private DomainApplication persistApplication() throws Exception {
|
||||
private DomainApplication persistApplication() {
|
||||
return persistResource(
|
||||
newApplicationBuilder()
|
||||
.setContacts(
|
||||
|
@ -129,7 +129,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
return newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD");
|
||||
}
|
||||
|
||||
private DomainApplication persistNewApplication() throws Exception {
|
||||
private DomainApplication persistNewApplication() {
|
||||
return persistResource(newApplicationBuilder().build());
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
private void doSecDnsFailingTest(
|
||||
Class<? extends EppException> expectedException, String xmlFilename) throws Exception {
|
||||
Class<? extends EppException> expectedException, String xmlFilename) {
|
||||
setEppInput(xmlFilename);
|
||||
persistReferencedEntities();
|
||||
persistNewApplication();
|
||||
|
@ -369,30 +369,30 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_secDnsAllCannotBeFalse() throws Exception {
|
||||
public void testFailure_secDnsAllCannotBeFalse() {
|
||||
doSecDnsFailingTest(
|
||||
SecDnsAllUsageException.class, "domain_update_sunrise_dsdata_rem_all_false.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_secDnsEmptyNotAllowed() throws Exception {
|
||||
public void testFailure_secDnsEmptyNotAllowed() {
|
||||
doSecDnsFailingTest(EmptySecDnsUpdateException.class, "domain_update_sunrise_dsdata_empty.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_secDnsUrgentNotSupported() throws Exception {
|
||||
public void testFailure_secDnsUrgentNotSupported() {
|
||||
doSecDnsFailingTest(
|
||||
UrgentAttributeNotSupportedException.class, "domain_update_sunrise_dsdata_urgent.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_secDnsChangeNotSupported() throws Exception {
|
||||
public void testFailure_secDnsChangeNotSupported() {
|
||||
doSecDnsFailingTest(
|
||||
MaxSigLifeChangeNotSupportedException.class, "domain_update_sunrise_maxsiglife.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_secDnsTooManyDsRecords() throws Exception {
|
||||
public void testFailure_secDnsTooManyDsRecords() {
|
||||
ImmutableSet.Builder<DelegationSignerData> builder = new ImmutableSet.Builder<>();
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
builder.add(DelegationSignerData.create(i, 2, 3, new byte[] {0, 1, 2}));
|
||||
|
@ -437,7 +437,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_applicationDomainNameMismatch() throws Exception {
|
||||
public void testFailure_applicationDomainNameMismatch() {
|
||||
persistReferencedEntities();
|
||||
persistResource(newApplicationBuilder().setFullyQualifiedDomainName("something.tld").build());
|
||||
EppException thrown = assertThrows(ApplicationDomainNameMismatchException.class, this::runFlow);
|
||||
|
@ -462,7 +462,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_clientUpdateProhibited() throws Exception {
|
||||
public void testFailure_clientUpdateProhibited() {
|
||||
setEppInput("domain_update_sunrise_authinfo.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
|
@ -475,7 +475,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_serverUpdateProhibited() throws Exception {
|
||||
public void testFailure_serverUpdateProhibited() {
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newApplicationBuilder()
|
||||
|
@ -486,7 +486,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
assertThat(thrown).hasMessageThat().contains("serverUpdateProhibited");
|
||||
}
|
||||
|
||||
private void doIllegalApplicationStatusTest(ApplicationStatus status) throws Exception {
|
||||
private void doIllegalApplicationStatusTest(ApplicationStatus status) {
|
||||
persistReferencedEntities();
|
||||
persistResource(newApplicationBuilder().setApplicationStatus(status).build());
|
||||
EppException thrown =
|
||||
|
@ -495,22 +495,22 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_allocatedApplicationStatus() throws Exception {
|
||||
public void testFailure_allocatedApplicationStatus() {
|
||||
doIllegalApplicationStatusTest(ApplicationStatus.ALLOCATED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidApplicationStatus() throws Exception {
|
||||
public void testFailure_invalidApplicationStatus() {
|
||||
doIllegalApplicationStatusTest(ApplicationStatus.INVALID);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_rejectedApplicationStatus() throws Exception {
|
||||
public void testFailure_rejectedApplicationStatus() {
|
||||
doIllegalApplicationStatusTest(ApplicationStatus.REJECTED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingHost() throws Exception {
|
||||
public void testFailure_missingHost() {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
persistActiveContact("sh8013");
|
||||
persistActiveContact("mak21");
|
||||
|
@ -521,7 +521,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingContact() throws Exception {
|
||||
public void testFailure_missingContact() {
|
||||
persistActiveHost("ns1.example.tld");
|
||||
persistActiveHost("ns2.example.tld");
|
||||
persistActiveContact("mak21");
|
||||
|
@ -553,7 +553,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_clientProhibitedStatusValue() throws Exception {
|
||||
public void testFailure_clientProhibitedStatusValue() {
|
||||
setEppInput("domain_update_sunrise_prohibited_status.xml");
|
||||
persistReferencedEntities();
|
||||
persistNewApplication();
|
||||
|
@ -572,7 +572,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_duplicateContactInCommand() throws Exception {
|
||||
public void testFailure_duplicateContactInCommand() {
|
||||
setEppInput("domain_update_sunrise_duplicate_contact.xml");
|
||||
persistReferencedEntities();
|
||||
persistNewApplication();
|
||||
|
@ -581,7 +581,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingContactType() throws Exception {
|
||||
public void testFailure_missingContactType() {
|
||||
setEppInput("domain_update_sunrise_missing_contact_type.xml");
|
||||
persistReferencedEntities();
|
||||
persistNewApplication();
|
||||
|
@ -591,7 +591,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unauthorizedClient() throws Exception {
|
||||
public void testFailure_unauthorizedClient() {
|
||||
sessionMetadata.setClientId("NewRegistrar");
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
|
@ -610,7 +610,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
public void testFailure_notAuthorizedForTld() {
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
persistReferencedEntities();
|
||||
|
@ -631,7 +631,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_sameNameserverAddedAndRemoved() throws Exception {
|
||||
public void testFailure_sameNameserverAddedAndRemoved() {
|
||||
setEppInput("domain_update_sunrise_add_remove_same_host.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
|
@ -646,7 +646,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_sameContactAddedAndRemoved() throws Exception {
|
||||
public void testFailure_sameContactAddedAndRemoved() {
|
||||
setEppInput("domain_update_sunrise_add_remove_same_contact.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
|
@ -663,7 +663,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_removeAdmin() throws Exception {
|
||||
public void testFailure_removeAdmin() {
|
||||
setEppInput("domain_update_sunrise_remove_admin.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
|
@ -678,7 +678,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_removeTech() throws Exception {
|
||||
public void testFailure_removeTech() {
|
||||
setEppInput("domain_update_sunrise_remove_tech.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
|
@ -693,7 +693,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_newRegistrantNotWhitelisted() throws Exception {
|
||||
public void testFailure_newRegistrantNotWhitelisted() {
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
persistResource(
|
||||
|
@ -707,7 +707,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_newNameserverNotWhitelisted() throws Exception {
|
||||
public void testFailure_newNameserverNotWhitelisted() {
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
persistResource(
|
||||
|
@ -734,7 +734,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tldWithNameserverWhitelist_removeLastNameserver() throws Exception {
|
||||
public void testFailure_tldWithNameserverWhitelist_removeLastNameserver() {
|
||||
setEppInput("domain_update_sunrise_remove_nameserver.xml");
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
|
@ -790,7 +790,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameserverRestricted_addedNameserverDisallowed() throws Exception {
|
||||
public void testFailure_domainNameserverRestricted_addedNameserverDisallowed() {
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
persistResource(
|
||||
|
@ -807,7 +807,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameserverRestricted_removeLastNameserver() throws Exception {
|
||||
public void testFailure_domainNameserverRestricted_removeLastNameserver() {
|
||||
setEppInput("domain_update_sunrise_remove_nameserver.xml");
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
|
@ -868,8 +868,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_addedNameserversAllowedInTld_disallowedInDomainNameserversWhitelists()
|
||||
throws Exception {
|
||||
public void testFailure_addedNameserversAllowedInTld_disallowedInDomainNameserversWhitelists() {
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
persistResource(
|
||||
|
@ -888,8 +887,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_addedNameserversDisallowedInTld_AllowedInDomainNameserversWhitelists()
|
||||
throws Exception {
|
||||
public void testFailure_addedNameserversDisallowedInTld_AllowedInDomainNameserversWhitelists() {
|
||||
persistReferencedEntities();
|
||||
persistApplication();
|
||||
persistResource(
|
||||
|
|
|
@ -92,7 +92,7 @@ public class DomainCheckFlowTest
|
|||
}
|
||||
|
||||
@Before
|
||||
public void initCheckTest() throws Exception {
|
||||
public void initCheckTest() {
|
||||
createTld("tld", TldState.QUIET_PERIOD);
|
||||
persistResource(Registry.get("tld").asBuilder().setReservedLists(createReservedList()).build());
|
||||
}
|
||||
|
@ -366,79 +366,79 @@ public class DomainCheckFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_uppercase() throws Exception {
|
||||
public void testFailure_uppercase() {
|
||||
doFailingBadLabelTest("FOO.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badCharacter() throws Exception {
|
||||
public void testFailure_badCharacter() {
|
||||
doFailingBadLabelTest("test_example.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDash() throws Exception {
|
||||
public void testFailure_leadingDash() {
|
||||
doFailingBadLabelTest("-example.tld", LeadingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_trailingDash() throws Exception {
|
||||
public void testFailure_trailingDash() {
|
||||
doFailingBadLabelTest("example-.tld", TrailingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooLong() throws Exception {
|
||||
public void testFailure_tooLong() {
|
||||
doFailingBadLabelTest(Strings.repeat("a", 64) + ".tld", DomainLabelTooLongException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDot() throws Exception {
|
||||
public void testFailure_leadingDot() {
|
||||
doFailingBadLabelTest(".example.tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDotTld() throws Exception {
|
||||
public void testFailure_leadingDotTld() {
|
||||
doFailingBadLabelTest("foo..tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooManyParts() throws Exception {
|
||||
public void testFailure_tooManyParts() {
|
||||
doFailingBadLabelTest("foo.example.tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooFewParts() throws Exception {
|
||||
public void testFailure_tooFewParts() {
|
||||
doFailingBadLabelTest("tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameExistsAsTld_lowercase() throws Exception {
|
||||
public void testFailure_domainNameExistsAsTld_lowercase() {
|
||||
createTlds("foo.tld", "tld");
|
||||
doFailingBadLabelTest("foo.tld", DomainNameExistsAsTldException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameExistsAsTld_uppercase() throws Exception {
|
||||
public void testFailure_domainNameExistsAsTld_uppercase() {
|
||||
createTlds("foo.tld", "tld");
|
||||
doFailingBadLabelTest("FOO.TLD", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidPunycode() throws Exception {
|
||||
public void testFailure_invalidPunycode() {
|
||||
doFailingBadLabelTest("xn--abcdefg.tld", InvalidPunycodeException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_dashesInThirdAndFourthPosition() throws Exception {
|
||||
public void testFailure_dashesInThirdAndFourthPosition() {
|
||||
doFailingBadLabelTest("ab--cdefg.tld", DashesInThirdAndFourthException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tldDoesNotExist() throws Exception {
|
||||
public void testFailure_tldDoesNotExist() {
|
||||
doFailingBadLabelTest("foo.nosuchtld", TldDoesNotExistException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidIdnCodePoints() throws Exception {
|
||||
public void testFailure_invalidIdnCodePoints() {
|
||||
// ❤☀☆☂☻♞☯.tld
|
||||
doFailingBadLabelTest("xn--k3hel9n7bxlu1e.tld", InvalidIdnDomainLabelException.class);
|
||||
}
|
||||
|
|
|
@ -883,7 +883,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingClaimsNotice() throws Exception {
|
||||
public void testFailure_missingClaimsNotice() {
|
||||
persistClaimsList(ImmutableMap.of("example", CLAIMS_KEY));
|
||||
setEppInput("domain_create.xml");
|
||||
persistContactsAndHosts();
|
||||
|
@ -1634,68 +1634,68 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_uppercase() throws Exception {
|
||||
public void testFailure_uppercase() {
|
||||
doFailingDomainNameTest("Example.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badCharacter() throws Exception {
|
||||
public void testFailure_badCharacter() {
|
||||
doFailingDomainNameTest("test_example.tld", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDash() throws Exception {
|
||||
public void testFailure_leadingDash() {
|
||||
doFailingDomainNameTest("-example.tld", LeadingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_trailingDash() throws Exception {
|
||||
public void testFailure_trailingDash() {
|
||||
doFailingDomainNameTest("example-.tld", TrailingDashException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooLong() throws Exception {
|
||||
public void testFailure_tooLong() {
|
||||
doFailingDomainNameTest(Strings.repeat("a", 64) + ".tld", DomainLabelTooLongException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDot() throws Exception {
|
||||
public void testFailure_leadingDot() {
|
||||
doFailingDomainNameTest(".example.tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_leadingDotTld() throws Exception {
|
||||
public void testFailure_leadingDotTld() {
|
||||
doFailingDomainNameTest("foo..tld", EmptyDomainNamePartException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooManyParts() throws Exception {
|
||||
public void testFailure_tooManyParts() {
|
||||
doFailingDomainNameTest("foo.example.tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooFewParts() throws Exception {
|
||||
public void testFailure_tooFewParts() {
|
||||
doFailingDomainNameTest("tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidPunycode() throws Exception {
|
||||
public void testFailure_invalidPunycode() {
|
||||
// You don't want to know what this string (might?) mean.
|
||||
doFailingDomainNameTest("xn--uxa129t5ap4f1h1bc3p.tld", InvalidPunycodeException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_dashesInThirdAndFourthPosition() throws Exception {
|
||||
public void testFailure_dashesInThirdAndFourthPosition() {
|
||||
doFailingDomainNameTest("ab--cdefg.tld", DashesInThirdAndFourthException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tldDoesNotExist() throws Exception {
|
||||
public void testFailure_tldDoesNotExist() {
|
||||
doFailingDomainNameTest("foo.nosuchtld", TldDoesNotExistException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidIdnCodePoints() throws Exception {
|
||||
public void testFailure_invalidIdnCodePoints() {
|
||||
// ❤☀☆☂☻♞☯.tld
|
||||
doFailingDomainNameTest("xn--k3hel9n7bxlu1e.tld", InvalidIdnDomainLabelException.class);
|
||||
}
|
||||
|
|
|
@ -195,8 +195,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
}
|
||||
|
||||
private void assertAutorenewClosedAndCancellationCreatedFor(
|
||||
BillingEvent.OneTime graceBillingEvent, HistoryEntry historyEntryDomainDelete)
|
||||
throws Exception {
|
||||
BillingEvent.OneTime graceBillingEvent, HistoryEntry historyEntryDomainDelete) {
|
||||
DateTime eventTime = clock.nowUtc();
|
||||
assertBillingEvents(
|
||||
createAutorenewBillingEvent("TheRegistrar").setRecurrenceEndTime(eventTime).build(),
|
||||
|
@ -212,7 +211,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
.build());
|
||||
}
|
||||
|
||||
private void assertOnlyBillingEventIsClosedAutorenew(String clientId) throws Exception {
|
||||
private void assertOnlyBillingEventIsClosedAutorenew(String clientId) {
|
||||
// There should be no billing events (even timed to when the transfer would have expired) except
|
||||
// for the now closed autorenew one.
|
||||
assertBillingEvents(
|
||||
|
|
|
@ -84,7 +84,7 @@ public class DomainTransferApproveFlowTest
|
|||
extends DomainTransferFlowTestCase<DomainTransferApproveFlow, DomainResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("domain_transfer_approve.xml");
|
||||
// Change the registry so that the renew price changes a day minus 1 millisecond before the
|
||||
// transfer (right after there will be an autorenew in the test case that has one) and then
|
||||
|
|
|
@ -63,7 +63,7 @@ public class DomainTransferCancelFlowTest
|
|||
extends DomainTransferFlowTestCase<DomainTransferCancelFlow, DomainResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("domain_transfer_cancel.xml");
|
||||
setClientIdForFlow("NewRegistrar");
|
||||
setupDomainWithPendingTransfer("example", "tld");
|
||||
|
|
|
@ -220,7 +220,7 @@ public class DomainTransferFlowTestCase<F extends Flow, R extends EppResource>
|
|||
}
|
||||
|
||||
/** Adds a domain that has a pending transfer on it from TheRegistrar to NewRegistrar. */
|
||||
protected void setupDomainWithPendingTransfer(String label, String tld) throws Exception {
|
||||
protected void setupDomainWithPendingTransfer(String label, String tld) {
|
||||
setupDomain(label, tld);
|
||||
domain = persistWithPendingTransfer(domain);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class DomainTransferQueryFlowTest
|
|||
extends DomainTransferFlowTestCase<DomainTransferQueryFlow, DomainResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("domain_transfer_query.xml");
|
||||
setClientIdForFlow("NewRegistrar");
|
||||
setupDomainWithPendingTransfer("example", "tld");
|
||||
|
|
|
@ -66,7 +66,7 @@ public class DomainTransferRejectFlowTest
|
|||
extends DomainTransferFlowTestCase<DomainTransferRejectFlow, DomainResource> {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setUp() {
|
||||
setEppInput("domain_transfer_reject.xml");
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
setupDomainWithPendingTransfer("example", "tld");
|
||||
|
|
|
@ -209,8 +209,7 @@ public class DomainTransferRequestFlowTest
|
|||
Optional<Money> transferCost,
|
||||
ImmutableSet<GracePeriod> originalGracePeriods,
|
||||
boolean expectTransferBillingEvent,
|
||||
BillingEvent.Cancellation.Builder... extraExpectedBillingEvents)
|
||||
throws Exception {
|
||||
BillingEvent.Cancellation.Builder... extraExpectedBillingEvents) {
|
||||
Registry registry = Registry.get(domain.getTld());
|
||||
final HistoryEntry historyEntryTransferRequest =
|
||||
getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_REQUEST);
|
||||
|
@ -668,7 +667,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_refundableFee_v06() throws Exception {
|
||||
public void testFailure_refundableFee_v06() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -678,7 +677,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_refundableFee_v11() throws Exception {
|
||||
public void testFailure_refundableFee_v11() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -688,7 +687,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_refundableFee_v12() throws Exception {
|
||||
public void testFailure_refundableFee_v12() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -698,7 +697,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_gracePeriodFee_v06() throws Exception {
|
||||
public void testFailure_gracePeriodFee_v06() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -708,7 +707,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_gracePeriodFee_v11() throws Exception {
|
||||
public void testFailure_gracePeriodFee_v11() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -718,7 +717,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_gracePeriodFee_v12() throws Exception {
|
||||
public void testFailure_gracePeriodFee_v12() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -728,7 +727,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_appliedFee_v06() throws Exception {
|
||||
public void testFailure_appliedFee_v06() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -738,7 +737,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_appliedFee_v11() throws Exception {
|
||||
public void testFailure_appliedFee_v11() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -748,7 +747,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_appliedFee_v12() throws Exception {
|
||||
public void testFailure_appliedFee_v12() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -788,7 +787,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_multiYearPeriod() throws Exception {
|
||||
public void testFailure_multiYearPeriod() {
|
||||
setupDomain("example", "tld");
|
||||
clock.advanceOneMilli();
|
||||
EppException thrown =
|
||||
|
@ -879,7 +878,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_superuserExtension_twoYearPeriod() throws Exception {
|
||||
public void testFailure_superuserExtension_twoYearPeriod() {
|
||||
setupDomain("example", "tld");
|
||||
eppRequestSource = EppRequestSource.TOOL;
|
||||
clock.advanceOneMilli();
|
||||
|
@ -893,7 +892,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_superuserExtension_zeroPeriod_feeTransferExtension() throws Exception {
|
||||
public void testFailure_superuserExtension_zeroPeriod_feeTransferExtension() {
|
||||
setupDomain("example", "tld");
|
||||
eppRequestSource = EppRequestSource.TOOL;
|
||||
clock.advanceOneMilli();
|
||||
|
@ -950,7 +949,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_notAuthorizedForTld() throws Exception {
|
||||
public void testFailure_notAuthorizedForTld() {
|
||||
setupDomain("example", "tld");
|
||||
persistResource(
|
||||
loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||
|
@ -1091,7 +1090,7 @@ public class DomainTransferRequestFlowTest
|
|||
runTest("domain_transfer_request_premium.xml", UserPrivileges.SUPERUSER);
|
||||
}
|
||||
|
||||
private void runWrongCurrencyTest(Map<String, String> substitutions) throws Exception {
|
||||
private void runWrongCurrencyTest(Map<String, String> substitutions) {
|
||||
setupDomain("example", "tld");
|
||||
persistResource(
|
||||
Registry.get("tld")
|
||||
|
@ -1111,25 +1110,25 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongCurrency_v06() throws Exception {
|
||||
public void testFailure_wrongCurrency_v06() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongCurrencyTest(FEE_06_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongCurrency_v11() throws Exception {
|
||||
public void testFailure_wrongCurrency_v11() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongCurrencyTest(FEE_11_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongCurrency_v12() throws Exception {
|
||||
public void testFailure_wrongCurrency_v12() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongCurrencyTest(FEE_12_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_feeGivenInWrongScale_v06() throws Exception {
|
||||
public void testFailure_feeGivenInWrongScale_v06() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1139,7 +1138,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_feeGivenInWrongScale_v11() throws Exception {
|
||||
public void testFailure_feeGivenInWrongScale_v11() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1149,7 +1148,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_feeGivenInWrongScale_v12() throws Exception {
|
||||
public void testFailure_feeGivenInWrongScale_v12() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1172,25 +1171,25 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongFeeAmount_v06() throws Exception {
|
||||
public void testFailure_wrongFeeAmount_v06() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongFeeAmountTest(FEE_06_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongFeeAmount_v11() throws Exception {
|
||||
public void testFailure_wrongFeeAmount_v11() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongFeeAmountTest(FEE_11_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_wrongFeeAmount_v12() throws Exception {
|
||||
public void testFailure_wrongFeeAmount_v12() {
|
||||
setupDomain("example", "tld");
|
||||
runWrongFeeAmountTest(FEE_12_MAP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_premiumBlocked() throws Exception {
|
||||
public void testFailure_premiumBlocked() {
|
||||
setupDomain("rich", "example");
|
||||
// Modify the Registrar to block premium names.
|
||||
persistResource(loadRegistrar("NewRegistrar").asBuilder().setBlockPremiumNames(true).build());
|
||||
|
@ -1202,7 +1201,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_registryRequiresAcking_feeNotProvidedOnPremiumName() throws Exception {
|
||||
public void testFailure_registryRequiresAcking_feeNotProvidedOnPremiumName() {
|
||||
setupDomain("rich", "example");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1212,7 +1211,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_registrarRequiresAcking_feeNotProvidedOnPremiumName() throws Exception {
|
||||
public void testFailure_registrarRequiresAcking_feeNotProvidedOnPremiumName() {
|
||||
setupDomain("rich", "example");
|
||||
persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(false).build());
|
||||
persistResource(
|
||||
|
@ -1226,7 +1225,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_noAuthInfo() throws Exception {
|
||||
public void testFailure_noAuthInfo() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1236,7 +1235,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badContactPassword() throws Exception {
|
||||
public void testFailure_badContactPassword() {
|
||||
setupDomain("example", "tld");
|
||||
// Change the contact's password so it does not match the password in the file.
|
||||
contact =
|
||||
|
@ -1253,7 +1252,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badContactRepoId() throws Exception {
|
||||
public void testFailure_badContactRepoId() {
|
||||
setupDomain("example", "tld");
|
||||
// Set the contact to a different ROID, but don't persist it; this is just so the substitution
|
||||
// code above will write the wrong ROID into the file.
|
||||
|
@ -1301,7 +1300,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_pending() throws Exception {
|
||||
public void testFailure_pending() {
|
||||
setupDomain("example", "tld");
|
||||
domain =
|
||||
persistResource(
|
||||
|
@ -1323,7 +1322,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badDomainPassword() throws Exception {
|
||||
public void testFailure_badDomainPassword() {
|
||||
setupDomain("example", "tld");
|
||||
// Change the domain's password so it does not match the password in the file.
|
||||
domain =
|
||||
|
@ -1340,7 +1339,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_sponsoringClient() throws Exception {
|
||||
public void testFailure_sponsoringClient() {
|
||||
setupDomain("example", "tld");
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
EppException thrown =
|
||||
|
@ -1389,7 +1388,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_periodInMonths() throws Exception {
|
||||
public void testFailure_periodInMonths() {
|
||||
setupDomain("example", "tld");
|
||||
EppException thrown =
|
||||
assertThrows(
|
||||
|
@ -1399,7 +1398,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_clientTransferProhibited() throws Exception {
|
||||
public void testFailure_clientTransferProhibited() {
|
||||
setupDomain("example", "tld");
|
||||
domain =
|
||||
persistResource(
|
||||
|
@ -1412,7 +1411,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_serverTransferProhibited() throws Exception {
|
||||
public void testFailure_serverTransferProhibited() {
|
||||
setupDomain("example", "tld");
|
||||
domain =
|
||||
persistResource(
|
||||
|
@ -1425,7 +1424,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_pendingDelete() throws Exception {
|
||||
public void testFailure_pendingDelete() {
|
||||
setupDomain("example", "tld");
|
||||
domain = persistResource(domain.asBuilder().addStatusValue(StatusValue.PENDING_DELETE).build());
|
||||
ResourceStatusProhibitsOperationException thrown =
|
||||
|
|
|
@ -255,32 +255,32 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badCharacter() throws Exception {
|
||||
public void testFailure_badCharacter() {
|
||||
doFailingHostNameTest("foo bar", InvalidHostNameException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooShallowPublicSuffix() throws Exception {
|
||||
public void testFailure_tooShallowPublicSuffix() {
|
||||
doFailingHostNameTest("example.tld", HostNameTooShallowException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooShallowCcTld() throws Exception {
|
||||
public void testFailure_tooShallowCcTld() {
|
||||
doFailingHostNameTest("foo.co.uk", HostNameTooShallowException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_barePublicSuffix() throws Exception {
|
||||
public void testFailure_barePublicSuffix() {
|
||||
doFailingHostNameTest("com", HostNameTooShallowException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_bareCcTld() throws Exception {
|
||||
public void testFailure_bareCcTld() {
|
||||
doFailingHostNameTest("co.uk", HostNameTooShallowException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooShallowNewTld() throws Exception {
|
||||
public void testFailure_tooShallowNewTld() {
|
||||
doFailingHostNameTest("example.lol", HostNameTooShallowException.class);
|
||||
}
|
||||
|
||||
|
|
|
@ -129,19 +129,19 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_existedButWasClientDeleteProhibited() throws Exception {
|
||||
public void testFailure_existedButWasClientDeleteProhibited() {
|
||||
doFailingStatusTest(
|
||||
StatusValue.CLIENT_DELETE_PROHIBITED, ResourceStatusProhibitsOperationException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_existedButWasServerDeleteProhibited() throws Exception {
|
||||
public void testFailure_existedButWasServerDeleteProhibited() {
|
||||
doFailingStatusTest(
|
||||
StatusValue.SERVER_DELETE_PROHIBITED, ResourceStatusProhibitsOperationException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_existedButWasPendingDelete() throws Exception {
|
||||
public void testFailure_existedButWasPendingDelete() {
|
||||
doFailingStatusTest(
|
||||
StatusValue.PENDING_DELETE, ResourceStatusProhibitsOperationException.class);
|
||||
}
|
||||
|
|
|
@ -87,50 +87,50 @@ public abstract class LoginFlowTestCase extends FlowTestCase<LoginFlow> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidVersion() throws Exception {
|
||||
public void testFailure_invalidVersion() {
|
||||
doFailingTest("login_invalid_version.xml", UnimplementedProtocolVersionException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidLanguage() throws Exception {
|
||||
public void testFailure_invalidLanguage() {
|
||||
doFailingTest("login_invalid_language.xml", UnsupportedLanguageException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidExtension() throws Exception {
|
||||
public void testFailure_invalidExtension() {
|
||||
doFailingTest("login_invalid_extension.xml", UnimplementedExtensionException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidTypes() throws Exception {
|
||||
public void testFailure_invalidTypes() {
|
||||
doFailingTest("login_invalid_types.xml", UnimplementedObjectServiceException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_newPassword() throws Exception {
|
||||
public void testFailure_newPassword() {
|
||||
doFailingTest("login_invalid_newpw.xml", PasswordChangesNotSupportedException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unknownRegistrar() throws Exception {
|
||||
public void testFailure_unknownRegistrar() {
|
||||
deleteResource(getRegistrarBuilder().build());
|
||||
doFailingTest("login_valid.xml", BadRegistrarClientIdException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_pendingRegistrar() throws Exception {
|
||||
public void testFailure_pendingRegistrar() {
|
||||
persistResource(getRegistrarBuilder().setState(State.PENDING).build());
|
||||
doFailingTest("login_valid.xml", RegistrarAccountNotActiveException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_incorrectPassword() throws Exception {
|
||||
public void testFailure_incorrectPassword() {
|
||||
persistResource(getRegistrarBuilder().setPassword("diff password").build());
|
||||
doFailingTest("login_valid.xml", BadRegistrarPasswordException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooManyFailedLogins() throws Exception {
|
||||
public void testFailure_tooManyFailedLogins() {
|
||||
persistResource(getRegistrarBuilder().setPassword("diff password").build());
|
||||
doFailingTest("login_valid.xml", BadRegistrarPasswordException.class);
|
||||
doFailingTest("login_valid.xml", BadRegistrarPasswordException.class);
|
||||
|
@ -139,7 +139,7 @@ public abstract class LoginFlowTestCase extends FlowTestCase<LoginFlow> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_alreadyLoggedIn() throws Exception {
|
||||
public void testFailure_alreadyLoggedIn() {
|
||||
sessionMetadata.setClientId("something");
|
||||
doFailingTest("login_valid.xml", AlreadyLoggedInException.class);
|
||||
}
|
||||
|
|
|
@ -44,27 +44,27 @@ public class LoginFlowViaConsoleTest extends LoginFlowTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_withoutLoginAndLinkedAccount() throws Exception {
|
||||
public void testFailure_withoutLoginAndLinkedAccount() {
|
||||
persistLinkedAccount("person@example.com", GAE_USER_ID1);
|
||||
credentials = GaeUserCredentials.forLoggedOutUser();
|
||||
doFailingTest("login_valid.xml", UserNotLoggedInException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_withoutLoginAndWithoutLinkedAccount() throws Exception {
|
||||
public void testFailure_withoutLoginAndWithoutLinkedAccount() {
|
||||
credentials = GaeUserCredentials.forLoggedOutUser();
|
||||
doFailingTest("login_valid.xml", UserNotLoggedInException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_withLoginAndWithoutLinkedAccount() throws Exception {
|
||||
public void testFailure_withLoginAndWithoutLinkedAccount() {
|
||||
credentials =
|
||||
GaeUserCredentials.forTestingUser(new User("person", "example.com", GAE_USER_ID1), false);
|
||||
doFailingTest("login_valid.xml", BadGaeUserIdException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_withLoginAndNoMatchingLinkedAccount() throws Exception {
|
||||
public void testFailure_withLoginAndNoMatchingLinkedAccount() {
|
||||
persistLinkedAccount("joe@example.com", GAE_USER_ID2);
|
||||
credentials =
|
||||
GaeUserCredentials.forTestingUser(new User("person", "example.com", GAE_USER_ID1), false);
|
||||
|
|
|
@ -88,28 +88,28 @@ public class LoginFlowViaTlsTest extends LoginFlowTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_incorrectClientCertificateHash() throws Exception {
|
||||
public void testFailure_incorrectClientCertificateHash() {
|
||||
persistResource(getRegistrarBuilder().build());
|
||||
credentials = new TlsCredentials(BAD_CERT, GOOD_IP, "goo.example");
|
||||
doFailingTest("login_valid.xml", BadRegistrarCertificateException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingClientCertificateHash() throws Exception {
|
||||
public void testFailure_missingClientCertificateHash() {
|
||||
persistResource(getRegistrarBuilder().build());
|
||||
credentials = new TlsCredentials(null, GOOD_IP, "goo.example");
|
||||
doFailingTest("login_valid.xml", MissingRegistrarCertificateException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_noSniAndCertRequired() throws Exception {
|
||||
public void testFailure_noSniAndCertRequired() {
|
||||
persistResource(getRegistrarBuilder().build());
|
||||
credentials = new TlsCredentials(null, GOOD_IP, null);
|
||||
doFailingTest("login_valid.xml", NoSniException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingClientIpAddress() throws Exception {
|
||||
public void testFailure_missingClientIpAddress() {
|
||||
persistResource(
|
||||
getRegistrarBuilder()
|
||||
.setIpAddressWhitelist(ImmutableList.of(
|
||||
|
@ -121,7 +121,7 @@ public class LoginFlowViaTlsTest extends LoginFlowTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_incorrectClientIpv4Address() throws Exception {
|
||||
public void testFailure_incorrectClientIpv4Address() {
|
||||
persistResource(
|
||||
getRegistrarBuilder()
|
||||
.setIpAddressWhitelist(ImmutableList.of(
|
||||
|
@ -133,7 +133,7 @@ public class LoginFlowViaTlsTest extends LoginFlowTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_incorrectClientIpv6Address() throws Exception {
|
||||
public void testFailure_incorrectClientIpv6Address() {
|
||||
persistResource(
|
||||
getRegistrarBuilder()
|
||||
.setIpAddressWhitelist(ImmutableList.of(
|
||||
|
|
|
@ -24,7 +24,6 @@ import google.registry.model.server.KmsSecretRevision;
|
|||
import google.registry.model.server.KmsSecretRevision.Builder;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.BouncyCastleProviderRule;
|
||||
import java.io.IOException;
|
||||
import org.bouncycastle.openpgp.PGPKeyPair;
|
||||
import org.bouncycastle.openpgp.PGPPrivateKey;
|
||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||
|
@ -112,7 +111,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getRdeSshClientPublicKey() throws Exception {
|
||||
public void test_getRdeSshClientPublicKey() {
|
||||
saveCleartextSecret("rde-ssh-client-public-string");
|
||||
|
||||
String rdeSshClientPublicKey = keyring.getRdeSshClientPublicKey();
|
||||
|
@ -121,7 +120,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getRdeSshClientPrivateKey() throws Exception {
|
||||
public void test_getRdeSshClientPrivateKey() {
|
||||
saveCleartextSecret("rde-ssh-client-private-string");
|
||||
|
||||
String rdeSshClientPrivateKey = keyring.getRdeSshClientPrivateKey();
|
||||
|
@ -130,7 +129,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getIcannReportingPassword() throws Exception {
|
||||
public void test_getIcannReportingPassword() {
|
||||
saveCleartextSecret("icann-reporting-password-string");
|
||||
|
||||
String icannReportingPassword = keyring.getIcannReportingPassword();
|
||||
|
@ -139,7 +138,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getMarksdbDnlLogin() throws Exception {
|
||||
public void test_getMarksdbDnlLogin() {
|
||||
saveCleartextSecret("marksdb-dnl-login-string");
|
||||
|
||||
String marksdbDnlLogin = keyring.getMarksdbDnlLogin();
|
||||
|
@ -148,7 +147,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getMarksdbLordnPassword() throws Exception {
|
||||
public void test_getMarksdbLordnPassword() {
|
||||
saveCleartextSecret("marksdb-lordn-password-string");
|
||||
|
||||
String marksdbLordnPassword = keyring.getMarksdbLordnPassword();
|
||||
|
@ -157,7 +156,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getMarksdbSmdrlLogin() throws Exception {
|
||||
public void test_getMarksdbSmdrlLogin() {
|
||||
saveCleartextSecret("marksdb-smdrl-login-string");
|
||||
|
||||
String marksdbSmdrlLogin = keyring.getMarksdbSmdrlLogin();
|
||||
|
@ -167,7 +166,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getJsonCredential() throws Exception {
|
||||
public void test_getJsonCredential() {
|
||||
saveCleartextSecret("json-credential-string");
|
||||
|
||||
String jsonCredential = keyring.getJsonCredential();
|
||||
|
@ -176,7 +175,7 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getBraintreePrivateKey() throws Exception {
|
||||
public void test_getBraintreePrivateKey() {
|
||||
saveCleartextSecret("braintree-private-key-string");
|
||||
|
||||
String braintreePrivateKey = keyring.getBraintreePrivateKey();
|
||||
|
@ -184,7 +183,7 @@ public class KmsKeyringTest {
|
|||
assertThat(braintreePrivateKey).isEqualTo("braintree-private-key-stringmoo");
|
||||
}
|
||||
|
||||
private static void persistSecret(String secretName, byte[] secretValue) throws IOException {
|
||||
private static void persistSecret(String secretName, byte[] secretValue) {
|
||||
KmsConnection kmsConnection = new FakeKmsConnection();
|
||||
|
||||
KmsSecretRevision secretRevision =
|
||||
|
@ -197,7 +196,7 @@ public class KmsKeyringTest {
|
|||
persistResources(ImmutableList.of(secretRevision, secret));
|
||||
}
|
||||
|
||||
private static void saveCleartextSecret(String secretName) throws Exception {
|
||||
private static void saveCleartextSecret(String secretName) {
|
||||
persistSecret(secretName, KeySerializer.serializeString(secretName + "moo"));
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setMultipleSecrets() throws Exception {
|
||||
public void test_setMultipleSecrets() {
|
||||
updater
|
||||
.setBraintreePrivateKey("value1")
|
||||
.setIcannReportingPassword("value2")
|
||||
|
@ -68,7 +68,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setBraintreePrivateKey() throws Exception {
|
||||
public void test_setBraintreePrivateKey() {
|
||||
updater.setBraintreePrivateKey("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -102,7 +102,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setIcannReportingPassword() throws Exception {
|
||||
public void test_setIcannReportingPassword() {
|
||||
updater.setIcannReportingPassword("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -112,7 +112,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setJsonCredential() throws Exception {
|
||||
public void test_setJsonCredential() {
|
||||
updater.setJsonCredential("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -120,7 +120,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setMarksdbDnlLogin() throws Exception {
|
||||
public void test_setMarksdbDnlLogin() {
|
||||
updater.setMarksdbDnlLogin("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -128,7 +128,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setMarksdbLordnPassword() throws Exception {
|
||||
public void test_setMarksdbLordnPassword() {
|
||||
updater.setMarksdbLordnPassword("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -138,7 +138,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setMarksdbSmdrlLogin() throws Exception {
|
||||
public void test_setMarksdbSmdrlLogin() {
|
||||
updater.setMarksdbSmdrlLogin("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -171,7 +171,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setRdeSshClientPrivateKey() throws Exception {
|
||||
public void test_setRdeSshClientPrivateKey() {
|
||||
updater.setRdeSshClientPrivateKey("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -181,7 +181,7 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setRdeSshClientPublicKey() throws Exception {
|
||||
public void test_setRdeSshClientPublicKey() {
|
||||
updater.setRdeSshClientPublicKey("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
|
@ -215,11 +215,11 @@ public class KmsUpdaterTest {
|
|||
assertThat(secretRevision.getEncryptedValue()).isEqualTo(expectedEncryptedValue);
|
||||
}
|
||||
|
||||
private static String getCiphertext(byte[] plaintext) throws IOException {
|
||||
private static String getCiphertext(byte[] plaintext) {
|
||||
return new FakeKmsConnection().encrypt("blah", plaintext).ciphertext();
|
||||
}
|
||||
|
||||
private static String getCiphertext(String plaintext) throws IOException {
|
||||
private static String getCiphertext(String plaintext) {
|
||||
return getCiphertext(KeySerializer.serializeString(plaintext));
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ public class TimedTransitionPropertyTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_getValueAtTime() throws Exception {
|
||||
public void testSuccess_getValueAtTime() {
|
||||
testGetValueAtTime(timedString);
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ public class TimedTransitionPropertyTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_simulatedLoad() throws Exception {
|
||||
public void testSuccess_simulatedLoad() {
|
||||
// Just for testing, don't extract transitions from a TimedTransitionProperty in real code.
|
||||
Set<Map.Entry<DateTime, StringTimedTransition>> transitions = timedString.entrySet();
|
||||
timedString = forMapify("0", StringTimedTransition.class);
|
||||
|
|
|
@ -82,7 +82,7 @@ public class OfyFilterTest {
|
|||
|
||||
/** The filter should register all types for us. */
|
||||
@Test
|
||||
public void testKeyCreateAfterFilter() throws Exception {
|
||||
public void testKeyCreateAfterFilter() {
|
||||
new OfyFilter().init(null);
|
||||
ContactResource contact = newContactResource("contact1234");
|
||||
Key.create(contact);
|
||||
|
|
|
@ -117,7 +117,7 @@ public class PremiumListUtilsTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSave_largeNumberOfEntries_succeeds() throws Exception {
|
||||
public void testSave_largeNumberOfEntries_succeeds() {
|
||||
PremiumList premiumList = persistHumongousPremiumList("tld", 2500);
|
||||
assertThat(loadPremiumListEntries(premiumList)).hasSize(2500);
|
||||
assertThat(getPremiumPrice("7", Registry.get("tld"))).hasValue(Money.parse("USD 100"));
|
||||
|
@ -258,7 +258,7 @@ public class PremiumListUtilsTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testGetPremiumPrice_allLabelsAreNonPremium_whenNotInList() throws Exception {
|
||||
public void testGetPremiumPrice_allLabelsAreNonPremium_whenNotInList() {
|
||||
assertThat(getPremiumPrice("blah", Registry.get("tld"))).isEmpty();
|
||||
assertThat(getPremiumPrice("slinge", Registry.get("tld"))).isEmpty();
|
||||
assertMetricOutcomeCount(2, BLOOM_FILTER_NEGATIVE);
|
||||
|
|
|
@ -67,7 +67,7 @@ public class BigQueryMetricsEnqueuerTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testExport() throws Exception {
|
||||
public void testExport() {
|
||||
TestMetric metric =
|
||||
TestMetric.create(
|
||||
DateTime.parse("1984-12-18TZ"), DateTime.parse("1984-12-18TZ").plusMillis(1));
|
||||
|
|
|
@ -187,14 +187,14 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRun_noTlds_returns204() throws Exception {
|
||||
public void testRun_noTlds_returns204() {
|
||||
action.run();
|
||||
assertThat(response.getStatus()).isEqualTo(204);
|
||||
assertNoTasksEnqueued("mapreduce");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun_tldWithoutEscrowEnabled_returns204() throws Exception {
|
||||
public void testRun_tldWithoutEscrowEnabled_returns204() {
|
||||
createTld("lol");
|
||||
persistResource(Registry.get("lol").asBuilder().setEscrowEnabled(false).build());
|
||||
clock.setTo(DateTime.parse("2000-01-01TZ"));
|
||||
|
@ -204,7 +204,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRun_tldWithEscrowEnabled_runsMapReduce() throws Exception {
|
||||
public void testRun_tldWithEscrowEnabled_runsMapReduce() {
|
||||
createTldWithEscrowEnabled("lol");
|
||||
clock.setTo(DateTime.parse("2000-01-01TZ"));
|
||||
action.run();
|
||||
|
@ -214,7 +214,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRun_withinTransactionCooldown_getsExcludedAndReturns204() throws Exception {
|
||||
public void testRun_withinTransactionCooldown_getsExcludedAndReturns204() {
|
||||
createTldWithEscrowEnabled("lol");
|
||||
clock.setTo(DateTime.parse("2000-01-01T00:04:59Z"));
|
||||
action.transactionCooldown = Duration.standardMinutes(5);
|
||||
|
@ -224,7 +224,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRun_afterTransactionCooldown_runsMapReduce() throws Exception {
|
||||
public void testRun_afterTransactionCooldown_runsMapReduce() {
|
||||
createTldWithEscrowEnabled("lol");
|
||||
clock.setTo(DateTime.parse("2000-01-01T00:05:00Z"));
|
||||
action.transactionCooldown = Duration.standardMinutes(5);
|
||||
|
@ -306,7 +306,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testManualRun_validParameters_runsMapReduce() throws Exception {
|
||||
public void testManualRun_validParameters_runsMapReduce() {
|
||||
createTldWithEscrowEnabled("lol");
|
||||
clock.setTo(DateTime.parse("2000-01-01TZ"));
|
||||
action.manual = true;
|
||||
|
|
|
@ -264,7 +264,7 @@ public class RdeUploadActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRun() throws Exception {
|
||||
public void testRun() {
|
||||
createTld("lol");
|
||||
RdeUploadAction action = createAction(null);
|
||||
action.tld = "lol";
|
||||
|
|
|
@ -213,7 +213,7 @@ public class RdeContactInputTest {
|
|||
Optional<Integer> numberOfShards,
|
||||
int whichReader,
|
||||
int expectedOffset,
|
||||
int expectedMaxResults) throws Exception {
|
||||
int expectedMaxResults) {
|
||||
RdeContactInput input = getInput(numberOfShards);
|
||||
List<?> readers = input.createReaders();
|
||||
RdeContactReader reader = (RdeContactReader) readers.get(whichReader);
|
||||
|
@ -238,7 +238,7 @@ public class RdeContactInputTest {
|
|||
* @param expectedNumberOfReaders Expected size of the list returned
|
||||
*/
|
||||
private void assertNumberOfReaders(Optional<Integer> numberOfShards,
|
||||
int expectedNumberOfReaders) throws Exception {
|
||||
int expectedNumberOfReaders) {
|
||||
RdeContactInput input = getInput(numberOfShards);
|
||||
List<?> readers = input.createReaders();
|
||||
assertThat(readers).hasSize(expectedNumberOfReaders);
|
||||
|
|
|
@ -220,8 +220,10 @@ public class RdeHostInputTest {
|
|||
* @param expectedMaxResults Expected maxResults of the reader
|
||||
*/
|
||||
private void assertReaderConfigurations(
|
||||
Optional<Integer> numberOfShards, int whichReader, int expectedOffset, int expectedMaxResults)
|
||||
throws Exception {
|
||||
Optional<Integer> numberOfShards,
|
||||
int whichReader,
|
||||
int expectedOffset,
|
||||
int expectedMaxResults) {
|
||||
RdeHostInput input = getInput(numberOfShards);
|
||||
List<?> readers = input.createReaders();
|
||||
RdeHostReader reader = (RdeHostReader) readers.get(whichReader);
|
||||
|
@ -245,8 +247,8 @@ public class RdeHostInputTest {
|
|||
* @param numberOfShards Number of desired shards ({@link Optional#empty} uses default of 50)
|
||||
* @param expectedNumberOfReaders Expected size of the list returned
|
||||
*/
|
||||
private void assertNumberOfReaders(Optional<Integer> numberOfShards, int expectedNumberOfReaders)
|
||||
throws Exception {
|
||||
private void assertNumberOfReaders(
|
||||
Optional<Integer> numberOfShards, int expectedNumberOfReaders) {
|
||||
RdeHostInput input = getInput(numberOfShards);
|
||||
List<?> readers = input.createReaders();
|
||||
assertThat(readers).hasSize(expectedNumberOfReaders);
|
||||
|
|
|
@ -76,7 +76,7 @@ public class PublishInvoicesActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testJobDone_enqueuesCopyAction_emailsResults() throws Exception {
|
||||
public void testJobDone_enqueuesCopyAction_emailsResults() {
|
||||
expectedJob.setCurrentState("JOB_STATE_DONE");
|
||||
uploadAction.run();
|
||||
assertThat(response.getStatus()).isEqualTo(SC_OK);
|
||||
|
|
|
@ -18,7 +18,6 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.io.IOException;
|
||||
import org.joda.time.YearMonth;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -36,7 +35,7 @@ public class ActivityReportingQueryBuilderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testAggregateQueryMatch() throws IOException {
|
||||
public void testAggregateQueryMatch() {
|
||||
ActivityReportingQueryBuilder queryBuilder = getQueryBuilder();
|
||||
assertThat(queryBuilder.getReportQuery())
|
||||
.isEqualTo(
|
||||
|
@ -45,7 +44,7 @@ public class ActivityReportingQueryBuilderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testIntermediaryQueryMatch() throws IOException {
|
||||
public void testIntermediaryQueryMatch() {
|
||||
ImmutableList<String> expectedQueryNames =
|
||||
ImmutableList.of(
|
||||
ActivityReportingQueryBuilder.REGISTRAR_OPERATING_STATUS,
|
||||
|
|
|
@ -60,7 +60,7 @@ public class IcannReportingStagingActionTest {
|
|||
when(stager.stageReports(ReportType.TRANSACTIONS)).thenReturn(ImmutableList.of("c", "d"));
|
||||
}
|
||||
|
||||
private static void assertUploadTaskEnqueued(String subDir) throws Exception {
|
||||
private static void assertUploadTaskEnqueued(String subDir) {
|
||||
TaskMatcher matcher =
|
||||
new TaskMatcher()
|
||||
.url("/_dr/task/icannReportingUpload")
|
||||
|
|
|
@ -18,7 +18,6 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.io.IOException;
|
||||
import org.joda.time.YearMonth;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -36,7 +35,7 @@ public class TransactionsReportingQueryBuilderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testAggregateQueryMatch() throws IOException {
|
||||
public void testAggregateQueryMatch() {
|
||||
TransactionsReportingQueryBuilder queryBuilder = getQueryBuilder();
|
||||
assertThat(queryBuilder.getReportQuery())
|
||||
.isEqualTo(
|
||||
|
@ -45,7 +44,7 @@ public class TransactionsReportingQueryBuilderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testIntermediaryQueryMatch() throws IOException {
|
||||
public void testIntermediaryQueryMatch() {
|
||||
ImmutableList<String> expectedQueryNames =
|
||||
ImmutableList.of(
|
||||
TransactionsReportingQueryBuilder.TRANSACTIONS_REPORT_AGGREGATION,
|
||||
|
|
|
@ -202,14 +202,12 @@ public class TaskQueueHelper {
|
|||
}
|
||||
|
||||
/** Ensures that the tasks in the named queue are exactly those with the expected names. */
|
||||
public static void assertTasksEnqueued(String queueName, String... expectedTaskNames)
|
||||
throws Exception {
|
||||
public static void assertTasksEnqueued(String queueName, String... expectedTaskNames) {
|
||||
Function<TaskStateInfo, String> nameGetter = TaskStateInfo::getTaskName;
|
||||
assertTasksEnqueuedWithProperty(queueName, nameGetter, expectedTaskNames);
|
||||
}
|
||||
|
||||
public static void assertTasksEnqueued(String queueName, Iterable<TaskStateInfo> taskStateInfos)
|
||||
throws Exception {
|
||||
public static void assertTasksEnqueued(String queueName, Iterable<TaskStateInfo> taskStateInfos) {
|
||||
ImmutableList.Builder<TaskMatcher> taskMatchers = new ImmutableList.Builder<>();
|
||||
for (TaskStateInfo taskStateInfo : taskStateInfos) {
|
||||
taskMatchers.add(new TaskMatcher(taskStateInfo));
|
||||
|
@ -221,8 +219,7 @@ public class TaskQueueHelper {
|
|||
* Ensures that the only tasks in the named queue are exactly those that match the expected
|
||||
* matchers.
|
||||
*/
|
||||
public static void assertTasksEnqueued(String queueName, TaskMatcher... taskMatchers)
|
||||
throws Exception {
|
||||
public static void assertTasksEnqueued(String queueName, TaskMatcher... taskMatchers) {
|
||||
assertTasksEnqueued(queueName, Arrays.asList(taskMatchers));
|
||||
}
|
||||
|
||||
|
@ -290,7 +287,7 @@ public class TaskQueueHelper {
|
|||
}
|
||||
|
||||
/** Ensures that the DNS queue tasks are exactly those for the expected target names. */
|
||||
public static void assertDnsTasksEnqueued(String... expectedTaskTargetNames) throws Exception {
|
||||
public static void assertDnsTasksEnqueued(String... expectedTaskTargetNames) {
|
||||
assertTasksEnqueuedWithProperty(
|
||||
DnsConstants.DNS_PULL_QUEUE_NAME,
|
||||
taskStateInfo -> getParamFromTaskInfo(taskStateInfo, DnsConstants.DNS_TARGET_NAME_PARAM),
|
||||
|
@ -298,7 +295,7 @@ public class TaskQueueHelper {
|
|||
}
|
||||
|
||||
/** Ensures that the DNS queue does not contain any tasks. */
|
||||
public static void assertNoDnsTasksEnqueued() throws Exception {
|
||||
public static void assertNoDnsTasksEnqueued() {
|
||||
assertNoTasksEnqueued(DnsConstants.DNS_PULL_QUEUE_NAME);
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ public class LordnTaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_enqueueDomainResourceTask_sunrise() throws Exception {
|
||||
public void test_enqueueDomainResourceTask_sunrise() {
|
||||
DomainResource domain = newDomainBuilder(DateTime.parse("2010-05-01T10:11:12Z"))
|
||||
.setRepoId("A-EXAMPLE")
|
||||
.build();
|
||||
|
@ -120,7 +120,7 @@ public class LordnTaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_enqueueDomainResourceTask_claims() throws Exception {
|
||||
public void test_enqueueDomainResourceTask_claims() {
|
||||
DateTime time = DateTime.parse("2010-05-01T10:11:12Z");
|
||||
DomainResource domain = newDomainBuilder(time)
|
||||
.setRepoId("11-EXAMPLE")
|
||||
|
@ -134,7 +134,7 @@ public class LordnTaskTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_oteRegistrarWithNullIanaId() throws Exception {
|
||||
public void test_oteRegistrarWithNullIanaId() {
|
||||
ofy()
|
||||
.transact(
|
||||
() ->
|
||||
|
|
|
@ -165,7 +165,7 @@ public class NordnUploadActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRun_claimsMode_verifyTaskGetsEnqueuedWithClaimsCsv() throws Exception {
|
||||
public void testRun_claimsMode_verifyTaskGetsEnqueuedWithClaimsCsv() {
|
||||
persistClaimsModeDomain();
|
||||
action.run();
|
||||
assertTasksEnqueued(NordnVerifyAction.QUEUE, new TaskMatcher()
|
||||
|
@ -182,7 +182,7 @@ public class NordnUploadActionTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRun_sunriseMode_verifyTaskGetsEnqueuedWithSunriseCsv() throws Exception {
|
||||
public void testRun_sunriseMode_verifyTaskGetsEnqueuedWithSunriseCsv() {
|
||||
persistSunriseModeDomain();
|
||||
action.run();
|
||||
assertTasksEnqueued(NordnVerifyAction.QUEUE, new TaskMatcher()
|
||||
|
|
|
@ -109,7 +109,7 @@ public class CreateReservedListCommandTest extends
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNamingRules_tldThatDoesNotExist_failsWithoutOverride() throws Exception {
|
||||
public void testNamingRules_tldThatDoesNotExist_failsWithoutOverride() {
|
||||
runNameTestExpectedFailure("footld_reserved-list", "TLD footld does not exist");
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ public class CreateReservedListCommandTest extends
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNamingRules_underscoreIsMissing_failsWithoutOverride() throws Exception {
|
||||
public void testNamingRules_underscoreIsMissing_failsWithoutOverride() {
|
||||
runNameTestExpectedFailure("random-reserved-list", INVALID_FORMAT_ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ public class CreateReservedListCommandTest extends
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNamingRules_secondHalfOfNameIsMissing_failsWithoutOverride() throws Exception {
|
||||
public void testNamingRules_secondHalfOfNameIsMissing_failsWithoutOverride() {
|
||||
runNameTestExpectedFailure("soy_", INVALID_FORMAT_ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class CreateReservedListCommandTest extends
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNamingRules_onlyTldIsSpecifiedAsName_failsWithoutOverride() throws Exception {
|
||||
public void testNamingRules_onlyTldIsSpecifiedAsName_failsWithoutOverride() {
|
||||
runNameTestExpectedFailure("soy", INVALID_FORMAT_ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ public class CreateReservedListCommandTest extends
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNamingRules_commonAsListName_failsWithoutOverride() throws Exception {
|
||||
public void testNamingRules_commonAsListName_failsWithoutOverride() {
|
||||
runNameTestExpectedFailure("invalidtld_common", "TLD invalidtld does not exist");
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ public class CreateReservedListCommandTest extends
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNamingRules_too_many_underscores_failsWithoutOverride() throws Exception {
|
||||
public void testNamingRules_too_many_underscores_failsWithoutOverride() {
|
||||
runNameTestExpectedFailure("soy_buffalo_buffalo_buffalo", INVALID_FORMAT_ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ public class CreateReservedListCommandTest extends
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testNamingRules_withWeirdCharacters_failsWithoutOverride() throws Exception {
|
||||
public void testNamingRules_withWeirdCharacters_failsWithoutOverride() {
|
||||
runNameTestExpectedFailure("soy_$oy", INVALID_FORMAT_ERROR_MESSAGE);
|
||||
}
|
||||
|
||||
|
|
|
@ -514,7 +514,7 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_setReservedListFromOtherTld() throws Exception {
|
||||
public void testFailure_setReservedListFromOtherTld() {
|
||||
runFailureReservedListsTest(
|
||||
"tld_banned",
|
||||
IllegalArgumentException.class,
|
||||
|
@ -527,7 +527,7 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_setCommonAndReservedListFromOtherTld() throws Exception {
|
||||
public void testFailure_setCommonAndReservedListFromOtherTld() {
|
||||
runFailureReservedListsTest(
|
||||
"common_abuse,tld_banned",
|
||||
IllegalArgumentException.class,
|
||||
|
@ -547,7 +547,7 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_setMultipleReservedListsFromOtherTld() throws Exception {
|
||||
public void testFailure_setMultipleReservedListsFromOtherTld() {
|
||||
runFailureReservedListsTest(
|
||||
"tld_banned,soy_expurgated",
|
||||
IllegalArgumentException.class,
|
||||
|
@ -560,7 +560,7 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_setNonExistentReservedLists() throws Exception {
|
||||
public void testFailure_setNonExistentReservedLists() {
|
||||
runFailureReservedListsTest(
|
||||
"xn--q9jyb4c_asdf,common_asdsdgh",
|
||||
IllegalArgumentException.class,
|
||||
|
|
|
@ -940,7 +940,7 @@ public class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_setReservedListFromOtherTld() throws Exception {
|
||||
public void testFailure_setReservedListFromOtherTld() {
|
||||
runFailureReservedListsTest("tld_banned",
|
||||
IllegalArgumentException.class,
|
||||
"The reserved list(s) tld_banned cannot be applied to the tld xn--q9jyb4c");
|
||||
|
@ -952,7 +952,7 @@ public class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_setCommonAndReservedListFromOtherTld() throws Exception {
|
||||
public void testFailure_setCommonAndReservedListFromOtherTld() {
|
||||
runFailureReservedListsTest("common_abuse,tld_banned",
|
||||
IllegalArgumentException.class,
|
||||
"The reserved list(s) tld_banned cannot be applied to the tld xn--q9jyb4c");
|
||||
|
@ -971,7 +971,7 @@ public class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_setMultipleReservedListsFromOtherTld() throws Exception {
|
||||
public void testFailure_setMultipleReservedListsFromOtherTld() {
|
||||
runFailureReservedListsTest("tld_banned,soy_expurgated",
|
||||
IllegalArgumentException.class,
|
||||
"The reserved list(s) tld_banned, soy_expurgated cannot be applied to the tld xn--q9jyb4c");
|
||||
|
|
|
@ -70,7 +70,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_updateRegistrarInfo_duplicateContacts() throws Exception {
|
||||
public void testFailure_updateRegistrarInfo_duplicateContacts() {
|
||||
Map<String, Object> response = action.handleJsonRequest(
|
||||
readJsonFromFile("update_registrar_duplicate_contacts.json", getLastUpdateTime()));
|
||||
assertThat(response).containsExactly(
|
||||
|
@ -82,7 +82,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testRead_notAuthorized_failure() throws Exception {
|
||||
public void testRead_notAuthorized_failure() {
|
||||
when(sessionUtils.getRegistrarForAuthResult(
|
||||
any(HttpServletRequest.class), any(AuthResult.class)))
|
||||
.thenThrow(new ForbiddenException("Not authorized to access Registrar Console"));
|
||||
|
@ -103,7 +103,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate_emptyJsonObject_errorLastUpdateTimeFieldRequired() throws Exception {
|
||||
public void testUpdate_emptyJsonObject_errorLastUpdateTimeFieldRequired() {
|
||||
Map<String, Object> response = action.handleJsonRequest(ImmutableMap.of(
|
||||
"op", "update",
|
||||
"args", ImmutableMap.of()));
|
||||
|
@ -116,7 +116,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate_noEmail_errorEmailFieldRequired() throws Exception {
|
||||
public void testUpdate_noEmail_errorEmailFieldRequired() {
|
||||
Map<String, Object> response = action.handleJsonRequest(ImmutableMap.of(
|
||||
"op", "update",
|
||||
"args", ImmutableMap.of("lastUpdateTime", getLastUpdateTime())));
|
||||
|
@ -142,7 +142,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate_badEmail_errorEmailField() throws Exception {
|
||||
public void testUpdate_badEmail_errorEmailField() {
|
||||
Map<String, Object> response = action.handleJsonRequest(ImmutableMap.of(
|
||||
"op", "update",
|
||||
"args", ImmutableMap.of(
|
||||
|
@ -157,7 +157,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testPost_nonParsableTime_getsAngry() throws Exception {
|
||||
public void testPost_nonParsableTime_getsAngry() {
|
||||
Map<String, Object> response = action.handleJsonRequest(ImmutableMap.of(
|
||||
"op", "update",
|
||||
"args", ImmutableMap.of("lastUpdateTime", "cookies")));
|
||||
|
@ -170,7 +170,7 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testPost_nonAsciiCharacters_getsAngry() throws Exception {
|
||||
public void testPost_nonAsciiCharacters_getsAngry() {
|
||||
Map<String, Object> response = action.handleJsonRequest(ImmutableMap.of(
|
||||
"op", "update",
|
||||
"args", ImmutableMap.of(
|
||||
|
|
Loading…
Add table
Reference in a new issue