Remove unnecessary "throws" declarations

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201058582
This commit is contained in:
mcilwain 2018-06-18 14:25:42 -07:00 committed by Ben McIlwain
parent a7256f5edd
commit 5d80f124ca
377 changed files with 2297 additions and 2373 deletions

View file

@ -57,7 +57,7 @@ public class CommitLogCheckpointActionTest {
CommitLogCheckpointAction task = new CommitLogCheckpointAction();
@Before
public void before() throws Exception {
public void before() {
task.clock = new FakeClock(now);
task.strategy = strategy;
task.taskQueueUtils = new TaskQueueUtils(new Retrier(null, 1));

View file

@ -83,7 +83,7 @@ public class CommitLogCheckpointStrategyTest {
}
@Before
public void before() throws Exception {
public void before() {
strategy.clock = clock;
strategy.ofy = ofy;
@ -100,13 +100,13 @@ public class CommitLogCheckpointStrategyTest {
}
@Test
public void test_readBucketTimestamps_noCommitLogs() throws Exception {
public void test_readBucketTimestamps_noCommitLogs() {
assertThat(strategy.readBucketTimestamps())
.containsExactly(1, START_OF_TIME, 2, START_OF_TIME, 3, START_OF_TIME);
}
@Test
public void test_readBucketTimestamps_withSomeCommitLogs() throws Exception {
public void test_readBucketTimestamps_withSomeCommitLogs() {
DateTime startTime = clock.nowUtc();
writeCommitLogToBucket(1);
clock.advanceOneMilli();
@ -116,7 +116,7 @@ public class CommitLogCheckpointStrategyTest {
}
@Test
public void test_readBucketTimestamps_againAfterUpdate_reflectsUpdate() throws Exception {
public void test_readBucketTimestamps_againAfterUpdate_reflectsUpdate() {
DateTime firstTime = clock.nowUtc();
writeCommitLogToBucket(1);
writeCommitLogToBucket(2);

View file

@ -48,7 +48,7 @@ public class DeleteOldCommitLogsActionTest
public final InjectRule inject = new InjectRule();
@Before
public void setup() throws Exception {
public void setup() {
inject.setStaticField(Ofy.class, "clock", clock);
action = new DeleteOldCommitLogsAction();
action.mrRunner = makeDefaultRunner();

View file

@ -119,7 +119,7 @@ public class GcsDiffFileListerTest {
}
@Test
public void testList_patchesHoles() throws Exception {
public void testList_patchesHoles() {
// Fake out the GCS list() method to return only the first and last file.
// We can't use Mockito.spy() because GcsService's impl is final.
diffLister.gcsService = (GcsService) newProxyInstance(
@ -135,7 +135,7 @@ public class GcsDiffFileListerTest {
boolean called = false;
@Override
public Iterator<ListItem> call() throws Exception {
public Iterator<ListItem> call() {
try {
return called ? null : Iterators.forArray(
new ListItem.Builder()
@ -181,7 +181,7 @@ public class GcsDiffFileListerTest {
}
@Test
public void testList_boundaries() throws Exception {
public void testList_boundaries() {
assertThat(listDiffFiles(now.minusMinutes(4), now))
.containsExactly(
now.minusMinutes(4),

View file

@ -133,7 +133,7 @@ public class DeleteContactsAndHostsActionTest
}
@Before
public void setup() throws Exception {
public void setup() {
enqueuer =
new AsyncFlowEnqueuer(
getQueue(QUEUE_ASYNC_DELETE),

View file

@ -129,7 +129,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
}
@Test
public void testFail_givenNonTestTld() throws Exception {
public void testFail_givenNonTestTld() {
action.tlds = ImmutableSet.of("not-test.test");
IllegalArgumentException thrown =
assertThrows(IllegalArgumentException.class, this::runMapreduce);
@ -139,7 +139,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
}
@Test
public void testFail_givenNonExistentTld() throws Exception {
public void testFail_givenNonExistentTld() {
action.tlds = ImmutableSet.of("non-existent.test");
IllegalArgumentException thrown =
assertThrows(IllegalArgumentException.class, this::runMapreduce);
@ -149,7 +149,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
}
@Test
public void testFail_givenNonDotTestTldOnProd() throws Exception {
public void testFail_givenNonDotTestTldOnProd() {
action.tlds = ImmutableSet.of("example");
action.registryEnvironment = RegistryEnvironment.PRODUCTION;
IllegalArgumentException thrown =
@ -256,7 +256,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
}
@Test
public void testFailure_registryAdminClientId_isRequiredForSoftDeletion() throws Exception {
public void testFailure_registryAdminClientId_isRequiredForSoftDeletion() {
persistResource(
newDomainResource("blah.ib-any.test")
.asBuilder()

View file

@ -100,7 +100,7 @@ public class ExpandRecurringBillingEventsActionTest
.build();
}
void saveCursor(final DateTime cursorTime) throws Exception {
void saveCursor(final DateTime cursorTime) {
ofy().transact(() -> ofy().save().entity(Cursor.createGlobal(RECURRING_BILLING, cursorTime)));
}
@ -111,7 +111,7 @@ public class ExpandRecurringBillingEventsActionTest
ofy().clearSessionCache();
}
void assertCursorAt(DateTime expectedCursorTime) throws Exception {
void assertCursorAt(DateTime expectedCursorTime) {
Cursor cursor = ofy().load().key(Cursor.createGlobalKey(RECURRING_BILLING)).now();
assertThat(cursor).isNotNull();
assertThat(cursor.getCursorTime()).isEqualTo(expectedCursorTime);
@ -643,7 +643,7 @@ public class ExpandRecurringBillingEventsActionTest
}
@Test
public void testFailure_cursorAfterExecutionTime() throws Exception {
public void testFailure_cursorAfterExecutionTime() {
action.cursorTimeParam = Optional.of(clock.nowUtc().plusYears(1));
IllegalArgumentException thrown =
assertThrows(IllegalArgumentException.class, this::runMapreduce);
@ -653,7 +653,7 @@ public class ExpandRecurringBillingEventsActionTest
}
@Test
public void testFailure_cursorAtExecutionTime() throws Exception {
public void testFailure_cursorAtExecutionTime() {
// The clock advances one milli on runMapreduce.
action.cursorTimeParam = Optional.of(clock.nowUtc().plusMillis(1));
IllegalArgumentException thrown =

View file

@ -98,7 +98,7 @@ public class MapreduceEntityCleanupActionTest
}
}
private static String createMapreduce(String jobName) throws Exception {
private static String createMapreduce(String jobName) {
MapReduceJob<String, String, String, String, List<List<String>>> mapReduceJob =
new MapReduceJob<>(
new MapReduceSpecification.Builder<String, String, String, String, List<List<String>>>()
@ -215,7 +215,7 @@ public class MapreduceEntityCleanupActionTest
}
@Test
public void testNonexistentJobName_fails() throws Exception {
public void testNonexistentJobName_fails() {
setJobName("nonexistent");
action.run();
@ -491,7 +491,7 @@ public class MapreduceEntityCleanupActionTest
}
@Test
public void testJobIdAndJobName_fails() throws Exception {
public void testJobIdAndJobName_fails() {
setJobIdJobNameAndDaysOld(
Optional.of("jobid"), Optional.of("jobname"), Optional.empty());
@ -504,7 +504,7 @@ public class MapreduceEntityCleanupActionTest
}
@Test
public void testJobIdAndDaysOld_fails() throws Exception {
public void testJobIdAndDaysOld_fails() {
setJobIdJobNameAndDaysOld(Optional.of("jobid"), Optional.empty(), Optional.of(0));
action.run();
@ -517,7 +517,7 @@ public class MapreduceEntityCleanupActionTest
}
@Test
public void testJobIdAndNumJobs_fails() throws Exception {
public void testJobIdAndNumJobs_fails() {
action = new MapreduceEntityCleanupAction(
Optional.of("jobid"),
Optional.empty(), // jobName
@ -539,7 +539,7 @@ public class MapreduceEntityCleanupActionTest
}
@Test
public void testDeleteZeroJobs_throwsUsageError() throws Exception {
public void testDeleteZeroJobs_throwsUsageError() {
new MapreduceEntityCleanupAction(
Optional.empty(), // jobId
Optional.empty(), // jobName

View file

@ -75,7 +75,7 @@ public class RefreshDnsOnHostRenameActionTest
private final FakeClock clock = new FakeClock(DateTime.parse("2015-01-15T11:22:33Z"));
@Before
public void setup() throws Exception {
public void setup() {
createTld("tld");
enqueuer =
new AsyncFlowEnqueuer(

View file

@ -61,7 +61,7 @@ public class BigqueryTemplatePipelineTest {
}
@Test
public void testEndToEndPipeline() throws Exception {
public void testEndToEndPipeline() {
ImmutableList<TableRow> inputRows =
ImmutableList.of(
new TableRow(),

View file

@ -23,7 +23,7 @@ import org.junit.runners.JUnit4;
public class BigqueryConnectionTest {
@Test
public void testNothing() throws Exception {
public void testNothing() {
// Placeholder test class for now.
// TODO(b/16569089): figure out a good way for testing our Bigquery usage overall - maybe unit
// tests here, maybe end-to-end testing.

View file

@ -40,7 +40,7 @@ public class BigqueryUtilsTest {
private static final DateTime DATE_3 = DateTime.parse("2014-07-17T20:35:42.123Z");
@Test
public void test_toBigqueryTimestampString() throws Exception {
public void test_toBigqueryTimestampString() {
assertThat(toBigqueryTimestampString(START_OF_TIME)).isEqualTo("1970-01-01 00:00:00.000");
assertThat(toBigqueryTimestampString(DATE_0)).isEqualTo("2014-07-17 20:35:42.000");
assertThat(toBigqueryTimestampString(DATE_1)).isEqualTo("2014-07-17 20:35:42.100");
@ -50,7 +50,7 @@ public class BigqueryUtilsTest {
}
@Test
public void test_toBigqueryTimestampString_convertsToUtc() throws Exception {
public void test_toBigqueryTimestampString_convertsToUtc() {
assertThat(toBigqueryTimestampString(START_OF_TIME.withZone(DateTimeZone.forOffsetHours(5))))
.isEqualTo("1970-01-01 00:00:00.000");
assertThat(toBigqueryTimestampString(DateTime.parse("1970-01-01T00:00:00-0500")))
@ -58,13 +58,13 @@ public class BigqueryUtilsTest {
}
@Test
public void test_fromBigqueryTimestampString_startAndEndOfTime() throws Exception {
public void test_fromBigqueryTimestampString_startAndEndOfTime() {
assertThat(fromBigqueryTimestampString("1970-01-01 00:00:00 UTC")).isEqualTo(START_OF_TIME);
assertThat(fromBigqueryTimestampString("294247-01-10 04:00:54.775 UTC")).isEqualTo(END_OF_TIME);
}
@Test
public void test_fromBigqueryTimestampString_trailingZerosOkay() throws Exception {
public void test_fromBigqueryTimestampString_trailingZerosOkay() {
assertThat(fromBigqueryTimestampString("2014-07-17 20:35:42 UTC")).isEqualTo(DATE_0);
assertThat(fromBigqueryTimestampString("2014-07-17 20:35:42.0 UTC")).isEqualTo(DATE_0);
assertThat(fromBigqueryTimestampString("2014-07-17 20:35:42.00 UTC")).isEqualTo(DATE_0);
@ -78,27 +78,27 @@ public class BigqueryUtilsTest {
}
@Test
public void testFailure_fromBigqueryTimestampString_nonUtcTimeZone() throws Exception {
public void testFailure_fromBigqueryTimestampString_nonUtcTimeZone() {
assertThrows(
IllegalArgumentException.class,
() -> fromBigqueryTimestampString("2014-01-01 01:01:01 +05:00"));
}
@Test
public void testFailure_fromBigqueryTimestampString_noTimeZone() throws Exception {
public void testFailure_fromBigqueryTimestampString_noTimeZone() {
assertThrows(
IllegalArgumentException.class, () -> fromBigqueryTimestampString("2014-01-01 01:01:01"));
}
@Test
public void testFailure_fromBigqueryTimestampString_tooManyMillisecondDigits() throws Exception {
public void testFailure_fromBigqueryTimestampString_tooManyMillisecondDigits() {
assertThrows(
IllegalArgumentException.class,
() -> fromBigqueryTimestampString("2014-01-01 01:01:01.1234 UTC"));
}
@Test
public void test_toBigqueryTimestamp_timeunitConversion() throws Exception {
public void test_toBigqueryTimestamp_timeunitConversion() {
assertThat(toBigqueryTimestamp(1234567890L, TimeUnit.SECONDS))
.isEqualTo("1234567890.000000");
assertThat(toBigqueryTimestamp(1234567890123L, TimeUnit.MILLISECONDS))
@ -110,14 +110,14 @@ public class BigqueryUtilsTest {
}
@Test
public void test_toBigqueryTimestamp_timeunitConversionForZero() throws Exception {
public void test_toBigqueryTimestamp_timeunitConversionForZero() {
assertThat(toBigqueryTimestamp(0L, TimeUnit.SECONDS)).isEqualTo("0.000000");
assertThat(toBigqueryTimestamp(0L, TimeUnit.MILLISECONDS)).isEqualTo("0.000000");
assertThat(toBigqueryTimestamp(0L, TimeUnit.MICROSECONDS)).isEqualTo("0.000000");
}
@Test
public void test_toBigqueryTimestamp_datetimeConversion() throws Exception {
public void test_toBigqueryTimestamp_datetimeConversion() {
assertThat(toBigqueryTimestamp(START_OF_TIME)).isEqualTo("0.000000");
assertThat(toBigqueryTimestamp(DATE_0)).isEqualTo("1405629342.000000");
assertThat(toBigqueryTimestamp(DATE_1)).isEqualTo("1405629342.100000");
@ -127,18 +127,18 @@ public class BigqueryUtilsTest {
}
@Test
public void test_toJobReferenceString_normalSucceeds() throws Exception {
public void test_toJobReferenceString_normalSucceeds() {
assertThat(toJobReferenceString(new JobReference().setProjectId("foo").setJobId("bar")))
.isEqualTo("foo:bar");
}
@Test
public void test_toJobReferenceString_emptyReferenceSucceeds() throws Exception {
public void test_toJobReferenceString_emptyReferenceSucceeds() {
assertThat(toJobReferenceString(new JobReference())).isEqualTo("null:null");
}
@Test
public void test_toJobReferenceString_nullThrowsNpe() throws Exception {
public void test_toJobReferenceString_nullThrowsNpe() {
assertThrows(NullPointerException.class, () -> toJobReferenceString(null));
}
}

View file

@ -23,7 +23,7 @@ import org.junit.runners.JUnit4;
public class RegistryEnvironmentTest {
@Test
public void testGet() throws Exception {
public void testGet() {
RegistryEnvironment.get();
}
}

View file

@ -76,7 +76,7 @@ public class TldFanoutActionTest {
return params.build();
}
private void run(ImmutableListMultimap<String, String> params) throws Exception {
private void run(ImmutableListMultimap<String, String> params) {
TldFanoutAction action = new TldFanoutAction();
action.params = params;
action.endpoint = getLast(params.get("endpoint"));
@ -94,7 +94,7 @@ public class TldFanoutActionTest {
}
@Before
public void before() throws Exception {
public void before() {
createTlds("com", "net", "org", "example");
persistResource(Registry.get("example").asBuilder().setTldType(TldType.TEST).build());
}
@ -126,7 +126,7 @@ public class TldFanoutActionTest {
}
@Test
public void testFailure_noTlds() throws Exception {
public void testFailure_noTlds() {
assertThrows(IllegalArgumentException.class, () -> run(getParamsMap()));
}
@ -188,7 +188,7 @@ public class TldFanoutActionTest {
}
@Test
public void testFailure_runInEmptyAndTest() throws Exception {
public void testFailure_runInEmptyAndTest() {
assertThrows(
IllegalArgumentException.class,
() ->
@ -199,7 +199,7 @@ public class TldFanoutActionTest {
}
@Test
public void testFailure_runInEmptyAndReal() throws Exception {
public void testFailure_runInEmptyAndReal() {
assertThrows(
IllegalArgumentException.class,
() ->
@ -210,7 +210,7 @@ public class TldFanoutActionTest {
}
@Test
public void testFailure_runInEmptyAndExclude() throws Exception {
public void testFailure_runInEmptyAndExclude() {
assertThrows(
IllegalArgumentException.class,
() ->

View file

@ -92,7 +92,7 @@ public final class DnsInjectionTest {
}
@Test
public void testRefreshDns_missingDomain_throwsNotFound() throws Exception {
public void testRefreshDns_missingDomain_throwsNotFound() {
when(req.getParameter("type")).thenReturn("domain");
when(req.getParameter("name")).thenReturn("example.lol");
NotFoundException thrown =
@ -110,7 +110,7 @@ public final class DnsInjectionTest {
}
@Test
public void testRefreshDns_missingHost_throwsNotFound() throws Exception {
public void testRefreshDns_missingHost_throwsNotFound() {
when(req.getParameter("type")).thenReturn("host");
when(req.getParameter("name")).thenReturn("ns1.example.lol");
NotFoundException thrown =

View file

@ -62,7 +62,7 @@ public class DnsQueueTest {
}
@Test
public void test_addHostRefreshTask_failsOnUnknownTld() throws Exception {
public void test_addHostRefreshTask_failsOnUnknownTld() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,
@ -92,7 +92,7 @@ public class DnsQueueTest {
}
@Test
public void test_addDomainRefreshTask_failsOnUnknownTld() throws Exception {
public void test_addDomainRefreshTask_failsOnUnknownTld() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,

View file

@ -70,7 +70,7 @@ public class PublishDnsUpdatesActionTest {
private PublishDnsUpdatesAction action;
@Before
public void setUp() throws Exception {
public void setUp() {
inject.setStaticField(Ofy.class, "clock", clock);
createTld("xn--q9jyb4c");
persistResource(
@ -86,7 +86,7 @@ public class PublishDnsUpdatesActionTest {
clock.advanceOneMilli();
}
private PublishDnsUpdatesAction createAction(String tld) throws Exception {
private PublishDnsUpdatesAction createAction(String tld) {
PublishDnsUpdatesAction action = new PublishDnsUpdatesAction();
action.timeout = Duration.standardSeconds(10);
action.tld = tld;

View file

@ -91,7 +91,7 @@ public class ReadDnsQueueActionTest {
.build();
@Before
public void before() throws Exception {
public void before() {
// Because of b/73372999 - the FakeClock can't be in the past, or the TaskQueues stop working.
// To make sure it's never in the past, we set the date far-far into the future
clock.setTo(DateTime.parse("3000-01-01TZ"));
@ -115,7 +115,7 @@ public class ReadDnsQueueActionTest {
dnsQueue = DnsQueue.createForTesting(clock);
}
private void run() throws Exception {
private void run() {
ReadDnsQueueAction action = new ReadDnsQueueAction();
action.tldUpdateBatchSize = TEST_TLD_UPDATE_BATCH_SIZE;
action.requestedMaximumDuration = Duration.standardSeconds(10);

View file

@ -63,7 +63,7 @@ public class RefreshDnsActionTest {
}
@Test
public void testSuccess_host() throws Exception {
public void testSuccess_host() {
DomainResource domain = persistActiveDomain("example.xn--q9jyb4c");
persistActiveSubordinateHost("ns1.example.xn--q9jyb4c", domain);
run(TargetType.HOST, "ns1.example.xn--q9jyb4c");
@ -72,7 +72,7 @@ public class RefreshDnsActionTest {
}
@Test
public void testSuccess_externalHostNotEnqueued() throws Exception {
public void testSuccess_externalHostNotEnqueued() {
persistActiveDomain("example.xn--q9jyb4c");
persistActiveHost("ns1.example.xn--q9jyb4c");
BadRequestException thrown =
@ -91,7 +91,7 @@ public class RefreshDnsActionTest {
}
@Test
public void testSuccess_domain() throws Exception {
public void testSuccess_domain() {
persistActiveDomain("example.xn--q9jyb4c");
run(TargetType.DOMAIN, "example.xn--q9jyb4c");
verify(dnsQueue).addDomainRefreshTask("example.xn--q9jyb4c");
@ -99,17 +99,17 @@ public class RefreshDnsActionTest {
}
@Test
public void testFailure_unqualifiedName() throws Exception {
public void testFailure_unqualifiedName() {
assertThrows(BadRequestException.class, () -> run(TargetType.DOMAIN, "example"));
}
@Test
public void testFailure_hostDoesNotExist() throws Exception {
public void testFailure_hostDoesNotExist() {
assertThrows(NotFoundException.class, () -> run(TargetType.HOST, "ns1.example.xn--q9jyb4c"));
}
@Test
public void testFailure_domainDoesNotExist() throws Exception {
public void testFailure_domainDoesNotExist() {
assertThrows(NotFoundException.class, () -> run(TargetType.DOMAIN, "example.xn--q9jyb4c"));
}
}

View file

@ -159,7 +159,7 @@ public class CloudDnsWriterTest {
});
}
private void verifyZone(ImmutableSet<ResourceRecordSet> expectedRecords) throws Exception {
private void verifyZone(ImmutableSet<ResourceRecordSet> expectedRecords) {
// Trigger zone changes
writer.commit();
@ -425,7 +425,7 @@ public class CloudDnsWriterTest {
@Test
@SuppressWarnings("unchecked")
public void retryMutateZoneOnError() throws Exception {
public void retryMutateZoneOnError() {
CloudDnsWriter spyWriter = spy(writer);
// First call - throw. Second call - do nothing.
doThrow(ZoneStateException.class).doNothing().when(spyWriter).mutateZone(Matchers.any());

View file

@ -121,7 +121,7 @@ public class DnsUpdateWriterTest {
}
@Test
public void testPublishAtomic_noCommit() throws Exception {
public void testPublishAtomic_noCommit() {
HostResource host1 = persistActiveHost("ns.example1.tld");
DomainResource domain1 =
persistActiveDomain("example1.tld")

View file

@ -93,7 +93,7 @@ public class BigqueryPollJobActionTest {
LoggerConfig.getConfig(BigqueryPollJobAction.class).addHandler(logHandler);
}
private static TaskMatcher newPollJobTaskMatcher(String method) throws Exception {
private static TaskMatcher newPollJobTaskMatcher(String method) {
return new TaskMatcher()
.method(method)
.url(BigqueryPollJobAction.PATH)

View file

@ -62,7 +62,7 @@ public class CheckSnapshotActionTest {
private final CheckSnapshotAction action = new CheckSnapshotAction();
@Before
public void before() throws Exception {
public void before() {
inject.setStaticField(DatastoreBackupInfo.class, "clock", clock);
action.requestMethod = Method.POST;
action.snapshotName = "some_backup";
@ -119,7 +119,7 @@ public class CheckSnapshotActionTest {
}
@Test
public void testPost_forPendingBackup_returnsNotModified() throws Exception {
public void testPost_forPendingBackup_returnsNotModified() {
setPendingBackup();
NotModifiedException thrown = assertThrows(NotModifiedException.class, action::run);
@ -127,7 +127,7 @@ public class CheckSnapshotActionTest {
}
@Test
public void testPost_forStalePendingBackupBackup_returnsNoContent() throws Exception {
public void testPost_forStalePendingBackupBackup_returnsNoContent() {
setPendingBackup();
when(backupService.findByName("some_backup")).thenReturn(backupInfo);
@ -182,7 +182,7 @@ public class CheckSnapshotActionTest {
}
@Test
public void testPost_forBadBackup_returnsBadRequest() throws Exception {
public void testPost_forBadBackup_returnsBadRequest() {
when(backupService.findByName("some_backup"))
.thenThrow(new IllegalArgumentException("No backup found"));
@ -191,7 +191,7 @@ public class CheckSnapshotActionTest {
}
@Test
public void testGet_returnsInformation() throws Exception {
public void testGet_returnsInformation() {
action.requestMethod = Method.GET;
action.run();
@ -211,7 +211,7 @@ public class CheckSnapshotActionTest {
}
@Test
public void testGet_forBadBackup_returnsError() throws Exception {
public void testGet_forBadBackup_returnsError() {
action.requestMethod = Method.GET;
when(backupService.findByName("some_backup"))
.thenThrow(new IllegalArgumentException("No backup found"));

View file

@ -54,7 +54,7 @@ public class DatastoreBackupInfoTest {
private Entity backupEntity; // Can't initialize until AppEngineRule has set up Datastore.
@Before
public void before() throws Exception {
public void before() {
inject.setStaticField(DatastoreBackupInfo.class, "clock", clock);
backupEntity = new Entity("_unused_");
backupEntity.setProperty("name", "backup1");
@ -101,28 +101,28 @@ public class DatastoreBackupInfoTest {
}
@Test
public void testFailure_missingName() throws Exception {
public void testFailure_missingName() {
backupEntity.removeProperty("name");
assertThrows(
NullPointerException.class, () -> new DatastoreBackupInfo(persistEntity(backupEntity)));
}
@Test
public void testFailure_missingKinds() throws Exception {
public void testFailure_missingKinds() {
backupEntity.removeProperty("kinds");
assertThrows(
NullPointerException.class, () -> new DatastoreBackupInfo(persistEntity(backupEntity)));
}
@Test
public void testFailure_missingStartTime() throws Exception {
public void testFailure_missingStartTime() {
backupEntity.removeProperty("start_time");
assertThrows(
NullPointerException.class, () -> new DatastoreBackupInfo(persistEntity(backupEntity)));
}
@Test
public void testFailure_badGcsFilenameFormat() throws Exception {
public void testFailure_badGcsFilenameFormat() {
backupEntity.setProperty("gs_handle", new Text("foo"));
assertThrows(
IllegalArgumentException.class, () -> new DatastoreBackupInfo(persistEntity(backupEntity)));

View file

@ -57,7 +57,7 @@ public class DatastoreBackupServiceTest {
private final DatastoreBackupService backupService = DatastoreBackupService.get();
@Before
public void before() throws Exception {
public void before() {
inject.setStaticField(DatastoreBackupService.class, "modulesService", modulesService);
when(modulesService.getVersionHostname("default", "ah-builtin-python-bundle"))
.thenReturn("ah-builtin-python-bundle.default.localhost");
@ -95,7 +95,7 @@ public class DatastoreBackupServiceTest {
}
@Test
public void testSuccess_findAllByNamePrefix() throws Exception {
public void testSuccess_findAllByNamePrefix() {
assertThat(
transform(backupService.findAllByNamePrefix("backupA"), DatastoreBackupInfo::getName))
.containsExactly("backupA1", "backupA2", "backupA3");
@ -109,18 +109,18 @@ public class DatastoreBackupServiceTest {
}
@Test
public void testSuccess_findByName() throws Exception {
public void testSuccess_findByName() {
assertThat(backupService.findByName("backupA1").getName()).isEqualTo("backupA1");
assertThat(backupService.findByName("backupB4").getName()).isEqualTo("backupB42");
}
@Test
public void testFailure_findByName_multipleMatchingBackups() throws Exception {
public void testFailure_findByName_multipleMatchingBackups() {
assertThrows(IllegalArgumentException.class, () -> backupService.findByName("backupA"));
}
@Test
public void testFailure_findByName_noMatchingBackups() throws Exception {
public void testFailure_findByName_noMatchingBackups() {
assertThrows(IllegalArgumentException.class, () -> backupService.findByName("backupX"));
}
}

View file

@ -53,17 +53,17 @@ public class ExportConstantsTest {
"");
@Test
public void testBackupKinds_matchGoldenBackupKindsFile() throws Exception {
public void testBackupKinds_matchGoldenBackupKindsFile() {
checkKindsMatchGoldenFile("backed-up", GOLDEN_BACKUP_KINDS_FILENAME, getBackupKinds());
}
@Test
public void testReportingKinds_matchGoldenReportingKindsFile() throws Exception {
public void testReportingKinds_matchGoldenReportingKindsFile() {
checkKindsMatchGoldenFile("reporting", GOLDEN_REPORTING_KINDS_FILENAME, getReportingKinds());
}
@Test
public void testReportingKinds_areSubsetOfBackupKinds() throws Exception {
public void testReportingKinds_areSubsetOfBackupKinds() {
assertThat(getBackupKinds()).containsAllIn(getReportingKinds());
}

View file

@ -95,7 +95,7 @@ public class ExportReservedTermsActionTest {
}
@Test
public void test_uploadFileToDrive_doesNothingIfReservedListsNotConfigured() throws Exception {
public void test_uploadFileToDrive_doesNothingIfReservedListsNotConfigured() {
persistResource(
Registry.get("tld")
.asBuilder()
@ -108,7 +108,7 @@ public class ExportReservedTermsActionTest {
}
@Test
public void test_uploadFileToDrive_doesNothingWhenDriveFolderIdIsNull() throws Exception {
public void test_uploadFileToDrive_doesNothingWhenDriveFolderIdIsNull() {
persistResource(Registry.get("tld").asBuilder().setDriveFolderId(null).build());
runAction("tld");
verify(response).setStatus(SC_OK);
@ -129,7 +129,7 @@ public class ExportReservedTermsActionTest {
}
@Test
public void test_uploadFileToDrive_failsWhenTldDoesntExist() throws Exception {
public void test_uploadFileToDrive_failsWhenTldDoesntExist() {
RuntimeException thrown = assertThrows(RuntimeException.class, () -> runAction("fakeTld"));
verify(response).setStatus(SC_INTERNAL_SERVER_ERROR);
assertThat(thrown)

View file

@ -46,7 +46,7 @@ public class ExportSnapshotActionTest {
private final ExportSnapshotAction action = new ExportSnapshotAction();
@Before
public void before() throws Exception {
public void before() {
action.clock = clock;
action.backupService = backupService;
action.response = response;

View file

@ -180,7 +180,7 @@ public class LoadSnapshotActionTest {
}
@Test
public void testFailure_doPost_badGcsFilename() throws Exception {
public void testFailure_doPost_badGcsFilename() {
action.snapshotFile = "gs://bucket/snapshot";
BadRequestException thrown = assertThrows(BadRequestException.class, action::run);
assertThat(thrown)

View file

@ -98,7 +98,7 @@ public class SyncGroupMembersActionTest {
}
@Test
public void test_doPost_noneModified() throws Exception {
public void test_doPost_noneModified() {
persistResource(
loadRegistrar("NewRegistrar").asBuilder().setContactsRequireSyncing(false).build());
persistResource(

View file

@ -66,7 +66,7 @@ public class SyncRegistrarsSheetActionTest {
}
@Test
public void testPost_withoutParamsOrSystemProperty_dropsTask() throws Exception {
public void testPost_withoutParamsOrSystemProperty_dropsTask() {
runAction(null, null);
assertThat(response.getPayload()).startsWith("MISSINGNO");
verifyZeroInteractions(syncRegistrarsSheet);
@ -85,7 +85,7 @@ public class SyncRegistrarsSheetActionTest {
}
@Test
public void testPost_noModificationsToRegistrarEntities_doesNothing() throws Exception {
public void testPost_noModificationsToRegistrarEntities_doesNothing() {
when(syncRegistrarsSheet.wereRegistrarsModified()).thenReturn(false);
runAction("NewRegistrar", null);
assertThat(response.getPayload()).startsWith("NOTMODIFIED");
@ -102,7 +102,7 @@ public class SyncRegistrarsSheetActionTest {
}
@Test
public void testPost_failToAquireLock_servletDoesNothingAndReturns() throws Exception {
public void testPost_failToAquireLock_servletDoesNothingAndReturns() {
action.lockHandler = new FakeLockHandler(false);
runAction(null, "foobar");
assertThat(response.getPayload()).startsWith("LOCKED");

View file

@ -74,7 +74,7 @@ public class SyncRegistrarsSheetTest {
}
@Before
public void before() throws Exception {
public void before() {
inject.setStaticField(Ofy.class, "clock", clock);
createTld("example");
// Remove Registrar entities created by AppEngineRule.
@ -82,12 +82,12 @@ public class SyncRegistrarsSheetTest {
}
@Test
public void test_wereRegistrarsModified_noRegistrars_returnsFalse() throws Exception {
public void test_wereRegistrarsModified_noRegistrars_returnsFalse() {
assertThat(newSyncRegistrarsSheet().wereRegistrarsModified()).isFalse();
}
@Test
public void test_wereRegistrarsModified_atDifferentCursorTimes() throws Exception {
public void test_wereRegistrarsModified_atDifferentCursorTimes() {
persistNewRegistrar("SomeRegistrar", "Some Registrar Inc.", Registrar.Type.REAL, 8L);
persistResource(Cursor.createGlobal(SYNC_REGISTRAR_SHEET, clock.nowUtc().minusHours(1)));
assertThat(newSyncRegistrarsSheet().wereRegistrarsModified()).isTrue();

View file

@ -64,7 +64,7 @@ public class CheckApi2ActionTest {
private DateTime endTime;
@Before
public void init() throws Exception {
public void init() {
createTld("example");
persistResource(
Registry.get("example")

View file

@ -46,7 +46,7 @@ public class CheckApiActionTest {
final CheckApiAction action = new CheckApiAction();
@Before
public void init() throws Exception {
public void init() {
createTld("example");
persistResource(
Registry.get("example")
@ -70,42 +70,42 @@ public class CheckApiActionTest {
}
@Test
public void testFailure_nullDomain() throws Exception {
public void testFailure_nullDomain() {
assertThat(getCheckResponse(null)).containsExactly(
"status", "error",
"reason", "Must supply a valid domain name on an authoritative TLD");
}
@Test
public void testFailure_emptyDomain() throws Exception {
public void testFailure_emptyDomain() {
assertThat(getCheckResponse("")).containsExactly(
"status", "error",
"reason", "Must supply a valid domain name on an authoritative TLD");
}
@Test
public void testFailure_invalidDomain() throws Exception {
public void testFailure_invalidDomain() {
assertThat(getCheckResponse("@#$%^")).containsExactly(
"status", "error",
"reason", "Must supply a valid domain name on an authoritative TLD");
}
@Test
public void testFailure_singlePartDomain() throws Exception {
public void testFailure_singlePartDomain() {
assertThat(getCheckResponse("foo")).containsExactly(
"status", "error",
"reason", "Must supply a valid domain name on an authoritative TLD");
}
@Test
public void testFailure_nonExistentTld() throws Exception {
public void testFailure_nonExistentTld() {
assertThat(getCheckResponse("foo.bar")).containsExactly(
"status", "error",
"reason", "Must supply a valid domain name on an authoritative TLD");
}
@Test
public void testFailure_unauthorizedTld() throws Exception {
public void testFailure_unauthorizedTld() {
createTld("foo");
persistResource(
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of("foo")).build());
@ -115,7 +115,7 @@ public class CheckApiActionTest {
}
@Test
public void testSuccess_availableStandard() throws Exception {
public void testSuccess_availableStandard() {
assertThat(getCheckResponse("somedomain.example")).containsExactly(
"status", "success",
"available", true,
@ -123,7 +123,7 @@ public class CheckApiActionTest {
}
@Test
public void testSuccess_availableCapital() throws Exception {
public void testSuccess_availableCapital() {
assertThat(getCheckResponse("SOMEDOMAIN.EXAMPLE")).containsExactly(
"status", "success",
"available", true,
@ -131,7 +131,7 @@ public class CheckApiActionTest {
}
@Test
public void testSuccess_availableUnicode() throws Exception {
public void testSuccess_availableUnicode() {
assertThat(getCheckResponse("ééé.example")).containsExactly(
"status", "success",
"available", true,
@ -139,7 +139,7 @@ public class CheckApiActionTest {
}
@Test
public void testSuccess_availablePunycode() throws Exception {
public void testSuccess_availablePunycode() {
assertThat(getCheckResponse("xn--9caaa.example")).containsExactly(
"status", "success",
"available", true,
@ -147,7 +147,7 @@ public class CheckApiActionTest {
}
@Test
public void testSuccess_availablePremium() throws Exception {
public void testSuccess_availablePremium() {
assertThat(getCheckResponse("rich.example")).containsExactly(
"status", "success",
"available", true,
@ -155,7 +155,7 @@ public class CheckApiActionTest {
}
@Test
public void testSuccess_alreadyRegistered() throws Exception {
public void testSuccess_alreadyRegistered() {
persistActiveDomain("somedomain.example");
assertThat(getCheckResponse("somedomain.example")).containsExactly(
"status", "success",
@ -164,7 +164,7 @@ public class CheckApiActionTest {
}
@Test
public void testSuccess_reserved() throws Exception {
public void testSuccess_reserved() {
assertThat(getCheckResponse("foo.example")).containsExactly(
"status", "success",
"available", false,

View file

@ -60,7 +60,7 @@ public class EppCommitLogsTest extends ShardableTestCase {
private EppLoader eppLoader;
@Before
public void init() throws Exception {
public void init() {
createTld("tld");
inject.setStaticField(Ofy.class, "clock", clock);
}

View file

@ -133,7 +133,7 @@ public class EppControllerTest extends ShardableTestCase {
}
@Test
public void testHandleEppCommand_unmarshallableData_exportsMetric() throws Exception {
public void testHandleEppCommand_unmarshallableData_exportsMetric() {
eppController.handleEppCommand(
sessionMetadata,
transportCredentials,
@ -154,7 +154,7 @@ public class EppControllerTest extends ShardableTestCase {
}
@Test
public void testHandleEppCommand_regularEppCommand_exportsBigQueryMetric() throws Exception {
public void testHandleEppCommand_regularEppCommand_exportsBigQueryMetric() {
eppController.handleEppCommand(
sessionMetadata,
transportCredentials,
@ -176,7 +176,7 @@ public class EppControllerTest extends ShardableTestCase {
}
@Test
public void testHandleEppCommand_regularEppCommand_exportsEppMetrics() throws Exception {
public void testHandleEppCommand_regularEppCommand_exportsEppMetrics() {
createTld("tld");
// Note that some of the EPP metric fields, like # of attempts and command name, are set in
// FlowRunner, not EppController, and since FlowRunner is mocked out for these tests they won't
@ -202,7 +202,7 @@ public class EppControllerTest extends ShardableTestCase {
}
@Test
public void testHandleEppCommand_dryRunEppCommand_doesNotExportMetric() throws Exception {
public void testHandleEppCommand_dryRunEppCommand_doesNotExportMetric() {
eppController.handleEppCommand(
sessionMetadata,
transportCredentials,

View file

@ -45,7 +45,7 @@ public class EppLoginTlsTest extends EppTestCase {
}
@Before
public void initTest() throws Exception {
public void initTest() {
persistResource(
loadRegistrar("NewRegistrar")
.asBuilder()

View file

@ -41,7 +41,7 @@ public class EppLoginUserTest extends EppTestCase {
.build();
@Before
public void initTest() throws Exception {
public void initTest() {
User user = getUserService().getCurrentUser();
persistResource(
new RegistrarContact.Builder()

View file

@ -115,7 +115,7 @@ public class EppTestCase extends ShardableTestCase {
return new CommandAsserter(inputFilename, inputSubstitutions);
}
CommandAsserter assertThatLogin(String clientId, String password) throws Exception {
CommandAsserter assertThatLogin(String clientId, String password) {
return assertThatCommand("login.xml", ImmutableMap.of("CLID", clientId, "PW", password));
}

View file

@ -50,22 +50,22 @@ public class EppToolActionTest {
}
@Test
public void testDryRunAndSuperuser() throws Exception {
public void testDryRunAndSuperuser() {
doTest(true, true);
}
@Test
public void testDryRun() throws Exception {
public void testDryRun() {
doTest(true, false);
}
@Test
public void testSuperuser() throws Exception {
public void testSuperuser() {
doTest(false, true);
}
@Test
public void testNeitherDryRunNorSuperuser() throws Exception {
public void testNeitherDryRunNorSuperuser() {
doTest(false, false);
}
}

View file

@ -38,7 +38,7 @@ public class EppXmlTransformerTest extends ShardableTestCase {
}
@Test
public void testUnmarshalingWrongClassThrows() throws Exception {
public void testUnmarshalingWrongClassThrows() {
assertThrows(
ClassCastException.class,
() ->

View file

@ -53,7 +53,7 @@ public class ExtensionManagerTest {
.build();
@Test
public void testDuplicateExtensionsForbidden() throws Exception {
public void testDuplicateExtensionsForbidden() {
ExtensionManager manager =
new TestInstanceBuilder()
.setEppRequestSource(EppRequestSource.TOOL)
@ -90,7 +90,7 @@ public class ExtensionManagerTest {
}
@Test
public void testBlacklistedExtensions_forbiddenWhenUndeclared() throws Exception {
public void testBlacklistedExtensions_forbiddenWhenUndeclared() {
ExtensionManager manager =
new TestInstanceBuilder()
.setEppRequestSource(EppRequestSource.TOOL)
@ -128,7 +128,7 @@ public class ExtensionManagerTest {
}
@Test
public void testMetadataExtension_forbiddenWhenNotToolSource() throws Exception {
public void testMetadataExtension_forbiddenWhenNotToolSource() {
ExtensionManager manager =
new TestInstanceBuilder()
.setEppRequestSource(EppRequestSource.CONSOLE)
@ -154,7 +154,7 @@ public class ExtensionManagerTest {
}
@Test
public void testSuperuserExtension_forbiddenWhenNotSuperuser() throws Exception {
public void testSuperuserExtension_forbiddenWhenNotSuperuser() {
ExtensionManager manager =
new TestInstanceBuilder()
.setEppRequestSource(EppRequestSource.TOOL)
@ -169,7 +169,7 @@ public class ExtensionManagerTest {
}
@Test
public void testSuperuserExtension_forbiddenWhenNotToolSource() throws Exception {
public void testSuperuserExtension_forbiddenWhenNotToolSource() {
ExtensionManager manager =
new TestInstanceBuilder()
.setEppRequestSource(EppRequestSource.CONSOLE)
@ -184,7 +184,7 @@ public class ExtensionManagerTest {
}
@Test
public void testUnimplementedExtensionsForbidden() throws Exception {
public void testUnimplementedExtensionsForbidden() {
ExtensionManager manager =
new TestInstanceBuilder()
.setEppRequestSource(EppRequestSource.TOOL)

View file

@ -44,7 +44,7 @@ public class FlowReporterTest extends ShardableTestCase {
static class TestCommandFlow implements Flow {
@Override
public ResponseOrGreeting run() throws EppException {
public ResponseOrGreeting run() {
return mock(EppResponse.class);
}
}
@ -52,7 +52,7 @@ public class FlowReporterTest extends ShardableTestCase {
@ReportingSpec(ActivityReportField.CONTACT_CHECK)
static class TestReportingSpecCommandFlow implements Flow {
@Override
public ResponseOrGreeting run() throws EppException {
public ResponseOrGreeting run() {
return mock(EppResponse.class);
}
}

View file

@ -61,7 +61,7 @@ public class FlowRunnerTest extends ShardableTestCase {
static class TestCommandFlow implements Flow {
@Override
public ResponseOrGreeting run() throws EppException {
public ResponseOrGreeting run() {
return mock(EppResponse.class);
}
}

View file

@ -102,7 +102,7 @@ public abstract class FlowTestCase<F extends Flow> extends ShardableTestCase {
private EppMetric.Builder eppMetricBuilder;
@Before
public void init() throws Exception {
public void init() {
sessionMetadata = new HttpSessionMetadata(new FakeHttpSession());
sessionMetadata.setClientId("TheRegistrar");
sessionMetadata.setServiceExtensionUris(ProtocolDefinition.getVisibleServiceExtensionUris());
@ -167,11 +167,11 @@ public abstract class FlowTestCase<F extends Flow> extends ShardableTestCase {
}
}
protected void assertNoHistory() throws Exception {
protected void assertNoHistory() {
assertThat(ofy().load().type(HistoryEntry.class)).isEmpty();
}
public <T> T getOnlyGlobalResource(Class<T> clazz) throws Exception {
public <T> T getOnlyGlobalResource(Class<T> clazz) {
return Iterables.getOnlyElement(ofy().load().type(clazz));
}
@ -262,8 +262,8 @@ public abstract class FlowTestCase<F extends Flow> extends ShardableTestCase {
}
/** Assert that the list matches all the poll messages in the fake Datastore. */
public void assertPollMessagesHelper(Iterable<PollMessage> pollMessages, PollMessage... expected)
throws Exception {
public void assertPollMessagesHelper(
Iterable<PollMessage> pollMessages, PollMessage... expected) {
// Ordering is irrelevant but duplicates should be considered independently.
assertThat(
Streams.stream(pollMessages).map(POLL_MESSAGE_ID_STRIPPER).collect(toImmutableList()))

View file

@ -134,7 +134,7 @@ public abstract class ResourceFlowTestCase<F extends Flow, R extends EppResource
}
@Test
public void testRequiresLogin() throws Exception {
public void testRequiresLogin() {
sessionMetadata.setClientId(null);
EppException thrown = assertThrows(NotLoggedInException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();

View file

@ -77,7 +77,7 @@ public class ContactCheckFlowTest
}
@Test
public void testTooManyIds() throws Exception {
public void testTooManyIds() {
setEppInput("contact_check_51.xml");
EppException thrown = assertThrows(TooManyResourceChecksException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();

View file

@ -86,7 +86,7 @@ public class ContactCreateFlowTest
}
@Test
public void testFailure_nonAsciiInIntAddress() throws Exception {
public void testFailure_nonAsciiInIntAddress() {
setEppInput("contact_create_hebrew_int.xml");
EppException thrown =
assertThrows(BadInternationalizedPostalInfoException.class, this::runFlow);
@ -94,7 +94,7 @@ public class ContactCreateFlowTest
}
@Test
public void testFailure_declineDisclosure() throws Exception {
public void testFailure_declineDisclosure() {
setEppInput("contact_create_decline_disclosure.xml");
EppException thrown =
assertThrows(DeclineContactDisclosureFieldDisallowedPolicyException.class, this::runFlow);

View file

@ -139,7 +139,7 @@ public class ContactTransferApproveFlowTest
}
@Test
public void testFailure_badContactPassword() throws Exception {
public void testFailure_badContactPassword() {
// Change the contact's password so it does not match the password in the file.
contact = persistResource(
contact.asBuilder()
@ -153,7 +153,7 @@ public class ContactTransferApproveFlowTest
}
@Test
public void testFailure_neverBeenTransferred() throws Exception {
public void testFailure_neverBeenTransferred() {
changeTransferStatus(null);
EppException thrown =
assertThrows(
@ -162,7 +162,7 @@ public class ContactTransferApproveFlowTest
}
@Test
public void testFailure_clientApproved() throws Exception {
public void testFailure_clientApproved() {
changeTransferStatus(TransferStatus.CLIENT_APPROVED);
EppException thrown =
assertThrows(
@ -171,7 +171,7 @@ public class ContactTransferApproveFlowTest
}
@Test
public void testFailure_clientRejected() throws Exception {
public void testFailure_clientRejected() {
changeTransferStatus(TransferStatus.CLIENT_REJECTED);
EppException thrown =
assertThrows(
@ -180,7 +180,7 @@ public class ContactTransferApproveFlowTest
}
@Test
public void testFailure_clientCancelled() throws Exception {
public void testFailure_clientCancelled() {
changeTransferStatus(TransferStatus.CLIENT_CANCELLED);
EppException thrown =
assertThrows(
@ -189,7 +189,7 @@ public class ContactTransferApproveFlowTest
}
@Test
public void testFailure_serverApproved() throws Exception {
public void testFailure_serverApproved() {
changeTransferStatus(TransferStatus.SERVER_APPROVED);
EppException thrown =
assertThrows(
@ -198,7 +198,7 @@ public class ContactTransferApproveFlowTest
}
@Test
public void testFailure_serverCancelled() throws Exception {
public void testFailure_serverCancelled() {
changeTransferStatus(TransferStatus.SERVER_CANCELLED);
EppException thrown =
assertThrows(
@ -207,7 +207,7 @@ public class ContactTransferApproveFlowTest
}
@Test
public void testFailure_gainingClient() throws Exception {
public void testFailure_gainingClient() {
setClientIdForFlow("NewRegistrar");
EppException thrown =
assertThrows(
@ -216,7 +216,7 @@ public class ContactTransferApproveFlowTest
}
@Test
public void testFailure_unrelatedClient() throws Exception {
public void testFailure_unrelatedClient() {
setClientIdForFlow("ClientZ");
EppException thrown =
assertThrows(

View file

@ -123,7 +123,7 @@ public class ContactTransferCancelFlowTest
}
@Test
public void testFailure_badContactPassword() throws Exception {
public void testFailure_badContactPassword() {
// Change the contact's password so it does not match the password in the file.
contact =
persistResource(
@ -139,7 +139,7 @@ public class ContactTransferCancelFlowTest
}
@Test
public void testFailure_neverBeenTransferred() throws Exception {
public void testFailure_neverBeenTransferred() {
changeTransferStatus(null);
EppException thrown =
assertThrows(
@ -148,7 +148,7 @@ public class ContactTransferCancelFlowTest
}
@Test
public void testFailure_clientApproved() throws Exception {
public void testFailure_clientApproved() {
changeTransferStatus(TransferStatus.CLIENT_APPROVED);
EppException thrown =
assertThrows(
@ -157,7 +157,7 @@ public class ContactTransferCancelFlowTest
}
@Test
public void testFailure_clientRejected() throws Exception {
public void testFailure_clientRejected() {
changeTransferStatus(TransferStatus.CLIENT_REJECTED);
EppException thrown =
assertThrows(
@ -166,7 +166,7 @@ public class ContactTransferCancelFlowTest
}
@Test
public void testFailure_clientCancelled() throws Exception {
public void testFailure_clientCancelled() {
changeTransferStatus(TransferStatus.CLIENT_CANCELLED);
EppException thrown =
assertThrows(
@ -175,7 +175,7 @@ public class ContactTransferCancelFlowTest
}
@Test
public void testFailure_serverApproved() throws Exception {
public void testFailure_serverApproved() {
changeTransferStatus(TransferStatus.SERVER_APPROVED);
EppException thrown =
assertThrows(
@ -184,7 +184,7 @@ public class ContactTransferCancelFlowTest
}
@Test
public void testFailure_serverCancelled() throws Exception {
public void testFailure_serverCancelled() {
changeTransferStatus(TransferStatus.SERVER_CANCELLED);
EppException thrown =
assertThrows(
@ -193,7 +193,7 @@ public class ContactTransferCancelFlowTest
}
@Test
public void testFailure_sponsoringClient() throws Exception {
public void testFailure_sponsoringClient() {
setClientIdForFlow("TheRegistrar");
EppException thrown =
assertThrows(
@ -203,7 +203,7 @@ public class ContactTransferCancelFlowTest
}
@Test
public void testFailure_unrelatedClient() throws Exception {
public void testFailure_unrelatedClient() {
setClientIdForFlow("ClientZ");
EppException thrown =
assertThrows(

View file

@ -63,7 +63,7 @@ public class ContactTransferFlowTestCase<F extends Flow, R extends EppResource>
}
/** Adds a contact that has a pending transfer on it from TheRegistrar to NewRegistrar. */
protected void setupContactWithPendingTransfer() throws Exception {
protected void setupContactWithPendingTransfer() {
contact = persistContactWithPendingTransfer(
newContactResource("sh8013"),
TRANSFER_REQUEST_TIME,

View file

@ -136,7 +136,7 @@ public class ContactTransferQueryFlowTest
}
@Test
public void testFailure_badContactPassword() throws Exception {
public void testFailure_badContactPassword() {
// Change the contact's password so it does not match the password in the file.
contact =
persistResource(
@ -152,7 +152,7 @@ public class ContactTransferQueryFlowTest
}
@Test
public void testFailure_badContactRoid() throws Exception {
public void testFailure_badContactRoid() {
// 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.
contact = contact.asBuilder().setRepoId("DEADBEEF_TLD-ROID").build();
@ -164,7 +164,7 @@ public class ContactTransferQueryFlowTest
}
@Test
public void testFailure_neverBeenTransferred() throws Exception {
public void testFailure_neverBeenTransferred() {
changeTransferStatus(null);
EppException thrown =
assertThrows(
@ -174,7 +174,7 @@ public class ContactTransferQueryFlowTest
}
@Test
public void testFailure_unrelatedClient() throws Exception {
public void testFailure_unrelatedClient() {
setClientIdForFlow("ClientZ");
EppException thrown =
assertThrows(

View file

@ -138,7 +138,7 @@ public class ContactTransferRejectFlowTest
}
@Test
public void testFailure_badPassword() throws Exception {
public void testFailure_badPassword() {
// Change the contact's password so it does not match the password in the file.
contact =
persistResource(
@ -154,7 +154,7 @@ public class ContactTransferRejectFlowTest
}
@Test
public void testFailure_neverBeenTransferred() throws Exception {
public void testFailure_neverBeenTransferred() {
changeTransferStatus(null);
EppException thrown =
assertThrows(
@ -163,7 +163,7 @@ public class ContactTransferRejectFlowTest
}
@Test
public void testFailure_clientApproved() throws Exception {
public void testFailure_clientApproved() {
changeTransferStatus(TransferStatus.CLIENT_APPROVED);
EppException thrown =
assertThrows(
@ -172,7 +172,7 @@ public class ContactTransferRejectFlowTest
}
@Test
public void testFailure_clientRejected() throws Exception {
public void testFailure_clientRejected() {
changeTransferStatus(TransferStatus.CLIENT_REJECTED);
EppException thrown =
assertThrows(
@ -181,7 +181,7 @@ public class ContactTransferRejectFlowTest
}
@Test
public void testFailure_clientCancelled() throws Exception {
public void testFailure_clientCancelled() {
changeTransferStatus(TransferStatus.CLIENT_CANCELLED);
EppException thrown =
assertThrows(
@ -190,7 +190,7 @@ public class ContactTransferRejectFlowTest
}
@Test
public void testFailure_serverApproved() throws Exception {
public void testFailure_serverApproved() {
changeTransferStatus(TransferStatus.SERVER_APPROVED);
EppException thrown =
assertThrows(
@ -199,7 +199,7 @@ public class ContactTransferRejectFlowTest
}
@Test
public void testFailure_serverCancelled() throws Exception {
public void testFailure_serverCancelled() {
changeTransferStatus(TransferStatus.SERVER_CANCELLED);
EppException thrown =
assertThrows(
@ -208,7 +208,7 @@ public class ContactTransferRejectFlowTest
}
@Test
public void testFailure_gainingClient() throws Exception {
public void testFailure_gainingClient() {
setClientIdForFlow("NewRegistrar");
EppException thrown =
assertThrows(
@ -217,7 +217,7 @@ public class ContactTransferRejectFlowTest
}
@Test
public void testFailure_unrelatedClient() throws Exception {
public void testFailure_unrelatedClient() {
setClientIdForFlow("ClientZ");
EppException thrown =
assertThrows(

View file

@ -66,7 +66,7 @@ public class ContactTransferRequestFlowTest
}
@Before
public void setUp() throws Exception {
public void setUp() {
setEppInput("contact_transfer_request.xml");
setClientIdForFlow("NewRegistrar");
contact = persistActiveContact("sh8013");
@ -156,7 +156,7 @@ public class ContactTransferRequestFlowTest
}
@Test
public void testFailure_noAuthInfo() throws Exception {
public void testFailure_noAuthInfo() {
EppException thrown =
assertThrows(
MissingTransferRequestAuthInfoException.class,
@ -165,7 +165,7 @@ public class ContactTransferRequestFlowTest
}
@Test
public void testFailure_badPassword() throws Exception {
public void testFailure_badPassword() {
// Change the contact's password so it does not match the password in the file.
contact =
persistResource(
@ -211,7 +211,7 @@ public class ContactTransferRequestFlowTest
}
@Test
public void testFailure_pending() throws Exception {
public void testFailure_pending() {
contact =
persistResource(
contact
@ -232,7 +232,7 @@ public class ContactTransferRequestFlowTest
}
@Test
public void testFailure_sponsoringClient() throws Exception {
public void testFailure_sponsoringClient() {
setClientIdForFlow("TheRegistrar");
EppException thrown =
assertThrows(
@ -265,7 +265,7 @@ public class ContactTransferRequestFlowTest
}
@Test
public void testFailure_clientTransferProhibited() throws Exception {
public void testFailure_clientTransferProhibited() {
contact =
persistResource(
contact.asBuilder().addStatusValue(StatusValue.CLIENT_TRANSFER_PROHIBITED).build());
@ -278,7 +278,7 @@ public class ContactTransferRequestFlowTest
}
@Test
public void testFailure_serverTransferProhibited() throws Exception {
public void testFailure_serverTransferProhibited() {
contact =
persistResource(
contact.asBuilder().addStatusValue(StatusValue.SERVER_TRANSFER_PROHIBITED).build());
@ -291,7 +291,7 @@ public class ContactTransferRequestFlowTest
}
@Test
public void testFailure_pendingDelete() throws Exception {
public void testFailure_pendingDelete() {
contact =
persistResource(contact.asBuilder().addStatusValue(StatusValue.PENDING_DELETE).build());
ResourceStatusProhibitsOperationException thrown =

View file

@ -16,7 +16,6 @@ package google.registry.flows.custom;
import static google.registry.model.ofy.ObjectifyService.ofy;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.model.eppinput.EppInput;
@ -31,7 +30,7 @@ public class TestDomainCreateFlowCustomLogic extends DomainCreateFlowCustomLogic
}
@Override
public EntityChanges beforeSave(BeforeSaveParameters parameters) throws EppException {
public EntityChanges beforeSave(BeforeSaveParameters parameters) {
if (parameters.newDomain().getFullyQualifiedDomainName().startsWith("custom-logic-test")) {
PollMessage extraPollMessage =
new PollMessage.OneTime.Builder()

View file

@ -14,7 +14,6 @@
package google.registry.flows.custom;
import google.registry.flows.EppException;
import google.registry.flows.FlowMetadata;
import google.registry.flows.SessionMetadata;
import google.registry.flows.domain.DomainPricingLogic;
@ -39,7 +38,7 @@ public class TestDomainPricingCustomLogic extends DomainPricingCustomLogic {
@Override
public FeesAndCredits customizeApplicationUpdatePrice(
ApplicationUpdatePriceParameters priceParameters) throws EppException {
ApplicationUpdatePriceParameters priceParameters) {
return (priceParameters
.domainApplication()
.getFullyQualifiedDomainName()
@ -50,8 +49,7 @@ public class TestDomainPricingCustomLogic extends DomainPricingCustomLogic {
}
@Override
public FeesAndCredits customizeRenewPrice(RenewPriceParameters priceParameters)
throws EppException {
public FeesAndCredits customizeRenewPrice(RenewPriceParameters priceParameters) {
return (priceParameters.domainName().toString().startsWith("costly-renew"))
? addCustomFee(
priceParameters.feesAndCredits(), Fee.create(ONE_HUNDRED_BUCKS, FeeType.RENEW))
@ -59,8 +57,7 @@ public class TestDomainPricingCustomLogic extends DomainPricingCustomLogic {
}
@Override
public FeesAndCredits customizeTransferPrice(TransferPriceParameters priceParameters)
throws EppException {
public FeesAndCredits customizeTransferPrice(TransferPriceParameters priceParameters) {
return (priceParameters.domainName().toString().startsWith("expensive"))
? addCustomFee(
priceParameters.feesAndCredits(), Fee.create(ONE_HUNDRED_BUCKS, FeeType.TRANSFER))

View file

@ -102,7 +102,7 @@ public class DomainAllocateFlowTest
private HistoryEntry historyEntry;
@Before
public void initAllocateTest() throws Exception {
public void initAllocateTest() {
setEppInput(
"domain_allocate.xml",
ImmutableMap.of("APPLICATIONID", "2-TLD", "DOMAIN", "example-one.tld"));

View file

@ -150,7 +150,7 @@ public class DomainApplicationCreateFlowTest
}
@Before
public void setUp() throws Exception {
public void setUp() {
setEppInput("domain_create_sunrise_encoded_signed_mark.xml");
createTld("tld", TldState.SUNRISE);
persistResource(Registry.get("tld").asBuilder().setReservedLists(createReservedList()).build());
@ -250,7 +250,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_signedMarkCorrupt() throws Exception {
public void testFailure_signedMarkCorrupt() {
createTld("tld", TldState.SUNRUSH);
setEppInput("domain_create_sunrush_encoded_signed_mark_corrupt.xml");
persistContactsAndHosts();
@ -260,7 +260,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_signedMarkCertificateRevoked() throws Exception {
public void testFailure_signedMarkCertificateRevoked() {
createTld("tld", TldState.SUNRUSH);
setEppInput("domain_create_sunrush_encoded_signed_mark_revoked_cert.xml");
persistContactsAndHosts();
@ -270,7 +270,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_signedMarkCertificateExpired() throws Exception {
public void testFailure_signedMarkCertificateExpired() {
createTld("tld", TldState.SUNRUSH);
setEppInput("domain_create_sunrush_encoded_signed_mark.xml");
persistContactsAndHosts();
@ -282,7 +282,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_signedMarkCertificateNotYetValid() throws Exception {
public void testFailure_signedMarkCertificateNotYetValid() {
createTld("tld", TldState.SUNRUSH);
setEppInput("domain_create_sunrush_encoded_signed_mark.xml");
persistContactsAndHosts();
@ -294,7 +294,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_signedMarkCertificateCorrupt() throws Exception {
public void testFailure_signedMarkCertificateCorrupt() {
useTmchProdCert();
createTld("tld", TldState.SUNRUSH);
setEppInput("domain_create_sunrush_encoded_signed_mark_certificate_corrupt.xml");
@ -314,7 +314,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_signedMarkCertificateSignature() throws Exception {
public void testFailure_signedMarkCertificateSignature() {
useTmchProdCert();
createTld("tld", TldState.SUNRUSH);
setEppInput("domain_create_sunrush_encoded_signed_mark.xml");
@ -326,7 +326,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_signedMarkSignature() throws Exception {
public void testFailure_signedMarkSignature() {
createTld("tld", TldState.SUNRUSH);
setEppInput("domain_create_sunrush_encoded_signed_mark_signature_corrupt.xml");
persistContactsAndHosts();
@ -408,7 +408,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationReservedAllowedInSunrise() throws Exception {
public void testFailure_landrushApplicationReservedAllowedInSunrise() {
createTld("tld", TldState.SUNRUSH);
persistResource(
Registry.get("tld")
@ -423,7 +423,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationPremiumBlocked() throws Exception {
public void testFailure_landrushApplicationPremiumBlocked() {
createTld("example", TldState.SUNRUSH);
setEppInput("domain_create_landrush_premium.xml");
persistContactsAndHosts();
@ -435,8 +435,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushFeeNotProvidedOnPremiumName_whenRegistryRequiresFeeAcking()
throws Exception {
public void testFailure_landrushFeeNotProvidedOnPremiumName_whenRegistryRequiresFeeAcking() {
createTld("example", TldState.SUNRUSH);
setEppInput("domain_create_landrush_premium.xml");
persistContactsAndHosts();
@ -446,8 +445,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushFeeNotProvidedOnPremiumName_whenRegistrarRequiresFeeAcking()
throws Exception {
public void testFailure_landrushFeeNotProvidedOnPremiumName_whenRegistrarRequiresFeeAcking() {
createTld("example", TldState.SUNRUSH);
persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(false).build());
persistResource(
@ -561,7 +559,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationWithRefundableFee_v06() throws Exception {
public void testFailure_landrushApplicationWithRefundableFee_v06() {
createTld("tld", TldState.LANDRUSH);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -571,7 +569,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationWithRefundableFee_v11() throws Exception {
public void testFailure_landrushApplicationWithRefundableFee_v11() {
createTld("tld", TldState.LANDRUSH);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -582,7 +580,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationWithRefundableFee_v12() throws Exception {
public void testFailure_landrushApplicationWithRefundableFee_v12() {
createTld("tld", TldState.LANDRUSH);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -593,7 +591,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationWithGracePeriodFee_v06() throws Exception {
public void testFailure_landrushApplicationWithGracePeriodFee_v06() {
createTld("tld", TldState.LANDRUSH);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -604,7 +602,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationWithGracePeriodFee_v11() throws Exception {
public void testFailure_landrushApplicationWithGracePeriodFee_v11() {
createTld("tld", TldState.LANDRUSH);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -615,7 +613,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationWithGracePeriodFee_v12() throws Exception {
public void testFailure_landrushApplicationWithGracePeriodFee_v12() {
createTld("tld", TldState.LANDRUSH);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -626,7 +624,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationWithAppliedFee_v06() throws Exception {
public void testFailure_landrushApplicationWithAppliedFee_v06() {
createTld("tld", TldState.LANDRUSH);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -636,7 +634,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationWithAppliedFee_v11() throws Exception {
public void testFailure_landrushApplicationWithAppliedFee_v11() {
createTld("tld", TldState.LANDRUSH);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -646,7 +644,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushApplicationWithAppliedFee_v12() throws Exception {
public void testFailure_landrushApplicationWithAppliedFee_v12() {
createTld("tld", TldState.LANDRUSH);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -757,7 +755,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_missingMarks() throws Exception {
public void testFailure_missingMarks() {
setEppInput("domain_create_sunrise_without_marks.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -767,7 +765,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_suspendedRegistrarCantCreateDomainApplication() throws Exception {
public void testFailure_suspendedRegistrarCantCreateDomainApplication() {
setEppInput("domain_create_sunrise_encoded_signed_mark.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -784,7 +782,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_sunriseApplicationInLandrush() throws Exception {
public void testFailure_sunriseApplicationInLandrush() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_signed_mark.xml");
persistContactsAndHosts();
@ -795,7 +793,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_smdRevoked() throws Exception {
public void testFailure_smdRevoked() {
SignedMarkRevocationList.create(clock.nowUtc(), ImmutableMap.of(SMD_ID, clock.nowUtc())).save();
persistContactsAndHosts();
clock.advanceOneMilli();
@ -804,7 +802,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_tooManyNameservers() throws Exception {
public void testFailure_tooManyNameservers() {
createTld("tld", TldState.SUNRUSH);
setEppInput("domain_create_sunrush_14_nameservers.xml");
persistContactsAndHosts();
@ -814,7 +812,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_secDnsMaxSigLife() throws Exception {
public void testFailure_secDnsMaxSigLife() {
setEppInput("domain_create_sunrise_with_secdns_maxsiglife.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -823,7 +821,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_secDnsTooManyDsRecords() throws Exception {
public void testFailure_secDnsTooManyDsRecords() {
setEppInput("domain_create_sunrise_signed_mark_with_secdns_9_records.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -832,7 +830,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_wrongExtension() throws Exception {
public void testFailure_wrongExtension() {
setEppInput("domain_create_sunrise_wrong_extension.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -841,7 +839,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_reserved() throws Exception {
public void testFailure_reserved() {
setEppInput("domain_create_sunrise_signed_mark_reserved.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -981,7 +979,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushLrpApplication_badToken() throws Exception {
public void testFailure_landrushLrpApplication_badToken() {
createTld("tld", TldState.LANDRUSH);
persistResource(
Registry.get("tld")
@ -1002,7 +1000,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushLrpApplication_tokenForWrongTld() throws Exception {
public void testFailure_landrushLrpApplication_tokenForWrongTld() {
createTld("tld", TldState.LANDRUSH);
persistResource(
Registry.get("tld")
@ -1026,7 +1024,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushLrpApplication_usedToken() throws Exception {
public void testFailure_landrushLrpApplication_usedToken() {
createTld("tld", TldState.LANDRUSH);
persistResource(
Registry.get("tld")
@ -1095,7 +1093,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrush_duringLrpWithMissingToken() throws Exception {
public void testFailure_landrush_duringLrpWithMissingToken() {
createTld("tld", TldState.LANDRUSH);
persistResource(
Registry.get("tld")
@ -1110,7 +1108,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_landrushWithPeriodInMonths() throws Exception {
public void testFailure_landrushWithPeriodInMonths() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_months.xml");
persistContactsAndHosts();
@ -1120,7 +1118,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_missingHost() throws Exception {
public void testFailure_missingHost() {
persistActiveHost("ns1.example.net");
persistActiveContact("jd1234");
persistActiveContact("sh8013");
@ -1130,7 +1128,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_missingContact() throws Exception {
public void testFailure_missingContact() {
persistActiveHost("ns1.example.net");
persistActiveHost("ns2.example.net");
persistActiveContact("jd1234");
@ -1140,7 +1138,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_wrongTld() throws Exception {
public void testFailure_wrongTld() {
deleteTld("tld");
createTld("foo", TldState.SUNRISE);
persistContactsAndHosts();
@ -1150,7 +1148,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_predelegation() throws Exception {
public void testFailure_predelegation() {
createTld("tld", TldState.PREDELEGATION);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1159,7 +1157,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_notAuthorizedForTld() throws Exception {
public void testFailure_notAuthorizedForTld() {
persistResource(
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
persistContactsAndHosts();
@ -1168,7 +1166,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_sunrush() throws Exception {
public void testFailure_sunrush() {
createTld("tld", TldState.SUNRUSH);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1177,7 +1175,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_quietPeriod() throws Exception {
public void testFailure_quietPeriod() {
createTld("tld", TldState.QUIET_PERIOD);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1186,7 +1184,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_generalAvailability() throws Exception {
public void testFailure_generalAvailability() {
createTld("tld", TldState.GENERAL_AVAILABILITY);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1195,7 +1193,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_startDateSunrise() throws Exception {
public void testFailure_startDateSunrise() {
createTld("tld", TldState.START_DATE_SUNRISE);
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1204,7 +1202,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_wrongDeclaredPhase() throws Exception {
public void testFailure_wrongDeclaredPhase() {
setEppInput("domain_create_landrush_signed_mark.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1270,7 +1268,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_duplicateContact() throws Exception {
public void testFailure_duplicateContact() {
setEppInput("domain_create_sunrise_duplicate_contact.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1279,7 +1277,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_missingContactType() throws Exception {
public void testFailure_missingContactType() {
setEppInput("domain_create_sunrise_missing_contact_type.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1289,7 +1287,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_noMatchingMarks() throws Exception {
public void testFailure_noMatchingMarks() {
setEppInput("domain_create_sunrise_no_matching_marks.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1298,7 +1296,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_beforeMarkCreationTime() throws Exception {
public void testFailure_beforeMarkCreationTime() {
// If we move now back in time a bit, the mark will not have gone into effect yet.
clock.setTo(DateTime.parse("2013-08-09T10:05:59Z").minusSeconds(1));
persistContactsAndHosts();
@ -1308,7 +1306,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_atMarkExpirationTime() throws Exception {
public void testFailure_atMarkExpirationTime() {
// Move time forward to the mark expiration time.
clock.setTo(DateTime.parse("2017-07-23T22:00:00.000Z"));
persistContactsAndHosts();
@ -1318,7 +1316,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_hexEncoding() throws Exception {
public void testFailure_hexEncoding() {
setEppInput("domain_create_sunrise_hex_encoding.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1328,7 +1326,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_badEncoding() throws Exception {
public void testFailure_badEncoding() {
setEppInput("domain_create_sunrise_bad_encoding.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1337,7 +1335,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_badEncodedXml() throws Exception {
public void testFailure_badEncodedXml() {
setEppInput("domain_create_sunrise_bad_encoded_xml.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1346,7 +1344,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_badIdn() throws Exception {
public void testFailure_badIdn() {
createTld("xn--q9jyb4c", TldState.SUNRUSH);
setEppInput("domain_create_sunrush_bad_idn_minna.xml");
persistContactsAndHosts();
@ -1356,7 +1354,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_badValidatorId() throws Exception {
public void testFailure_badValidatorId() {
createTld("tld", TldState.SUNRUSH);
setEppInput("domain_create_sunrush_bad_validator_id.xml");
persistClaimsList(ImmutableMap.of("exampleone", CLAIMS_KEY));
@ -1367,7 +1365,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_signedMark() throws Exception {
public void testFailure_signedMark() {
setEppInput("domain_create_sunrise_signed_mark.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1376,7 +1374,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_codeMark() throws Exception {
public void testFailure_codeMark() {
setEppInput("domain_create_sunrise_code_with_mark.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1385,7 +1383,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_emptyEncodedMarkData() throws Exception {
public void testFailure_emptyEncodedMarkData() {
setEppInput("domain_create_sunrise_empty_encoded_signed_mark.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1394,7 +1392,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_signedMarkAndNotice() throws Exception {
public void testFailure_signedMarkAndNotice() {
setEppInput("domain_create_sunrise_signed_mark_and_notice.xml");
persistClaimsList(ImmutableMap.of("exampleone", CLAIMS_KEY));
persistContactsAndHosts();
@ -1405,7 +1403,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_twoSignedMarks() throws Exception {
public void testFailure_twoSignedMarks() {
setEppInput("domain_create_sunrise_two_signed_marks.xml");
persistContactsAndHosts();
clock.advanceOneMilli();
@ -1414,7 +1412,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_missingClaimsNotice() throws Exception {
public void testFailure_missingClaimsNotice() {
createTld("tld", TldState.SUNRUSH);
persistClaimsList(ImmutableMap.of("test-validate", CLAIMS_KEY));
setEppInput("domain_create_sunrush.xml");
@ -1425,7 +1423,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_claimsNoticeProvided_nameNotOnClaimsList() throws Exception {
public void testFailure_claimsNoticeProvided_nameNotOnClaimsList() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_claim_notice.xml");
persistContactsAndHosts();
@ -1435,7 +1433,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_claimsNoticeProvided_claimsPeriodEnded() throws Exception {
public void testFailure_claimsNoticeProvided_claimsPeriodEnded() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_claim_notice.xml");
persistClaimsList(ImmutableMap.of("example-one", CLAIMS_KEY));
@ -1446,7 +1444,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_expiredClaim() throws Exception {
public void testFailure_expiredClaim() {
createTld("tld", TldState.SUNRUSH);
clock.setTo(DateTime.parse("2010-08-17T09:00:00.0Z"));
setEppInput("domain_create_sunrush_claim_notice.xml");
@ -1458,7 +1456,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_expiredAcceptance() throws Exception {
public void testFailure_expiredAcceptance() {
createTld("tld", TldState.SUNRUSH);
clock.setTo(DateTime.parse("2009-09-16T09:00:00.0Z"));
setEppInput("domain_create_sunrush_claim_notice.xml");
@ -1470,7 +1468,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_malformedTcnIdWrongLength() throws Exception {
public void testFailure_malformedTcnIdWrongLength() {
createTld("tld", TldState.SUNRUSH);
persistClaimsList(ImmutableMap.of("example-one", CLAIMS_KEY));
clock.setTo(DateTime.parse("2009-08-16T09:00:00.0Z"));
@ -1482,7 +1480,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_malformedTcnIdBadChar() throws Exception {
public void testFailure_malformedTcnIdBadChar() {
createTld("tld", TldState.SUNRUSH);
persistClaimsList(ImmutableMap.of("example-one", CLAIMS_KEY));
clock.setTo(DateTime.parse("2009-08-16T09:00:00.0Z"));
@ -1494,7 +1492,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_badTcnIdChecksum() throws Exception {
public void testFailure_badTcnIdChecksum() {
createTld("tld", TldState.SUNRUSH);
clock.setTo(DateTime.parse("2009-08-16T09:00:00.0Z"));
setEppInput("domain_create_sunrush_bad_checksum_claim_notice.xml");
@ -1506,7 +1504,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_wrongFeeLandrushApplication_v06() throws Exception {
public void testFailure_wrongFeeLandrushApplication_v06() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
persistResource(
@ -1518,7 +1516,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_wrongFeeLandrushApplication_v11() throws Exception {
public void testFailure_wrongFeeLandrushApplication_v11() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_fee.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
persistResource(
@ -1530,7 +1528,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_wrongFeeLandrushApplication_v12() throws Exception {
public void testFailure_wrongFeeLandrushApplication_v12() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_fee.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
persistResource(
@ -1542,7 +1540,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_wrongCurrency_v06() throws Exception {
public void testFailure_wrongCurrency_v06() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
persistResource(
@ -1562,7 +1560,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_wrongCurrency_v11() throws Exception {
public void testFailure_wrongCurrency_v11() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_fee.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
persistResource(
@ -1582,7 +1580,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_wrongCurrency_v12() throws Exception {
public void testFailure_wrongCurrency_v12() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_fee.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
persistResource(
@ -1602,7 +1600,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_feeGivenInWrongScale_v06() throws Exception {
public void testFailure_feeGivenInWrongScale_v06() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
persistContactsAndHosts();
@ -1612,7 +1610,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_feeGivenInWrongScale_v11() throws Exception {
public void testFailure_feeGivenInWrongScale_v11() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
persistContactsAndHosts();
@ -1622,7 +1620,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_feeGivenInWrongScale_v12() throws Exception {
public void testFailure_feeGivenInWrongScale_v12() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
persistContactsAndHosts();
@ -1647,7 +1645,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_registrantNotWhitelisted() throws Exception {
public void testFailure_registrantNotWhitelisted() {
persistActiveContact("someone");
persistContactsAndHosts();
persistResource(
@ -1661,7 +1659,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_nameserverNotWhitelisted() throws Exception {
public void testFailure_nameserverNotWhitelisted() {
persistContactsAndHosts();
persistResource(
Registry.get("tld")
@ -1695,7 +1693,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_emptyNameserverFailsWhitelist() throws Exception {
public void testFailure_emptyNameserverFailsWhitelist() {
setEppInput("domain_create_sunrise_encoded_signed_mark_no_hosts.xml");
persistResource(
Registry.get("tld")
@ -1731,7 +1729,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_domainNameserverRestricted_someNameserversDisallowed() throws Exception {
public void testFailure_domainNameserverRestricted_someNameserversDisallowed() {
persistResource(
Registry.get("tld")
.asBuilder()
@ -1748,7 +1746,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_domainNameserverRestricted_noNameserversAllowed() throws Exception {
public void testFailure_domainNameserverRestricted_noNameserversAllowed() {
setEppInput("domain_create_sunrise_encoded_signed_mark_no_hosts.xml");
persistResource(
Registry.get("tld")
@ -1789,7 +1787,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_domainNameserversDisallowed_tldNameserversAllowed() throws Exception {
public void testFailure_domainNameserversDisallowed_tldNameserversAllowed() {
persistResource(
Registry.get("tld")
.asBuilder()
@ -1809,7 +1807,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_domainNameserversAllowed_tldNameserversDisallowed() throws Exception {
public void testFailure_domainNameserversAllowed_tldNameserversDisallowed() {
persistResource(
Registry.get("tld")
.asBuilder()
@ -1829,7 +1827,7 @@ public class DomainApplicationCreateFlowTest
}
@Test
public void testFailure_max10Years() throws Exception {
public void testFailure_max10Years() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_landrush_11_years.xml");
persistContactsAndHosts();
@ -1838,8 +1836,7 @@ public class DomainApplicationCreateFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
private void doFailingDomainNameTest(String domainName, Class<? extends EppException> exception)
throws Exception {
private void doFailingDomainNameTest(String domainName, Class<? extends EppException> exception) {
setEppInput("domain_create_sunrise_signed_mark_uppercase.xml");
eppLoader.replaceAll("TEST-VALIDATE.tld", domainName);
persistContactsAndHosts();

View file

@ -151,7 +151,7 @@ public class DomainApplicationDeleteFlowTest
}
@Test
public void testFailure_unauthorizedClient() throws Exception {
public void testFailure_unauthorizedClient() {
sessionMetadata.setClientId("NewRegistrar");
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
EppException thrown = assertThrows(ResourceNotOwnedException.class, this::runFlow);
@ -168,7 +168,7 @@ public class DomainApplicationDeleteFlowTest
}
@Test
public void testFailure_notAuthorizedForTld() throws Exception {
public void testFailure_notAuthorizedForTld() {
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
persistResource(
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
@ -187,7 +187,7 @@ public class DomainApplicationDeleteFlowTest
}
@Test
public void testFailure_sunriseDuringLandrush() throws Exception {
public void testFailure_sunriseDuringLandrush() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_delete_application_landrush.xml", ImmutableMap.of("DOMAIN", "example.tld"));
persistResource(
@ -243,7 +243,7 @@ public class DomainApplicationDeleteFlowTest
}
@Test
public void testFailure_mismatchedPhase() throws Exception {
public void testFailure_mismatchedPhase() {
setEppInput("domain_delete_application_landrush.xml", ImmutableMap.of("DOMAIN", "example.tld"));
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
EppException thrown = assertThrows(LaunchPhaseMismatchException.class, this::runFlow);
@ -251,7 +251,7 @@ public class DomainApplicationDeleteFlowTest
}
@Test
public void testFailure_wrongExtension() throws Exception {
public void testFailure_wrongExtension() {
setEppInput("domain_delete_application_wrong_extension.xml");
persistActiveDomainApplication("example.tld");
EppException thrown = assertThrows(UnimplementedExtensionException.class, this::runFlow);
@ -259,7 +259,7 @@ public class DomainApplicationDeleteFlowTest
}
@Test
public void testFailure_predelegation() throws Exception {
public void testFailure_predelegation() {
createTld("tld", TldState.PREDELEGATION);
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
EppException thrown = assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow);
@ -267,7 +267,7 @@ public class DomainApplicationDeleteFlowTest
}
@Test
public void testFailure_quietPeriod() throws Exception {
public void testFailure_quietPeriod() {
createTld("tld", TldState.QUIET_PERIOD);
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
EppException thrown = assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow);
@ -275,7 +275,7 @@ public class DomainApplicationDeleteFlowTest
}
@Test
public void testFailure_generalAvailability() throws Exception {
public void testFailure_generalAvailability() {
createTld("tld", TldState.GENERAL_AVAILABILITY);
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
EppException thrown = assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow);
@ -283,7 +283,7 @@ public class DomainApplicationDeleteFlowTest
}
@Test
public void testFailure_startDateSunrise() throws Exception {
public void testFailure_startDateSunrise() {
createTld("tld", TldState.START_DATE_SUNRISE);
persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build());
EppException thrown = assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow);
@ -327,7 +327,7 @@ public class DomainApplicationDeleteFlowTest
}
@Test
public void testFailure_applicationIdForDifferentDomain() throws Exception {
public void testFailure_applicationIdForDifferentDomain() {
persistResource(newDomainApplication("invalid.tld").asBuilder().setRepoId("1-TLD").build());
EppException thrown = assertThrows(ApplicationDomainNameMismatchException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();

View file

@ -315,7 +315,7 @@ public class DomainApplicationInfoFlowTest
}
@Test
public void testFailure_applicationIdForDifferentDomain() throws Exception {
public void testFailure_applicationIdForDifferentDomain() {
persistResource(
new DomainApplication.Builder()
.setRepoId("123-TLD")

View file

@ -125,7 +125,7 @@ public class DomainApplicationUpdateFlowTest
.build());
}
private Builder newApplicationBuilder() throws Exception {
private Builder newApplicationBuilder() {
return newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD");
}
@ -430,7 +430,7 @@ public class DomainApplicationUpdateFlowTest
}
@Test
public void testFailure_wrongExtension() throws Exception {
public void testFailure_wrongExtension() {
setEppInput("domain_update_sunrise_wrong_extension.xml");
EppException thrown = assertThrows(UnimplementedExtensionException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
@ -908,7 +908,7 @@ public class DomainApplicationUpdateFlowTest
}
@Test
public void testFailure_customPricingLogic_feeMismatch() throws Exception {
public void testFailure_customPricingLogic_feeMismatch() {
persistReferencedEntities();
persistResource(
newDomainApplication("non-free-update.tld").asBuilder().setRepoId("1-ROID").build());

View file

@ -81,7 +81,7 @@ public class DomainCheckFlowTest
setEppInput("domain_check_one_tld.xml");
}
private ReservedList createReservedList() throws Exception {
private ReservedList createReservedList() {
return persistReservedList(
"tld-reserved",
"reserved,FULLY_BLOCKED",
@ -328,21 +328,21 @@ public class DomainCheckFlowTest
}
@Test
public void testFailure_tooManyIds() throws Exception {
public void testFailure_tooManyIds() {
setEppInput("domain_check_51.xml");
EppException thrown = assertThrows(TooManyResourceChecksException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_wrongTld() throws Exception {
public void testFailure_wrongTld() {
setEppInput("domain_check.xml");
EppException thrown = assertThrows(TldDoesNotExistException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_notAuthorizedForTld() throws Exception {
public void testFailure_notAuthorizedForTld() {
persistResource(
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
EppException thrown = assertThrows(NotAuthorizedForTldException.class, this::runFlow);
@ -358,8 +358,8 @@ public class DomainCheckFlowTest
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_check_one_tld_response.xml"));
}
private void doFailingBadLabelTest(String label, Class<? extends EppException> expectedException)
throws Exception {
private void doFailingBadLabelTest(
String label, Class<? extends EppException> expectedException) {
setEppInput("domain_check_template.xml", ImmutableMap.of("LABEL", label));
EppException thrown = assertThrows(expectedException, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
@ -444,7 +444,7 @@ public class DomainCheckFlowTest
}
@Test
public void testFailure_predelegation() throws Exception {
public void testFailure_predelegation() {
createTld("tld", TldState.PREDELEGATION);
EppException thrown = assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
@ -761,84 +761,84 @@ public class DomainCheckFlowTest
}
@Test
public void testFeeExtension_wrongCurrency_v06() throws Exception {
public void testFeeExtension_wrongCurrency_v06() {
setEppInput("domain_check_fee_euro_v06.xml");
EppException thrown = assertThrows(CurrencyUnitMismatchException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_wrongCurrency_v11() throws Exception {
public void testFeeExtension_wrongCurrency_v11() {
setEppInput("domain_check_fee_euro_v11.xml");
EppException thrown = assertThrows(CurrencyUnitMismatchException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_wrongCurrency_v12() throws Exception {
public void testFeeExtension_wrongCurrency_v12() {
setEppInput("domain_check_fee_euro_v12.xml");
EppException thrown = assertThrows(CurrencyUnitMismatchException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_periodNotInYears_v06() throws Exception {
public void testFeeExtension_periodNotInYears_v06() {
setEppInput("domain_check_fee_bad_period_v06.xml");
EppException thrown = assertThrows(BadPeriodUnitException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_periodNotInYears_v11() throws Exception {
public void testFeeExtension_periodNotInYears_v11() {
setEppInput("domain_check_fee_bad_period_v11.xml");
EppException thrown = assertThrows(BadPeriodUnitException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_periodNotInYears_v12() throws Exception {
public void testFeeExtension_periodNotInYears_v12() {
setEppInput("domain_check_fee_bad_period_v12.xml");
EppException thrown = assertThrows(BadPeriodUnitException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_commandWithPhase_v06() throws Exception {
public void testFeeExtension_commandWithPhase_v06() {
setEppInput("domain_check_fee_command_phase_v06.xml");
EppException thrown = assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_commandWithPhase_v11() throws Exception {
public void testFeeExtension_commandWithPhase_v11() {
setEppInput("domain_check_fee_command_phase_v11.xml");
EppException thrown = assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_commandWithPhase_v12() throws Exception {
public void testFeeExtension_commandWithPhase_v12() {
setEppInput("domain_check_fee_command_phase_v12.xml");
EppException thrown = assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_commandSubphase_v06() throws Exception {
public void testFeeExtension_commandSubphase_v06() {
setEppInput("domain_check_fee_command_subphase_v06.xml");
EppException thrown = assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_commandSubphase_v11() throws Exception {
public void testFeeExtension_commandSubphase_v11() {
setEppInput("domain_check_fee_command_subphase_v11.xml");
EppException thrown = assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_commandSubphase_v12() throws Exception {
public void testFeeExtension_commandSubphase_v12() {
setEppInput("domain_check_fee_command_subphase_v12.xml");
EppException thrown = assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
@ -846,7 +846,7 @@ public class DomainCheckFlowTest
// This test is only relevant for v06, since domain names are not specified in v11 or v12.
@Test
public void testFeeExtension_feeCheckNotInAvailabilityCheck() throws Exception {
public void testFeeExtension_feeCheckNotInAvailabilityCheck() {
setEppInput("domain_check_fee_not_in_avail.xml");
EppException thrown =
assertThrows(OnlyCheckedNamesCanBeFeeCheckedException.class, this::runFlow);
@ -854,84 +854,84 @@ public class DomainCheckFlowTest
}
@Test
public void testFeeExtension_multiyearRestore_v06() throws Exception {
public void testFeeExtension_multiyearRestore_v06() {
setEppInput("domain_check_fee_multiyear_restore_v06.xml");
EppException thrown = assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_multiyearRestore_v11() throws Exception {
public void testFeeExtension_multiyearRestore_v11() {
setEppInput("domain_check_fee_multiyear_restore_v11.xml");
EppException thrown = assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_multiyearRestore_v12() throws Exception {
public void testFeeExtension_multiyearRestore_v12() {
setEppInput("domain_check_fee_multiyear_restore_v12.xml");
EppException thrown = assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_multiyearTransfer_v06() throws Exception {
public void testFeeExtension_multiyearTransfer_v06() {
setEppInput("domain_check_fee_multiyear_transfer_v06.xml");
EppException thrown = assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_multiyearTransfer_v11() throws Exception {
public void testFeeExtension_multiyearTransfer_v11() {
setEppInput("domain_check_fee_multiyear_transfer_v11.xml");
EppException thrown = assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_multiyearTransfer_v12() throws Exception {
public void testFeeExtension_multiyearTransfer_v12() {
setEppInput("domain_check_fee_multiyear_transfer_v12.xml");
EppException thrown = assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_unknownCommand_v06() throws Exception {
public void testFeeExtension_unknownCommand_v06() {
setEppInput("domain_check_fee_unknown_command_v06.xml");
EppException thrown = assertThrows(UnknownFeeCommandException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_unknownCommand_v11() throws Exception {
public void testFeeExtension_unknownCommand_v11() {
setEppInput("domain_check_fee_unknown_command_v11.xml");
EppException thrown = assertThrows(UnknownFeeCommandException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_unknownCommand_v12() throws Exception {
public void testFeeExtension_unknownCommand_v12() {
setEppInput("domain_check_fee_unknown_command_v12.xml");
EppException thrown = assertThrows(UnknownFeeCommandException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_invalidCommand_v06() throws Exception {
public void testFeeExtension_invalidCommand_v06() {
setEppInput("domain_check_fee_invalid_command_v06.xml");
EppException thrown = assertThrows(UnknownFeeCommandException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_invalidCommand_v11() throws Exception {
public void testFeeExtension_invalidCommand_v11() {
setEppInput("domain_check_fee_invalid_command_v11.xml");
EppException thrown = assertThrows(UnknownFeeCommandException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFeeExtension_invalidCommand_v12() throws Exception {
public void testFeeExtension_invalidCommand_v12() {
setEppInput("domain_check_fee_invalid_command_v12.xml");
EppException thrown = assertThrows(UnknownFeeCommandException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
@ -978,7 +978,7 @@ public class DomainCheckFlowTest
@Ignore
@Test
public void testSuccess_feeCheck_multipleRanges() throws Exception {
public void testSuccess_feeCheck_multipleRanges() {
// TODO: If at some point we have more than one type of fees that are time dependent, populate
// this test to test if the notAfter date is the earliest of the end points of the ranges.
}

View file

@ -101,21 +101,21 @@ public class DomainClaimsCheckFlowTest
}
@Test
public void testFailure_TooManyIds() throws Exception {
public void testFailure_TooManyIds() {
setEppInput("domain_check_claims_51.xml");
EppException thrown = assertThrows(TooManyResourceChecksException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_tldDoesntExist() throws Exception {
public void testFailure_tldDoesntExist() {
setEppInput("domain_check_claims_bad_tld.xml");
EppException thrown = assertThrows(TldDoesNotExistException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_notAuthorizedForTld() throws Exception {
public void testFailure_notAuthorizedForTld() {
persistResource(
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
EppException thrown = assertThrows(NotAuthorizedForTldException.class, this::runFlow);
@ -136,7 +136,7 @@ public class DomainClaimsCheckFlowTest
}
@Test
public void testFailure_predelgation() throws Exception {
public void testFailure_predelgation() {
createTld("tld", TldState.PREDELEGATION);
setEppInput("domain_check_claims.xml");
EppException thrown = assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow);
@ -144,7 +144,7 @@ public class DomainClaimsCheckFlowTest
}
@Test
public void testFailure_sunrise() throws Exception {
public void testFailure_sunrise() {
createTld("tld", TldState.SUNRISE);
setEppInput("domain_check_claims.xml");
EppException thrown = assertThrows(DomainClaimsCheckNotAllowedInSunrise.class, this::runFlow);
@ -152,7 +152,7 @@ public class DomainClaimsCheckFlowTest
}
@Test
public void testFailure_allocationToken() throws Exception {
public void testFailure_allocationToken() {
createTld("tld", TldState.SUNRISE);
setEppInput("domain_check_claims_allocationtoken.xml");
EppException thrown =
@ -161,7 +161,7 @@ public class DomainClaimsCheckFlowTest
}
@Test
public void testFailure_multipleTlds_oneHasEndedClaims() throws Exception {
public void testFailure_multipleTlds_oneHasEndedClaims() {
createTlds("tld1", "tld2");
persistResource(
Registry.get("tld2").asBuilder().setClaimsPeriodEnd(clock.nowUtc().minusMillis(1)).build());

View file

@ -171,7 +171,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Before
public void initCreateTest() throws Exception {
public void initCreateTest() {
createTld("tld");
persistResource(
Registry.get("tld")
@ -394,7 +394,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_invalidAllocationToken() throws Exception {
public void testFailure_invalidAllocationToken() {
setEppInput("domain_create_allocationtoken.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(InvalidAllocationTokenException.class, this::runFlow);
@ -402,7 +402,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_alreadyRedemeedAllocationToken() throws Exception {
public void testFailure_alreadyRedemeedAllocationToken() {
setEppInput("domain_create_allocationtoken.xml");
persistContactsAndHosts();
persistResource(
@ -445,7 +445,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_domainNameExistsAsTld_lowercase() throws Exception {
public void testFailure_domainNameExistsAsTld_lowercase() {
createTlds("foo.tld", "tld");
setEppInput("domain_create_wildcard.xml", ImmutableMap.of("DOMAIN", "foo.tld"));
persistContactsAndHosts();
@ -454,7 +454,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_domainNameExistsAsTld_uppercase() throws Exception {
public void testFailure_domainNameExistsAsTld_uppercase() {
createTlds("foo.tld", "tld");
setEppInput("domain_create_wildcard.xml", ImmutableMap.of("DOMAIN", "FOO.TLD"));
persistContactsAndHosts();
@ -531,7 +531,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_generalAvailability_withEncodedSignedMark() throws Exception {
public void testFailure_generalAvailability_withEncodedSignedMark() {
createTld("tld", TldState.GENERAL_AVAILABILITY);
clock.setTo(DateTime.parse("2014-09-09T09:09:09Z"));
setEppInput(
@ -544,8 +544,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_generalAvailability_superuserMismatchedEncodedSignedMark()
throws Exception {
public void testFailure_generalAvailability_superuserMismatchedEncodedSignedMark() {
createTld("tld", TldState.GENERAL_AVAILABILITY);
clock.setTo(DateTime.parse("2014-09-09T09:09:09Z"));
setEppInput(
@ -606,7 +605,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_refundableFee_v06() throws Exception {
public void testFailure_refundableFee_v06() {
setEppInput("domain_create_fee_refundable.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
persistContactsAndHosts();
EppException thrown = assertThrows(UnsupportedFeeAttributeException.class, this::runFlow);
@ -614,7 +613,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_refundableFee_v11() throws Exception {
public void testFailure_refundableFee_v11() {
setEppInput("domain_create_fee_refundable.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
persistContactsAndHosts();
EppException thrown = assertThrows(UnsupportedFeeAttributeException.class, this::runFlow);
@ -622,7 +621,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_refundableFee_v12() throws Exception {
public void testFailure_refundableFee_v12() {
setEppInput("domain_create_fee_refundable.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
persistContactsAndHosts();
EppException thrown = assertThrows(UnsupportedFeeAttributeException.class, this::runFlow);
@ -630,7 +629,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_gracePeriodFee_v06() throws Exception {
public void testFailure_gracePeriodFee_v06() {
setEppInput("domain_create_fee_grace_period.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
persistContactsAndHosts();
EppException thrown = assertThrows(UnsupportedFeeAttributeException.class, this::runFlow);
@ -638,7 +637,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_gracePeriodFee_v11() throws Exception {
public void testFailure_gracePeriodFee_v11() {
setEppInput("domain_create_fee_grace_period.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
persistContactsAndHosts();
EppException thrown = assertThrows(UnsupportedFeeAttributeException.class, this::runFlow);
@ -646,7 +645,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_gracePeriodFee_v12() throws Exception {
public void testFailure_gracePeriodFee_v12() {
setEppInput("domain_create_fee_grace_period.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
persistContactsAndHosts();
EppException thrown = assertThrows(UnsupportedFeeAttributeException.class, this::runFlow);
@ -654,7 +653,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_appliedFee_v06() throws Exception {
public void testFailure_appliedFee_v06() {
setEppInput("domain_create_fee_applied.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
persistContactsAndHosts();
EppException thrown = assertThrows(UnsupportedFeeAttributeException.class, this::runFlow);
@ -662,7 +661,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_appliedFee_v11() throws Exception {
public void testFailure_appliedFee_v11() {
setEppInput("domain_create_fee_applied.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
persistContactsAndHosts();
EppException thrown = assertThrows(UnsupportedFeeAttributeException.class, this::runFlow);
@ -670,7 +669,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_appliedFee_v12() throws Exception {
public void testFailure_appliedFee_v12() {
setEppInput("domain_create_fee_applied.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
persistContactsAndHosts();
EppException thrown = assertThrows(UnsupportedFeeAttributeException.class, this::runFlow);
@ -694,7 +693,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_metadataNotFromTool() throws Exception {
public void testFailure_metadataNotFromTool() {
setEppInput("domain_create_metadata.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(OnlyToolCanPassMetadataException.class, this::runFlow);
@ -702,7 +701,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_lrp_badToken() throws Exception {
public void testFailure_lrp_badToken() {
persistResource(
Registry.get("tld")
.asBuilder()
@ -723,7 +722,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_lrp_noToken() throws Exception {
public void testFailure_lrp_noToken() {
persistResource(
Registry.get("tld")
.asBuilder()
@ -854,7 +853,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_periodInMonths() throws Exception {
public void testFailure_periodInMonths() {
setEppInput("domain_create_months.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(BadPeriodUnitException.class, this::runFlow);
@ -894,7 +893,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_claimsNoticeProvided_nameNotOnClaimsList() throws Exception {
public void testFailure_claimsNoticeProvided_nameNotOnClaimsList() {
setEppInput("domain_create_claim_notice.xml");
persistClaimsList(ImmutableMap.of());
persistContactsAndHosts();
@ -903,7 +902,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_claimsNoticeProvided_claimsPeriodEnded() throws Exception {
public void testFailure_claimsNoticeProvided_claimsPeriodEnded() {
setEppInput("domain_create_claim_notice.xml");
persistClaimsList(ImmutableMap.of("example-one", CLAIMS_KEY));
persistContactsAndHosts();
@ -913,7 +912,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_tooManyNameservers() throws Exception {
public void testFailure_tooManyNameservers() {
setEppInput("domain_create_14_nameservers.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(TooManyNameserversException.class, this::runFlow);
@ -921,7 +920,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_secDnsMaxSigLife() throws Exception {
public void testFailure_secDnsMaxSigLife() {
setEppInput("domain_create_dsdata.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(MaxSigLifeNotSupportedException.class, this::runFlow);
@ -929,7 +928,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_secDnsTooManyDsRecords() throws Exception {
public void testFailure_secDnsTooManyDsRecords() {
setEppInput("domain_create_dsdata_9_records.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(TooManyDsRecordsException.class, this::runFlow);
@ -937,7 +936,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_wrongExtension() throws Exception {
public void testFailure_wrongExtension() {
setEppInput("domain_create_wrong_extension.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(UnimplementedExtensionException.class, this::runFlow);
@ -945,7 +944,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_wrongFeeAmount_v06() throws Exception {
public void testFailure_wrongFeeAmount_v06() {
setEppInput("domain_create_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
persistResource(
Registry.get("tld").asBuilder().setCreateBillingCost(Money.of(USD, 20)).build());
@ -955,7 +954,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_wrongFeeAmount_v11() throws Exception {
public void testFailure_wrongFeeAmount_v11() {
setEppInput("domain_create_fee.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
persistResource(
Registry.get("tld").asBuilder().setCreateBillingCost(Money.of(USD, 20)).build());
@ -965,7 +964,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_wrongFeeAmount_v12() throws Exception {
public void testFailure_wrongFeeAmount_v12() {
setEppInput("domain_create_fee.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
persistResource(
Registry.get("tld").asBuilder().setCreateBillingCost(Money.of(USD, 20)).build());
@ -975,7 +974,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_wrongCurrency_v06() throws Exception {
public void testFailure_wrongCurrency_v06() {
setEppInput("domain_create_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
persistResource(
Registry.get("tld")
@ -993,7 +992,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_wrongCurrency_v11() throws Exception {
public void testFailure_wrongCurrency_v11() {
setEppInput("domain_create_fee.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
persistResource(
Registry.get("tld")
@ -1011,7 +1010,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_wrongCurrency_v12() throws Exception {
public void testFailure_wrongCurrency_v12() {
setEppInput("domain_create_fee.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
persistResource(
Registry.get("tld")
@ -1043,7 +1042,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_reserved() throws Exception {
public void testFailure_reserved() {
setEppInput("domain_create_reserved.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(DomainReservedException.class, this::runFlow);
@ -1051,7 +1050,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_anchorTenantViaAuthCode_wrongAuthCode() throws Exception {
public void testFailure_anchorTenantViaAuthCode_wrongAuthCode() {
setEppInput("domain_create_anchor_wrong_authcode.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(DomainReservedException.class, this::runFlow);
@ -1059,7 +1058,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_anchorTenantViaAuthCode_notTwoYearPeriod() throws Exception {
public void testFailure_anchorTenantViaAuthCode_notTwoYearPeriod() {
setEppInput("domain_create_anchor_authcode_invalid_years.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(AnchorTenantCreatePeriodException.class, this::runFlow);
@ -1157,7 +1156,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_missingHost() throws Exception {
public void testFailure_missingHost() {
persistActiveHost("ns1.example.net");
persistActiveContact("jd1234");
persistActiveContact("sh8013");
@ -1167,7 +1166,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_pendingDeleteHost() throws Exception {
public void testFailure_pendingDeleteHost() {
persistActiveHost("ns1.example.net");
persistActiveContact("jd1234");
persistActiveContact("sh8013");
@ -1211,7 +1210,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_missingContact() throws Exception {
public void testFailure_missingContact() {
persistActiveHost("ns1.example.net");
persistActiveHost("ns2.example.net");
persistActiveContact("jd1234");
@ -1221,7 +1220,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_pendingDeleteContact() throws Exception {
public void testFailure_pendingDeleteContact() {
persistActiveHost("ns1.example.net");
persistActiveHost("ns2.example.net");
persistActiveContact("sh8013");
@ -1237,7 +1236,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_wrongTld() throws Exception {
public void testFailure_wrongTld() {
persistContactsAndHosts("net");
deleteTld("tld");
EppException thrown = assertThrows(TldDoesNotExistException.class, this::runFlow);
@ -1245,7 +1244,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_predelegation() throws Exception {
public void testFailure_predelegation() {
createTld("tld", TldState.PREDELEGATION);
persistContactsAndHosts();
EppException thrown =
@ -1254,7 +1253,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_sunrise() throws Exception {
public void testFailure_sunrise() {
createTld("tld", TldState.SUNRISE);
persistContactsAndHosts();
EppException thrown =
@ -1263,7 +1262,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_sunrush() throws Exception {
public void testFailure_sunrush() {
createTld("tld", TldState.SUNRUSH);
persistContactsAndHosts();
EppException thrown =
@ -1272,7 +1271,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_landrush() throws Exception {
public void testFailure_landrush() {
createTld("tld", TldState.LANDRUSH);
persistContactsAndHosts();
EppException thrown =
@ -1281,7 +1280,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_startDateSunrise_missingLaunchExtension() throws Exception {
public void testFailure_startDateSunrise_missingLaunchExtension() {
createTld("tld", TldState.START_DATE_SUNRISE);
persistContactsAndHosts();
EppException thrown =
@ -1290,7 +1289,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_quietPeriod() throws Exception {
public void testFailure_quietPeriod() {
createTld("tld", TldState.QUIET_PERIOD);
persistContactsAndHosts();
EppException thrown =
@ -1370,7 +1369,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_duplicateContact() throws Exception {
public void testFailure_duplicateContact() {
setEppInput("domain_create_duplicate_contact.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(DuplicateContactForRoleException.class, this::runFlow);
@ -1378,7 +1377,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_missingContactType() throws Exception {
public void testFailure_missingContactType() {
// We need to test for missing type, but not for invalid - the schema enforces that for us.
setEppInput("domain_create_missing_contact_type.xml");
persistContactsAndHosts();
@ -1387,7 +1386,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_missingRegistrant() throws Exception {
public void testFailure_missingRegistrant() {
setEppInput("domain_create_missing_registrant.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(MissingRegistrantException.class, this::runFlow);
@ -1395,7 +1394,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_missingAdmin() throws Exception {
public void testFailure_missingAdmin() {
setEppInput("domain_create_missing_admin.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(MissingAdminContactException.class, this::runFlow);
@ -1403,7 +1402,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_missingTech() throws Exception {
public void testFailure_missingTech() {
setEppInput("domain_create_missing_tech.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(MissingTechnicalContactException.class, this::runFlow);
@ -1411,7 +1410,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_missingNonRegistrantContacts() throws Exception {
public void testFailure_missingNonRegistrantContacts() {
setEppInput("domain_create_missing_non_registrant_contacts.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(MissingAdminContactException.class, this::runFlow);
@ -1419,7 +1418,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_badIdn() throws Exception {
public void testFailure_badIdn() {
createTld("xn--q9jyb4c");
setEppInput("domain_create_bad_idn_minna.xml");
persistContactsAndHosts("net");
@ -1428,7 +1427,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_badValidatorId() throws Exception {
public void testFailure_badValidatorId() {
setEppInput("domain_create_bad_validator_id.xml");
persistClaimsList(ImmutableMap.of("exampleone", CLAIMS_KEY));
persistContactsAndHosts();
@ -1437,7 +1436,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_codeMark() throws Exception {
public void testFailure_codeMark() {
setEppInput("domain_create_code_with_mark.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(UnsupportedMarkTypeException.class, this::runFlow);
@ -1451,7 +1450,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
* with the "wrong phase" error rather than the "missing signed mark" error.
*/
@Test
public void testFailure_registrationDuringEndDateSunrise_wrongPhase() throws Exception {
public void testFailure_registrationDuringEndDateSunrise_wrongPhase() {
createTld("tld", TldState.SUNRISE);
setEppInput("domain_create_registration_sunrise.xml");
persistContactsAndHosts();
@ -1461,7 +1460,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_expiredClaim() throws Exception {
public void testFailure_expiredClaim() {
clock.setTo(DateTime.parse("2010-08-17T09:00:00.0Z"));
setEppInput("domain_create_claim_notice.xml");
persistContactsAndHosts();
@ -1470,7 +1469,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_expiredAcceptance() throws Exception {
public void testFailure_expiredAcceptance() {
clock.setTo(DateTime.parse("2009-09-16T09:00:00.0Z"));
setEppInput("domain_create_claim_notice.xml");
persistContactsAndHosts();
@ -1479,7 +1478,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_malformedTcnIdWrongLength() throws Exception {
public void testFailure_malformedTcnIdWrongLength() {
clock.setTo(DateTime.parse("2009-08-16T09:00:00.0Z"));
setEppInput("domain_create_malformed_claim_notice1.xml");
persistContactsAndHosts();
@ -1488,7 +1487,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_malformedTcnIdBadChar() throws Exception {
public void testFailure_malformedTcnIdBadChar() {
clock.setTo(DateTime.parse("2009-08-16T09:00:00.0Z"));
setEppInput("domain_create_malformed_claim_notice2.xml");
persistContactsAndHosts();
@ -1497,7 +1496,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_badTcnIdChecksum() throws Exception {
public void testFailure_badTcnIdChecksum() {
clock.setTo(DateTime.parse("2009-08-16T09:00:00.0Z"));
setEppInput("domain_create_bad_checksum_claim_notice.xml");
persistContactsAndHosts();
@ -1506,7 +1505,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_premiumBlocked() throws Exception {
public void testFailure_premiumBlocked() {
createTld("example");
persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(false).build());
setEppInput("domain_create_premium.xml");
@ -1518,7 +1517,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_premiumNotAcked_byRegistryRequiringAcking() throws Exception {
public void testFailure_premiumNotAcked_byRegistryRequiringAcking() {
createTld("example");
assertThat(Registry.get("example").getPremiumPriceAckRequired()).isTrue();
setEppInput("domain_create_premium.xml");
@ -1528,7 +1527,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_premiumNotAcked_byRegistrarRequiringAcking() throws Exception {
public void testFailure_premiumNotAcked_byRegistrarRequiringAcking() {
createTld("example");
persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(false).build());
persistResource(
@ -1540,7 +1539,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_premiumNotAcked_whenRegistrarAndRegistryRequireAcking() throws Exception {
public void testFailure_premiumNotAcked_whenRegistrarAndRegistryRequireAcking() {
createTld("example");
persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(true).build());
persistResource(
@ -1552,7 +1551,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_omitFeeExtensionOnLogin_v06() throws Exception {
public void testFailure_omitFeeExtensionOnLogin_v06() {
for (String uri : FEE_EXTENSION_URIS) {
removeServiceExtensionUri(uri);
}
@ -1564,7 +1563,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_omitFeeExtensionOnLogin_v11() throws Exception {
public void testFailure_omitFeeExtensionOnLogin_v11() {
for (String uri : FEE_EXTENSION_URIS) {
removeServiceExtensionUri(uri);
}
@ -1576,7 +1575,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_omitFeeExtensionOnLogin_v12() throws Exception {
public void testFailure_omitFeeExtensionOnLogin_v12() {
for (String uri : FEE_EXTENSION_URIS) {
removeServiceExtensionUri(uri);
}
@ -1588,7 +1587,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_feeGivenInWrongScale_v06() throws Exception {
public void testFailure_feeGivenInWrongScale_v06() {
setEppInput("domain_create_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
persistContactsAndHosts();
EppException thrown = assertThrows(CurrencyValueScaleException.class, this::runFlow);
@ -1596,7 +1595,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_feeGivenInWrongScale_v11() throws Exception {
public void testFailure_feeGivenInWrongScale_v11() {
setEppInput("domain_create_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
persistContactsAndHosts();
EppException thrown = assertThrows(CurrencyValueScaleException.class, this::runFlow);
@ -1604,7 +1603,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_feeGivenInWrongScale_v12() throws Exception {
public void testFailure_feeGivenInWrongScale_v12() {
setEppInput("domain_create_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
persistContactsAndHosts();
EppException thrown = assertThrows(CurrencyValueScaleException.class, this::runFlow);
@ -1612,7 +1611,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_suspendedRegistrarCantCreateDomain() throws Exception {
public void testFailure_suspendedRegistrarCantCreateDomain() {
setEppInput("domain_create.xml");
persistContactsAndHosts();
persistResource(
@ -1626,8 +1625,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
private void doFailingDomainNameTest(String domainName, Class<? extends EppException> exception)
throws Exception {
private void doFailingDomainNameTest(String domainName, Class<? extends EppException> exception) {
setEppInput("domain_create_uppercase.xml");
eppLoader.replaceAll("Example.tld", domainName);
persistContactsAndHosts();
@ -1703,7 +1701,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_sunriseRegistration() throws Exception {
public void testFailure_sunriseRegistration() {
createTld("tld", TldState.SUNRISE);
setEppInput("domain_create_registration_sunrise.xml");
persistContactsAndHosts();
@ -1756,7 +1754,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_startDateSunriseRegistration_missingSignedMark() throws Exception {
public void testFailure_startDateSunriseRegistration_missingSignedMark() {
createTld("tld", TldState.START_DATE_SUNRISE);
setEppInput("domain_create_registration_sunrise.xml");
persistContactsAndHosts();
@ -1818,7 +1816,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
/** Tests possible confusion caused by the common start-date and end-date sunrise LaunchPhase. */
@Test
public void testFail_sunriseRegistration_withEncodedSignedMark() throws Exception {
public void testFail_sunriseRegistration_withEncodedSignedMark() {
createTld("tld", TldState.SUNRISE);
clock.setTo(DateTime.parse("2014-09-09T09:09:09Z"));
setEppInput(
@ -1831,7 +1829,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFail_startDateSunriseRegistration_wrongEncodedSignedMark() throws Exception {
public void testFail_startDateSunriseRegistration_wrongEncodedSignedMark() {
createTld("tld", TldState.START_DATE_SUNRISE);
clock.setTo(DateTime.parse("2014-09-09T09:09:09Z"));
setEppInput(
@ -1843,7 +1841,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFail_startDateSunriseRegistration_markNotYetValid() throws Exception {
public void testFail_startDateSunriseRegistration_markNotYetValid() {
createTld("tld", TldState.START_DATE_SUNRISE);
// If we move now back in time a bit, the mark will not have gone into effect yet.
clock.setTo(DateTime.parse("2013-08-09T10:05:59Z").minusSeconds(1));
@ -1856,7 +1854,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFail_startDateSunriseRegistration_markExpired() throws Exception {
public void testFail_startDateSunriseRegistration_markExpired() {
createTld("tld", TldState.START_DATE_SUNRISE);
// Move time forward to the mark expiration time.
clock.setTo(DateTime.parse("2017-07-23T22:00:00.000Z"));
@ -1869,7 +1867,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_startDateSunriseRegistration_withClaimsNotice() throws Exception {
public void testFailure_startDateSunriseRegistration_withClaimsNotice() {
createTld("tld", TldState.START_DATE_SUNRISE);
clock.setTo(DateTime.parse("2009-08-16T09:00:00.0Z"));
setEppInput("domain_create_registration_start_date_sunrise_claims_notice.xml");
@ -1880,7 +1878,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_sunrushRegistration() throws Exception {
public void testFailure_sunrushRegistration() {
createTld("tld", TldState.SUNRUSH);
setEppInput("domain_create_registration_sunrush.xml");
persistContactsAndHosts();
@ -1890,7 +1888,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_notAuthorizedForTld() throws Exception {
public void testFailure_notAuthorizedForTld() {
createTld("irrelevant", "IRR");
persistResource(
loadRegistrar("TheRegistrar")
@ -1946,7 +1944,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_landrushRegistration() throws Exception {
public void testFailure_landrushRegistration() {
createTld("tld", TldState.LANDRUSH);
setEppInput("domain_create_registration_landrush.xml");
persistContactsAndHosts();
@ -1975,7 +1973,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_qlpLandrushRegistration_withEncodedSignedMark() throws Exception {
public void testFailure_qlpLandrushRegistration_withEncodedSignedMark() {
createTld("tld", TldState.LANDRUSH);
clock.setTo(DateTime.parse("2014-09-09T09:09:09Z"));
setEppInput("domain_create_registration_qlp_landrush_encoded_signed_mark.xml");
@ -1999,7 +1997,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_registrantNotWhitelisted() throws Exception {
public void testFailure_registrantNotWhitelisted() {
persistActiveContact("someone");
persistContactsAndHosts();
persistResource(
@ -2013,7 +2011,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_nameserverNotWhitelisted() throws Exception {
public void testFailure_nameserverNotWhitelisted() {
persistContactsAndHosts();
persistResource(
Registry.get("tld")
@ -2026,7 +2024,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_emptyNameserverFailsWhitelist() throws Exception {
public void testFailure_emptyNameserverFailsWhitelist() {
setEppInput("domain_create_no_hosts_or_dsdata.xml");
persistResource(
Registry.get("tld")
@ -2069,7 +2067,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_domainNameserverRestricted_noNameservers() throws Exception {
public void testFailure_domainNameserverRestricted_noNameservers() {
setEppInput("domain_create_no_hosts_or_dsdata.xml");
persistContactsAndHosts();
persistResource(
@ -2088,7 +2086,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_domainNameserverRestricted_someNameserversDisallowed() throws Exception {
public void testFailure_domainNameserverRestricted_someNameserversDisallowed() {
persistContactsAndHosts();
persistResource(
Registry.get("tld")
@ -2103,7 +2101,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_domainCreateRestricted_domainNotReserved() throws Exception {
public void testFailure_domainCreateRestricted_domainNotReserved() {
persistContactsAndHosts();
persistResource(
Registry.get("tld")
@ -2150,7 +2148,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_domainNameserversAllowed_tldNameserversDisallowed() throws Exception {
public void testFailure_domainNameserversAllowed_tldNameserversDisallowed() {
persistContactsAndHosts();
persistResource(
Registry.get("tld")
@ -2169,7 +2167,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_domainNameserversDisallowed_tldNameserversAllowed() throws Exception {
public void testFailure_domainNameserversDisallowed_tldNameserversAllowed() {
persistContactsAndHosts();
persistResource(
Registry.get("tld")
@ -2188,8 +2186,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_tldNameserversAllowed_domainCreateRestricted_domainNotReserved()
throws Exception {
public void testFailure_tldNameserversAllowed_domainCreateRestricted_domainNotReserved() {
persistContactsAndHosts();
persistResource(
Registry.get("tld")
@ -2243,7 +2240,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_eapFee_combined() throws Exception {
public void testFailure_eapFee_combined() {
setEppInput("domain_create_eap_combined_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
persistContactsAndHosts();
persistResource(
@ -2264,7 +2261,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_eapFee_description_swapped() throws Exception {
public void testFailure_eapFee_description_swapped() {
setEppInput(
"domain_create_eap_fee.xml",
ImmutableMap.of(
@ -2293,7 +2290,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_eapFee_totalAmountNotMatched() throws Exception {
public void testFailure_eapFee_totalAmountNotMatched() {
setEppInput(
"domain_create_extra_fees.xml",
new ImmutableMap.Builder<String, String>()
@ -2324,7 +2321,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testSuccess_eapFee_multipleEAPfees_doNotAddToExpectedValue() throws Exception {
public void testSuccess_eapFee_multipleEAPfees_doNotAddToExpectedValue() {
setEppInput(
"domain_create_extra_fees.xml",
new ImmutableMap.Builder<String, String>()
@ -2413,7 +2410,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_eapFee_description_multipleMatch() throws Exception {
public void testFailure_eapFee_description_multipleMatch() {
setEppInput(
"domain_create_eap_fee.xml",
ImmutableMap.of(
@ -2521,7 +2518,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_domainInEap_failsWithoutFeeExtension() throws Exception {
public void testFailure_domainInEap_failsWithoutFeeExtension() {
persistContactsAndHosts();
persistResource(
Registry.get("tld")
@ -2580,7 +2577,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
}
@Test
public void testFailure_max10Years() throws Exception {
public void testFailure_max10Years() {
setEppInput("domain_create_11_years.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(ExceedsMaxRegistrationYearsException.class, this::runFlow);

View file

@ -115,7 +115,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
}
@Before
public void initDomainTest() throws Exception {
public void initDomainTest() {
createTld("tld");
// For flags extension tests.
}
@ -151,7 +151,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
new HistoryEntry.Builder().setType(DOMAIN_CREATE).setParent(domain).build());
}
private void setUpGracePeriods(GracePeriod... gracePeriods) throws Exception {
private void setUpGracePeriods(GracePeriod... gracePeriods) {
domain =
persistResource(
domain.asBuilder().setGracePeriods(ImmutableSet.copyOf(gracePeriods)).build());
@ -1080,7 +1080,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
}
@Test
public void testFailure_allocationTokenNotSupportedOnDelete() throws Exception {
public void testFailure_allocationTokenNotSupportedOnDelete() {
setEppInput("domain_delete_allocationtoken.xml");
EppException thrown = assertThrows(UnimplementedExtensionException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();

View file

@ -428,7 +428,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
}
@Test
public void testFailure_differentRegistrarWrongAuthInfo() throws Exception {
public void testFailure_differentRegistrarWrongAuthInfo() {
persistTestEntities(false);
// Change the password of the domain so that it does not match the file.
persistResource(
@ -443,7 +443,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
}
@Test
public void testFailure_wrongAuthInfo() throws Exception {
public void testFailure_wrongAuthInfo() {
persistTestEntities(false);
// Change the password of the domain so that it does not match the file.
persistResource(
@ -457,7 +457,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
}
@Test
public void testFailure_differentRegistrarWrongRegistrantAuthInfo() throws Exception {
public void testFailure_differentRegistrarWrongRegistrantAuthInfo() {
persistTestEntities(false);
// Change the password of the registrant so that it does not match the file.
registrant =
@ -475,7 +475,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
}
@Test
public void testFailure_wrongRegistrantAuthInfo() throws Exception {
public void testFailure_wrongRegistrantAuthInfo() {
persistTestEntities(false);
// Change the password of the registrant so that it does not match the file.
registrant =
@ -492,7 +492,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
}
@Test
public void testFailure_differentRegistrarWrongContactAuthInfo() throws Exception {
public void testFailure_differentRegistrarWrongContactAuthInfo() {
persistTestEntities(false);
// Change the password of the contact so that it does not match the file.
contact =
@ -510,7 +510,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
}
@Test
public void testFailure_wrongContactAuthInfo() throws Exception {
public void testFailure_wrongContactAuthInfo() {
persistTestEntities(false);
// Change the password of the contact so that it does not match the file.
contact =
@ -527,7 +527,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
}
@Test
public void testFailure_differentRegistrarUnrelatedContactAuthInfo() throws Exception {
public void testFailure_differentRegistrarUnrelatedContactAuthInfo() {
persistTestEntities(false);
ContactResource unrelatedContact = persistActiveContact("foo1234");
sessionMetadata.setClientId("ClientZ");
@ -539,7 +539,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
}
@Test
public void testFailure_unrelatedContactAuthInfo() throws Exception {
public void testFailure_unrelatedContactAuthInfo() {
persistTestEntities(false);
ContactResource unrelatedContact = persistActiveContact("foo1234");
setEppInput("domain_info_with_contact_auth.xml");
@ -622,7 +622,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
/** Test setting the currency explicitly to a wrong value. */
@Test
public void testFeeExtension_wrongCurrency() throws Exception {
public void testFeeExtension_wrongCurrency() {
setEppInput("domain_info_fee_create_euro.xml");
persistTestEntities(false);
EppException thrown = assertThrows(CurrencyUnitMismatchException.class, this::runFlow);
@ -631,7 +631,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
/** Test requesting a period that isn't in years. */
@Test
public void testFeeExtension_periodNotInYears() throws Exception {
public void testFeeExtension_periodNotInYears() {
setEppInput("domain_info_fee_bad_period.xml");
persistTestEntities(false);
EppException thrown = assertThrows(BadPeriodUnitException.class, this::runFlow);
@ -640,7 +640,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
/** Test a command that specifies a phase. */
@Test
public void testFeeExtension_commandPhase() throws Exception {
public void testFeeExtension_commandPhase() {
setEppInput("domain_info_fee_command_phase.xml");
persistTestEntities(false);
EppException thrown = assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
@ -649,7 +649,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
/** Test a command that specifies a subphase. */
@Test
public void testFeeExtension_commandSubphase() throws Exception {
public void testFeeExtension_commandSubphase() {
setEppInput("domain_info_fee_command_subphase.xml");
persistTestEntities(false);
EppException thrown = assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
@ -658,7 +658,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
/** Test a restore for more than one year. */
@Test
public void testFeeExtension_multiyearRestore() throws Exception {
public void testFeeExtension_multiyearRestore() {
setEppInput("domain_info_fee_multiyear_restore.xml");
persistTestEntities(false);
EppException thrown = assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow);
@ -667,7 +667,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
/** Test a transfer for more than one year. */
@Test
public void testFeeExtension_multiyearTransfer() throws Exception {
public void testFeeExtension_multiyearTransfer() {
setEppInput("domain_info_fee_multiyear_transfer.xml");
persistTestEntities(false);
EppException thrown = assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow);

View file

@ -402,7 +402,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_badContactPassword() throws Exception {
public void testFailure_badContactPassword() {
// Change the contact's password so it does not match the password in the file.
contact =
persistResource(
@ -418,7 +418,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_badDomainPassword() throws Exception {
public void testFailure_badDomainPassword() {
// Change the domain's password so it does not match the password in the file.
persistResource(
domain
@ -433,7 +433,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_neverBeenTransferred() throws Exception {
public void testFailure_neverBeenTransferred() {
changeTransferStatus(null);
EppException thrown =
assertThrows(
@ -442,7 +442,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_clientApproved() throws Exception {
public void testFailure_clientApproved() {
changeTransferStatus(TransferStatus.CLIENT_APPROVED);
EppException thrown =
assertThrows(
@ -451,7 +451,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_clientRejected() throws Exception {
public void testFailure_clientRejected() {
changeTransferStatus(TransferStatus.CLIENT_REJECTED);
EppException thrown =
assertThrows(
@ -460,7 +460,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_clientCancelled() throws Exception {
public void testFailure_clientCancelled() {
changeTransferStatus(TransferStatus.CLIENT_CANCELLED);
EppException thrown =
assertThrows(
@ -469,7 +469,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_serverApproved() throws Exception {
public void testFailure_serverApproved() {
changeTransferStatus(TransferStatus.SERVER_APPROVED);
EppException thrown =
assertThrows(
@ -478,7 +478,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_serverCancelled() throws Exception {
public void testFailure_serverCancelled() {
changeTransferStatus(TransferStatus.SERVER_CANCELLED);
EppException thrown =
assertThrows(
@ -487,7 +487,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_gainingClient() throws Exception {
public void testFailure_gainingClient() {
setClientIdForFlow("NewRegistrar");
EppException thrown =
assertThrows(
@ -496,7 +496,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_unrelatedClient() throws Exception {
public void testFailure_unrelatedClient() {
setClientIdForFlow("ClientZ");
EppException thrown =
assertThrows(
@ -525,7 +525,7 @@ public class DomainTransferApproveFlowTest
}
@Test
public void testFailure_notAuthorizedForTld() throws Exception {
public void testFailure_notAuthorizedForTld() {
persistResource(
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
EppException thrown =

View file

@ -214,7 +214,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_badContactPassword() throws Exception {
public void testFailure_badContactPassword() {
// Change the contact's password so it does not match the password in the file.
contact =
persistResource(
@ -230,7 +230,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_badDomainPassword() throws Exception {
public void testFailure_badDomainPassword() {
// Change the domain's password so it does not match the password in the file.
domain =
persistResource(
@ -246,7 +246,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_neverBeenTransferred() throws Exception {
public void testFailure_neverBeenTransferred() {
changeTransferStatus(null);
EppException thrown =
assertThrows(
@ -255,7 +255,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_clientApproved() throws Exception {
public void testFailure_clientApproved() {
changeTransferStatus(TransferStatus.CLIENT_APPROVED);
EppException thrown =
assertThrows(
@ -264,7 +264,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_clientRejected() throws Exception {
public void testFailure_clientRejected() {
changeTransferStatus(TransferStatus.CLIENT_REJECTED);
EppException thrown =
assertThrows(
@ -273,7 +273,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_clientCancelled() throws Exception {
public void testFailure_clientCancelled() {
changeTransferStatus(TransferStatus.CLIENT_CANCELLED);
EppException thrown =
assertThrows(
@ -282,7 +282,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_serverApproved() throws Exception {
public void testFailure_serverApproved() {
changeTransferStatus(TransferStatus.SERVER_APPROVED);
EppException thrown =
assertThrows(
@ -291,7 +291,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_serverCancelled() throws Exception {
public void testFailure_serverCancelled() {
changeTransferStatus(TransferStatus.SERVER_CANCELLED);
EppException thrown =
assertThrows(
@ -300,7 +300,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_sponsoringClient() throws Exception {
public void testFailure_sponsoringClient() {
setClientIdForFlow("TheRegistrar");
EppException thrown =
assertThrows(
@ -309,7 +309,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_unrelatedClient() throws Exception {
public void testFailure_unrelatedClient() {
setClientIdForFlow("ClientZ");
EppException thrown =
assertThrows(
@ -337,7 +337,7 @@ public class DomainTransferCancelFlowTest
}
@Test
public void testFailure_notAuthorizedForTld() throws Exception {
public void testFailure_notAuthorizedForTld() {
persistResource(
loadRegistrar("NewRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
EppException thrown =

View file

@ -105,7 +105,7 @@ public class DomainTransferFlowTestCase<F extends Flow, R extends EppResource>
}
/** Adds a domain with no pending transfer on it. */
protected void setupDomain(String label, String tld) throws Exception {
protected void setupDomain(String label, String tld) {
createTld(tld);
contact = persistActiveContact("jd1234");
domain = new DomainResource.Builder()

View file

@ -161,7 +161,7 @@ public class DomainTransferQueryFlowTest
}
@Test
public void testFailure_badContactPassword() throws Exception {
public void testFailure_badContactPassword() {
// Change the contact's password so it does not match the password in the file.
contact =
persistResource(
@ -177,7 +177,7 @@ public class DomainTransferQueryFlowTest
}
@Test
public void testFailure_badDomainPassword() throws Exception {
public void testFailure_badDomainPassword() {
// Change the domain's password so it does not match the password in the file.
domain =
persistResource(
@ -193,7 +193,7 @@ public class DomainTransferQueryFlowTest
}
@Test
public void testFailure_neverBeenTransferred() throws Exception {
public void testFailure_neverBeenTransferred() {
changeTransferStatus(null);
EppException thrown =
assertThrows(
@ -203,7 +203,7 @@ public class DomainTransferQueryFlowTest
}
@Test
public void testFailure_unrelatedClient() throws Exception {
public void testFailure_unrelatedClient() {
setClientIdForFlow("ClientZ");
EppException thrown =
assertThrows(

View file

@ -172,7 +172,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_notAuthorizedForTld() throws Exception {
public void testFailure_notAuthorizedForTld() {
persistResource(
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
EppException thrown =
@ -193,7 +193,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_badContactPassword() throws Exception {
public void testFailure_badContactPassword() {
// Change the contact's password so it does not match the password in the file.
contact =
persistResource(
@ -209,7 +209,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_badDomainPassword() throws Exception {
public void testFailure_badDomainPassword() {
// Change the domain's password so it does not match the password in the file.
domain =
persistResource(
@ -225,7 +225,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_neverBeenTransferred() throws Exception {
public void testFailure_neverBeenTransferred() {
changeTransferStatus(null);
EppException thrown =
assertThrows(
@ -234,7 +234,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_clientApproved() throws Exception {
public void testFailure_clientApproved() {
changeTransferStatus(TransferStatus.CLIENT_APPROVED);
EppException thrown =
assertThrows(
@ -243,7 +243,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_clientRejected() throws Exception {
public void testFailure_clientRejected() {
changeTransferStatus(TransferStatus.CLIENT_REJECTED);
EppException thrown =
assertThrows(
@ -252,7 +252,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_clientCancelled() throws Exception {
public void testFailure_clientCancelled() {
changeTransferStatus(TransferStatus.CLIENT_CANCELLED);
EppException thrown =
assertThrows(
@ -261,7 +261,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_serverApproved() throws Exception {
public void testFailure_serverApproved() {
changeTransferStatus(TransferStatus.SERVER_APPROVED);
EppException thrown =
assertThrows(
@ -270,7 +270,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_serverCancelled() throws Exception {
public void testFailure_serverCancelled() {
changeTransferStatus(TransferStatus.SERVER_CANCELLED);
EppException thrown =
assertThrows(
@ -279,7 +279,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_gainingClient() throws Exception {
public void testFailure_gainingClient() {
setClientIdForFlow("NewRegistrar");
EppException thrown =
assertThrows(
@ -288,7 +288,7 @@ public class DomainTransferRejectFlowTest
}
@Test
public void testFailure_unrelatedClient() throws Exception {
public void testFailure_unrelatedClient() {
setClientIdForFlow("ClientZ");
EppException thrown =
assertThrows(

View file

@ -128,7 +128,7 @@ public class DomainTransferRequestFlowTest
.build();
@Before
public void setUp() throws Exception {
public void setUp() {
setEppInput("domain_transfer_request.xml");
setClientIdForFlow("NewRegistrar");
}
@ -1158,7 +1158,7 @@ public class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
private void runWrongFeeAmountTest(Map<String, String> substitutions) throws Exception {
private void runWrongFeeAmountTest(Map<String, String> substitutions) {
persistResource(
Registry.get("tld")
.asBuilder()
@ -1378,7 +1378,7 @@ public class DomainTransferRequestFlowTest
}
@Test
public void testFailure_nonexistentDomain() throws Exception {
public void testFailure_nonexistentDomain() {
createTld("tld");
contact = persistActiveContact("jd1234");
ResourceDoesNotExistException thrown =

View file

@ -71,7 +71,7 @@ public class AllocationTokenFlowUtilsTest extends ShardableTestCase {
}
@Test
public void test_verifyToken_failsOnNonexistentToken() throws Exception {
public void test_verifyToken_failsOnNonexistentToken() {
AllocationTokenFlowUtils flowUtils =
new AllocationTokenFlowUtils(new AllocationTokenCustomLogic());
EppException thrown =
@ -88,7 +88,7 @@ public class AllocationTokenFlowUtilsTest extends ShardableTestCase {
}
@Test
public void test_verifyToken_callsCustomLogic() throws Exception {
public void test_verifyToken_callsCustomLogic() {
persistResource(new AllocationToken.Builder().setToken("tokeN").build());
AllocationTokenFlowUtils flowUtils =
new AllocationTokenFlowUtils(new FailingAllocationTokenCustomLogic());
@ -106,7 +106,7 @@ public class AllocationTokenFlowUtilsTest extends ShardableTestCase {
}
@Test
public void test_checkDomainsWithToken_successfullyVerifiesValidToken() throws Exception {
public void test_checkDomainsWithToken_successfullyVerifiesValidToken() {
persistResource(new AllocationToken.Builder().setToken("tokeN").build());
AllocationTokenFlowUtils flowUtils =
new AllocationTokenFlowUtils(new AllocationTokenCustomLogic());
@ -124,7 +124,7 @@ public class AllocationTokenFlowUtilsTest extends ShardableTestCase {
}
@Test
public void test_checkDomainsWithToken_showsFailureMessageForRedeemedToken() throws Exception {
public void test_checkDomainsWithToken_showsFailureMessageForRedeemedToken() {
persistResource(
new AllocationToken.Builder()
.setToken("tokeN")
@ -149,7 +149,7 @@ public class AllocationTokenFlowUtilsTest extends ShardableTestCase {
}
@Test
public void test_checkDomainsWithToken_callsCustomLogic() throws Exception {
public void test_checkDomainsWithToken_callsCustomLogic() {
persistResource(new AllocationToken.Builder().setToken("tokeN").build());
AllocationTokenFlowUtils flowUtils =
new AllocationTokenFlowUtils(new FailingAllocationTokenCustomLogic());
@ -167,7 +167,7 @@ public class AllocationTokenFlowUtilsTest extends ShardableTestCase {
}
@Test
public void test_checkDomainsWithToken_resultsFromCustomLogicAreIntegrated() throws Exception {
public void test_checkDomainsWithToken_resultsFromCustomLogicAreIntegrated() {
persistResource(new AllocationToken.Builder().setToken("tokeN").build());
AllocationTokenFlowUtils flowUtils =
new AllocationTokenFlowUtils(new CustomResultAllocationTokenCustomLogic());
@ -202,8 +202,7 @@ public class AllocationTokenFlowUtilsTest extends ShardableTestCase {
AllocationToken token,
Registry registry,
String clientId,
DateTime now)
throws EppException {
DateTime now) {
throw new IllegalStateException("failed for tests");
}

View file

@ -76,7 +76,7 @@ public class HostCheckFlowTest extends ResourceCheckFlowTestCase<HostCheckFlow,
}
@Test
public void testTooManyIds() throws Exception {
public void testTooManyIds() {
setEppInput("host_check_51.xml");
EppException thrown = assertThrows(TooManyResourceChecksException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();

View file

@ -123,7 +123,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
}
@Test
public void testFailure_multipartTLDsAndInvalidHost() throws Exception {
public void testFailure_multipartTLDsAndInvalidHost() {
createTlds("bar.tld", "tld");
setEppHostCreateInputWithIps("ns1.bar.tld");
@ -152,7 +152,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
}
@Test
public void testFailure_subordinateNeedsIps() throws Exception {
public void testFailure_subordinateNeedsIps() {
setEppHostCreateInput("ns1.example.tld", null);
createTld("tld");
persistActiveDomain("example.tld");
@ -161,7 +161,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
}
@Test
public void testFailure_externalMustNotHaveIps() throws Exception {
public void testFailure_externalMustNotHaveIps() {
setEppHostCreateInputWithIps("ns1.example.external");
createTld("tld");
persistActiveDomain("example.tld");
@ -170,7 +170,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
}
@Test
public void testFailure_superordinateMissing() throws Exception {
public void testFailure_superordinateMissing() {
setEppHostCreateInput("ns1.example.tld", null);
createTld("tld");
SuperordinateDomainDoesNotExistException thrown =
@ -179,7 +179,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
}
@Test
public void testFailure_superordinateInPendingDelete() throws Exception {
public void testFailure_superordinateInPendingDelete() {
setEppHostCreateInputWithIps("ns1.example.tld");
createTld("tld");
persistResource(
@ -209,14 +209,14 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
}
@Test
public void testFailure_nonLowerCaseHostname() throws Exception {
public void testFailure_nonLowerCaseHostname() {
setEppHostCreateInput("ns1.EXAMPLE.tld", null);
EppException thrown = assertThrows(HostNameNotLowerCaseException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_nonPunyCodedHostname() throws Exception {
public void testFailure_nonPunyCodedHostname() {
setEppHostCreateInput("ns1.çauçalito.みんな", null);
HostNameNotPunyCodedException thrown =
assertThrows(HostNameNotPunyCodedException.class, this::runFlow);
@ -224,21 +224,21 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
}
@Test
public void testFailure_nonCanonicalHostname() throws Exception {
public void testFailure_nonCanonicalHostname() {
setEppHostCreateInput("ns1.example.tld.", null);
EppException thrown = assertThrows(HostNameNotNormalizedException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_longHostName() throws Exception {
public void testFailure_longHostName() {
setEppHostCreateInputWithIps("a" + Strings.repeat(".labelpart", 25) + ".tld");
EppException thrown = assertThrows(HostNameTooLongException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_ip4AddressWithIp6Declaration() throws Exception {
public void testFailure_ip4AddressWithIp6Declaration() {
setEppHostCreateInput(
"ns1.example.tld",
"<host:addr ip=\"v4\">192.0.2.2</host:addr>\n"
@ -248,8 +248,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
private void doFailingHostNameTest(String hostName, Class<? extends EppException> exception)
throws Exception {
private void doFailingHostNameTest(String hostName, Class<? extends EppException> exception) {
setEppHostCreateInputWithIps(hostName);
EppException thrown = assertThrows(exception, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
@ -286,7 +285,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
}
@Test
public void testFailure_ccTldInBailiwick() throws Exception {
public void testFailure_ccTldInBailiwick() {
createTld("co.uk");
setEppHostCreateInputWithIps("foo.co.uk");
EppException thrown = assertThrows(HostNameTooShallowException.class, this::runFlow);

View file

@ -104,22 +104,21 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
}
@Test
public void testFailure_neverExisted() throws Exception {
public void testFailure_neverExisted() {
ResourceDoesNotExistException thrown =
assertThrows(ResourceDoesNotExistException.class, this::runFlow);
assertThat(thrown).hasMessageThat().contains("(ns1.example.tld)");
}
@Test
public void testFailure_existedButWasDeleted() throws Exception {
public void testFailure_existedButWasDeleted() {
persistDeletedHost("ns1.example.tld", clock.nowUtc().minusDays(1));
ResourceDoesNotExistException thrown =
assertThrows(ResourceDoesNotExistException.class, this::runFlow);
assertThat(thrown).hasMessageThat().contains("(ns1.example.tld)");
}
private void doFailingStatusTest(StatusValue statusValue, Class<? extends Exception> exception)
throws Exception {
private void doFailingStatusTest(StatusValue statusValue, Class<? extends Exception> exception) {
persistResource(
newHostResource("ns1.example.tld")
.asBuilder()
@ -148,7 +147,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
}
@Test
public void testFailure_unauthorizedClient() throws Exception {
public void testFailure_unauthorizedClient() {
sessionMetadata.setClientId("NewRegistrar");
persistActiveHost("ns1.example.tld");
EppException thrown = assertThrows(ResourceNotOwnedException.class, this::runFlow);
@ -195,7 +194,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
}
@Test
public void testFailure_unauthorizedClientReadFromSuperordinate() throws Exception {
public void testFailure_unauthorizedClientReadFromSuperordinate() {
sessionMetadata.setClientId("TheRegistrar");
createTld("tld");
DomainResource domain =
@ -248,7 +247,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
}
@Test
public void testFailure_unauthorizedClientReadFromTransferredSuperordinate() throws Exception {
public void testFailure_unauthorizedClientReadFromTransferredSuperordinate() {
sessionMetadata.setClientId("NewRegistrar");
createTld("tld");
// Setup a transfer that should have been server approved a day ago.
@ -281,7 +280,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
}
@Test
public void testFailure_failfastWhenLinkedToDomain() throws Exception {
public void testFailure_failfastWhenLinkedToDomain() {
createTld("tld");
persistResource(
newDomainResource("example.tld")
@ -293,7 +292,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
}
@Test
public void testFailure_failfastWhenLinkedToApplication() throws Exception {
public void testFailure_failfastWhenLinkedToApplication() {
createTld("tld");
persistResource(
newDomainApplication("example.tld")
@ -305,14 +304,14 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
}
@Test
public void testFailure_nonLowerCaseHostname() throws Exception {
public void testFailure_nonLowerCaseHostname() {
setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "NS1.EXAMPLE.NET"));
EppException thrown = assertThrows(HostNameNotLowerCaseException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_nonPunyCodedHostname() throws Exception {
public void testFailure_nonPunyCodedHostname() {
setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "ns1.çauçalito.tld"));
HostNameNotPunyCodedException thrown =
assertThrows(HostNameNotPunyCodedException.class, this::runFlow);
@ -320,7 +319,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
}
@Test
public void testFailure_nonCanonicalHostname() throws Exception {
public void testFailure_nonCanonicalHostname() {
setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld."));
EppException thrown = assertThrows(HostNameNotNormalizedException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();

View file

@ -54,42 +54,41 @@ public class HostFlowUtilsTest {
}
@Test
public void test_validExternalHostNameOnRegistrySuffixList_multipartTLD_tooShallow()
throws Exception {
public void test_validExternalHostNameOnRegistrySuffixList_multipartTLD_tooShallow() {
assertThrows(
HostNameTooShallowException.class, () -> validateHostName("host.co.uk").toString());
}
@Test
public void test_validateHostName_hostNameTooLong() throws Exception {
public void test_validateHostName_hostNameTooLong() {
assertThrows(
HostNameTooLongException.class,
() -> validateHostName(Strings.repeat("na", 200) + ".wat.man"));
}
@Test
public void test_validateHostName_hostNameNotLowerCase() throws Exception {
public void test_validateHostName_hostNameNotLowerCase() {
assertThrows(HostNameNotLowerCaseException.class, () -> validateHostName("NA.CAPS.TLD"));
}
@Test
public void test_validateHostName_hostNameNotPunyCoded() throws Exception {
public void test_validateHostName_hostNameNotPunyCoded() {
assertThrows(
HostNameNotPunyCodedException.class, () -> validateHostName("motörhead.death.metal"));
}
@Test
public void test_validateHostName_hostNameNotNormalized() throws Exception {
public void test_validateHostName_hostNameNotNormalized() {
assertThrows(HostNameNotNormalizedException.class, () -> validateHostName("root.node.yeah."));
}
@Test
public void test_validateHostName_hostNameHasLeadingHyphen() throws Exception {
public void test_validateHostName_hostNameHasLeadingHyphen() {
assertThrows(InvalidHostNameException.class, () -> validateHostName("-giga.mega.tld"));
}
@Test
public void test_validateHostName_hostNameTooShallow() throws Exception {
public void test_validateHostName_hostNameTooShallow() {
assertThrows(HostNameTooShallowException.class, () -> validateHostName("domain.tld"));
}
}

View file

@ -164,14 +164,14 @@ public class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostRes
}
@Test
public void testFailure_nonLowerCaseHostname() throws Exception {
public void testFailure_nonLowerCaseHostname() {
setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "NS1.EXAMPLE.NET"));
EppException thrown = assertThrows(HostNameNotLowerCaseException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_nonPunyCodedHostname() throws Exception {
public void testFailure_nonPunyCodedHostname() {
setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "ns1.çauçalito.tld"));
HostNameNotPunyCodedException thrown =
assertThrows(HostNameNotPunyCodedException.class, this::runFlow);
@ -179,7 +179,7 @@ public class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostRes
}
@Test
public void testFailure_nonCanonicalHostname() throws Exception {
public void testFailure_nonCanonicalHostname() {
setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld."));
EppException thrown = assertThrows(HostNameNotNormalizedException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();

View file

@ -888,14 +888,14 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
}
@Test
public void testFailure_referToNonLowerCaseHostname() throws Exception {
public void testFailure_referToNonLowerCaseHostname() {
setEppHostUpdateInput("ns1.EXAMPLE.tld", "ns2.example.tld", null, null);
EppException thrown = assertThrows(HostNameNotLowerCaseException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_renameToNonLowerCaseHostname() throws Exception {
public void testFailure_renameToNonLowerCaseHostname() {
persistActiveHost("ns1.example.tld");
setEppHostUpdateInput("ns1.example.tld", "ns2.EXAMPLE.tld", null, null);
EppException thrown = assertThrows(HostNameNotLowerCaseException.class, this::runFlow);
@ -903,7 +903,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
}
@Test
public void testFailure_referToNonPunyCodedHostname() throws Exception {
public void testFailure_referToNonPunyCodedHostname() {
setEppHostUpdateInput("ns1.çauçalito.tld", "ns1.sausalito.tld", null, null);
HostNameNotPunyCodedException thrown =
assertThrows(HostNameNotPunyCodedException.class, this::runFlow);
@ -911,7 +911,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
}
@Test
public void testFailure_renameToNonPunyCodedHostname() throws Exception {
public void testFailure_renameToNonPunyCodedHostname() {
persistActiveHost("ns1.sausalito.tld");
setEppHostUpdateInput("ns1.sausalito.tld", "ns1.çauçalito.tld", null, null);
HostNameNotPunyCodedException thrown =
@ -920,7 +920,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
}
@Test
public void testFailure_referToNonCanonicalHostname() throws Exception {
public void testFailure_referToNonCanonicalHostname() {
persistActiveHost("ns1.example.tld.");
setEppHostUpdateInput("ns1.example.tld.", "ns2.example.tld", null, null);
EppException thrown = assertThrows(HostNameNotNormalizedException.class, this::runFlow);
@ -928,7 +928,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
}
@Test
public void testFailure_renameToNonCanonicalHostname() throws Exception {
public void testFailure_renameToNonCanonicalHostname() {
persistActiveHost("ns1.example.tld");
setEppHostUpdateInput("ns1.example.tld", "ns2.example.tld.", null, null);
EppException thrown = assertThrows(HostNameNotNormalizedException.class, this::runFlow);
@ -1074,7 +1074,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
}
@Test
public void testFailure_unauthorizedClient() throws Exception {
public void testFailure_unauthorizedClient() {
sessionMetadata.setClientId("NewRegistrar");
persistActiveHost("ns1.example.tld");
EppException thrown = assertThrows(ResourceNotOwnedException.class, this::runFlow);
@ -1114,7 +1114,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
}
@Test
public void testFailure_unauthorizedClientReadFromSuperordinate() throws Exception {
public void testFailure_unauthorizedClientReadFromSuperordinate() {
sessionMetadata.setClientId("NewRegistrar");
createTld("tld");
DomainResource domain =
@ -1154,7 +1154,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
}
@Test
public void testFailure_unauthorizedClientReadFromTransferredSuperordinate() throws Exception {
public void testFailure_unauthorizedClientReadFromTransferredSuperordinate() {
sessionMetadata.setClientId("TheRegistrar");
createTld("tld");
// Create a domain that will belong to NewRegistrar after cloneProjectedAtTime is called.

View file

@ -63,7 +63,7 @@ public abstract class LoginFlowTestCase extends FlowTestCase<LoginFlow> {
}
// Also called in subclasses.
void doFailingTest(String xmlFilename, Class<? extends EppException> exception) throws Exception {
void doFailingTest(String xmlFilename, Class<? extends EppException> exception) {
setEppInput(xmlFilename);
EppException thrown = assertThrows(exception, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();

View file

@ -44,7 +44,7 @@ public class LogoutFlowTest extends FlowTestCase<LogoutFlow> {
}
@Test
public void testFailure() throws Exception {
public void testFailure() {
sessionMetadata.setClientId(null); // Turn off the implicit login
EppException thrown = assertThrows(NotLoggedInException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();

View file

@ -48,7 +48,6 @@ import com.google.api.services.groupssettings.model.Groups;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import google.registry.groups.GroupsConnection.Role;
import java.io.IOException;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
@ -248,10 +247,10 @@ public class DirectoryGroupsConnectionTest {
final String message) throws Exception {
HttpTransport transport = new MockHttpTransport() {
@Override
public LowLevelHttpRequest buildRequest(String method, String url) throws IOException {
public LowLevelHttpRequest buildRequest(String method, String url) {
return new MockLowLevelHttpRequest() {
@Override
public LowLevelHttpResponse execute() throws IOException {
public LowLevelHttpResponse execute() {
MockLowLevelHttpResponse response = new MockLowLevelHttpResponse();
response.setStatusCode(statusCode);
response.setContentType(Json.MEDIA_TYPE);

View file

@ -139,7 +139,7 @@ public class KeySerializerTest {
}
}
@Test public void serializeString() throws Exception {
@Test public void serializeString() {
String result = KeySerializer.deserializeString(KeySerializer.serializeString("value\n"));
assertThat(result).isEqualTo("value\n");
}

View file

@ -62,7 +62,7 @@ public class GoogleJsonResponseExceptionHelper {
}
@Override
protected LowLevelHttpRequest buildRequest(String method, String url) throws IOException {
protected LowLevelHttpRequest buildRequest(String method, String url) {
return new FakeLowLevelHttpRequest(statusCode, content);
}
}
@ -77,12 +77,12 @@ public class GoogleJsonResponseExceptionHelper {
}
@Override
public void addHeader(String name, String value) throws IOException {
public void addHeader(String name, String value) {
// Nothing!
}
@Override
public LowLevelHttpResponse execute() throws IOException {
public LowLevelHttpResponse execute() {
return new FakeLowLevelHttpResponse(statusCode, content);
}
}
@ -97,59 +97,59 @@ public class GoogleJsonResponseExceptionHelper {
}
@Override
public InputStream getContent() throws IOException {
public InputStream getContent() {
return content;
}
@Override
public String getContentEncoding() throws IOException {
public String getContentEncoding() {
return null;
}
@Override
public long getContentLength() throws IOException {
public long getContentLength() {
return 0;
}
@Override
public String getContentType() throws IOException {
public String getContentType() {
return "text/json";
}
@Override
public String getStatusLine() throws IOException {
public String getStatusLine() {
return null;
}
@Override
public int getStatusCode() throws IOException {
public int getStatusCode() {
return statusCode;
}
@Override
public String getReasonPhrase() throws IOException {
public String getReasonPhrase() {
return null;
}
@Override
public int getHeaderCount() throws IOException {
public int getHeaderCount() {
return 0;
}
@Override
public String getHeaderName(int index) throws IOException {
public String getHeaderName(int index) {
return null;
}
@Override
public String getHeaderValue(int index) throws IOException {
public String getHeaderValue(int index) {
return null;
}
}
private static class EmptyHttpContent implements HttpContent {
@Override
public long getLength() throws IOException {
public long getLength() {
return 0;
}
@ -164,7 +164,7 @@ public class GoogleJsonResponseExceptionHelper {
}
@Override
public void writeTo(OutputStream out) throws IOException {
public void writeTo(OutputStream out) {
// Nothing!
}
}

View file

@ -187,7 +187,7 @@ public class ChildEntityInputTest {
}
@Test
public void testSuccess_childEntityInput_polymorphicBaseType() throws Exception {
public void testSuccess_childEntityInput_polymorphicBaseType() {
createChildEntityInput(ImmutableSet.of(EppResource.class), ImmutableSet.of(BillingEvent.class));
}

View file

@ -73,19 +73,19 @@ public class EppResourceInputsTest {
}
@Test
public void testSuccess_keyInputType_polymorphicBaseType() throws Exception {
public void testSuccess_keyInputType_polymorphicBaseType() {
createKeyInput(DomainBase.class);
}
@Test
public void testFailure_keyInputType_polymorphicSubclass() throws Exception {
public void testFailure_keyInputType_polymorphicSubclass() {
IllegalArgumentException thrown =
assertThrows(IllegalArgumentException.class, () -> createKeyInput(DomainResource.class));
assertThat(thrown).hasMessageThat().contains("non-polymorphic");
}
@Test
public void testFailure_keyInputType_noInheritanceBetweenTypes_eppResource() throws Exception {
public void testFailure_keyInputType_noInheritanceBetweenTypes_eppResource() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,
@ -94,14 +94,14 @@ public class EppResourceInputsTest {
}
@Test
public void testSuccess_entityInputTypesMayBePolymorphic() throws Exception {
public void testSuccess_entityInputTypesMayBePolymorphic() {
// Both polymorphic and not should work.
createEntityInput(DomainBase.class);
createEntityInput(DomainResource.class);
}
@Test
public void testFailure_entityInputType_noInheritanceBetweenTypes_eppResource() throws Exception {
public void testFailure_entityInputType_noInheritanceBetweenTypes_eppResource() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,
@ -110,7 +110,7 @@ public class EppResourceInputsTest {
}
@Test
public void testFailure_entityInputType_noInheritanceBetweenTypes_subclasses() throws Exception {
public void testFailure_entityInputType_noInheritanceBetweenTypes_subclasses() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,

View file

@ -45,7 +45,7 @@ public class CreateAutoTimestampTest {
}
@Before
public void before() throws Exception {
public void before() {
ObjectifyService.register(TestObject.class);
}
@ -54,7 +54,7 @@ public class CreateAutoTimestampTest {
}
@Test
public void testSaveSetsTime() throws Exception {
public void testSaveSetsTime() {
DateTime transactionTime =
ofy()
.transact(
@ -69,7 +69,7 @@ public class CreateAutoTimestampTest {
}
@Test
public void testResavingRespectsOriginalTime() throws Exception {
public void testResavingRespectsOriginalTime() {
final DateTime oldCreateTime = DateTime.now(UTC).minusDays(1);
ofy()
.transact(

View file

@ -40,19 +40,19 @@ public class EntityClassesTest {
clazz -> clazz.getCanonicalName().substring(clazz.getPackage().getName().length()));
@Test
public void testEntityClasses_inAlphabeticalOrder() throws Exception {
public void testEntityClasses_inAlphabeticalOrder() {
assertThat(ALL_CLASSES).isStrictlyOrdered(QUALIFIED_CLASS_NAME_ORDERING);
}
@Test
public void testEntityClasses_baseEntitiesHaveUniqueKinds() throws Exception {
public void testEntityClasses_baseEntitiesHaveUniqueKinds() {
assertThat(ALL_CLASSES.stream().filter(hasAnnotation(Entity.class)).map(Key::getKind))
.named("base entity kinds")
.containsNoDuplicates();
}
@Test
public void testEntityClasses_entitySubclassesHaveKindsMatchingBaseEntities() throws Exception {
public void testEntityClasses_entitySubclassesHaveKindsMatchingBaseEntities() {
Set<String> baseEntityKinds =
ALL_CLASSES
.stream()
@ -69,7 +69,7 @@ public class EntityClassesTest {
}
@Test
public void testEntityClasses_eitherBaseEntityOrEntitySubclass() throws Exception {
public void testEntityClasses_eitherBaseEntityOrEntitySubclass() {
for (Class<?> clazz : ALL_CLASSES) {
boolean isEntityXorEntitySubclass =
clazz.isAnnotationPresent(Entity.class) ^ clazz.isAnnotationPresent(EntitySubclass.class);

View file

@ -60,7 +60,7 @@ public class EntityTestCase {
protected FakeClock clock = new FakeClock(DateTime.now(UTC));
@Before
public void injectClock() throws Exception {
public void injectClock() {
inject.setStaticField(Ofy.class, "clock", clock);
}

View file

@ -52,13 +52,13 @@ public class EppResourceUtilsTest {
private final FakeClock clock = new FakeClock(DateTime.now(UTC));
@Before
public void init() throws Exception {
public void init() {
createTld("tld");
inject.setStaticField(Ofy.class, "clock", clock);
}
@Test
public void testLoadAtPointInTime_beforeCreated_returnsNull() throws Exception {
public void testLoadAtPointInTime_beforeCreated_returnsNull() {
clock.advanceOneMilli();
// Don't save a commit log, we shouldn't need one.
HostResource host = persistResource(
@ -69,7 +69,7 @@ public class EppResourceUtilsTest {
}
@Test
public void testLoadAtPointInTime_atOrAfterLastAutoUpdateTime_returnsResource() throws Exception {
public void testLoadAtPointInTime_atOrAfterLastAutoUpdateTime_returnsResource() {
clock.advanceOneMilli();
// Don't save a commit log, we shouldn't need one.
HostResource host = persistResource(
@ -80,8 +80,7 @@ public class EppResourceUtilsTest {
}
@Test
public void testLoadAtPointInTime_usingIntactRevisionHistory_returnsMutationValue()
throws Exception {
public void testLoadAtPointInTime_usingIntactRevisionHistory_returnsMutationValue() {
clock.advanceOneMilli();
// Save resource with a commit log that we can read in later as a revisions map value.
HostResource oldHost = persistResourceWithCommitLog(
@ -102,8 +101,7 @@ public class EppResourceUtilsTest {
}
@Test
public void testLoadAtPointInTime_brokenRevisionHistory_returnsResourceAsIs()
throws Exception {
public void testLoadAtPointInTime_brokenRevisionHistory_returnsResourceAsIs() {
// Don't save a commit log since we want to test the handling of a broken revisions key.
HostResource oldHost = persistResource(
newHostResource("ns1.cat.tld").asBuilder()
@ -123,8 +121,7 @@ public class EppResourceUtilsTest {
}
@Test
public void testLoadAtPointInTime_fallback_returnsMutationValueForOldestRevision()
throws Exception {
public void testLoadAtPointInTime_fallback_returnsMutationValueForOldestRevision() {
clock.advanceOneMilli();
// Save a commit log that we can fall back to.
HostResource oldHost = persistResourceWithCommitLog(
@ -146,8 +143,7 @@ public class EppResourceUtilsTest {
}
@Test
public void testLoadAtPointInTime_ultimateFallback_onlyOneRevision_returnsCurrentResource()
throws Exception {
public void testLoadAtPointInTime_ultimateFallback_onlyOneRevision_returnsCurrentResource() {
clock.advanceOneMilli();
// Don't save a commit log; we want to test that we load from the current resource.
HostResource host = persistResource(
@ -162,7 +158,7 @@ public class EppResourceUtilsTest {
}
@Test
public void testLoadAtPointInTime_moreThanThirtyDaysInPast_historyIsPurged() throws Exception {
public void testLoadAtPointInTime_moreThanThirtyDaysInPast_historyIsPurged() {
clock.advanceOneMilli();
HostResource host =
persistResourceWithCommitLog(newHostResource("ns1.example.net"));

View file

@ -71,7 +71,7 @@ public class ImmutableObjectTest {
}
@Test
public void testToString_simpleClass() throws Exception {
public void testToString_simpleClass() {
SimpleObject object = new SimpleObject("foo", null);
assertThat(object.toString()).isEqualTo(""
+ "SimpleObject (@" + System.identityHashCode(object) + "): {\n"
@ -81,7 +81,7 @@ public class ImmutableObjectTest {
}
@Test
public void testToDiffableFieldMap_simpleClass() throws Exception {
public void testToDiffableFieldMap_simpleClass() {
SimpleObject object = new SimpleObject("foo", null);
assertThat(object.toDiffableFieldMap()).containsEntry("a", "foo");
assertThat(object.toDiffableFieldMap()).containsEntry("b", null);
@ -97,7 +97,7 @@ public class ImmutableObjectTest {
}
@Test
public void testToDiffableFieldMap_typesClass() throws Exception {
public void testToDiffableFieldMap_typesClass() {
TypesObject object = new TypesObject();
object.bool = true;
object.boolObject = true;
@ -121,7 +121,7 @@ public class ImmutableObjectTest {
}
@Test
public void testToDiffableFieldMap_nestedObjectClass() throws Exception {
public void testToDiffableFieldMap_nestedObjectClass() {
SimpleObject innermostObject = new SimpleObject("foo", "bar");
NestedObject innerObject = new NestedObject(innermostObject);
NestedObject object = new NestedObject(innerObject);
@ -140,7 +140,7 @@ public class ImmutableObjectTest {
}
@Test
public void testToDiffableFieldMap_nestedObjectCollectionsClass() throws Exception {
public void testToDiffableFieldMap_nestedObjectCollectionsClass() {
SimpleObject obj1 = new SimpleObject("foo", "bar");
SimpleObject obj2 = new SimpleObject("bax", "bar");
Map<?, ?> obj1map = obj1.toDiffableFieldMap();
@ -169,13 +169,13 @@ public class ImmutableObjectTest {
}
@Test
public void testToDiffableFieldMap_iterableField_notExpanded() throws Exception {
public void testToDiffableFieldMap_iterableField_notExpanded() {
IterableObject iterableObject = new IterableObject(new CidrAddressBlock("127.0.0.1/32"));
assertThat(iterableObject.toDiffableFieldMap()).containsEntry("iterable", "127.0.0.1/32");
}
@Test
public void testToDiffableFieldMap_infiniteIterableField_notExpanded() throws Exception {
public void testToDiffableFieldMap_infiniteIterableField_notExpanded() {
IterableObject iterableObject = new IterableObject(Iterables.cycle("na"));
assertThat(iterableObject.toDiffableFieldMap()).containsEntry("iterable", "[na] (cycled)");
}

View file

@ -33,7 +33,7 @@ public class SchemaVersionTest {
public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
@Test
public void testGoldenSchemaFile() throws Exception {
public void testGoldenSchemaFile() {
GoldenFileTestHelper.assertThat(SchemaVersion.getSchema())
.describedAs("Datastore schema")
.createdByNomulusCommand("get_schema")

View file

@ -45,7 +45,7 @@ public class UpdateAutoTimestampTest {
}
@Before
public void before() throws Exception {
public void before() {
ObjectifyService.register(TestObject.class);
}
@ -54,7 +54,7 @@ public class UpdateAutoTimestampTest {
}
@Test
public void testSaveSetsTime() throws Exception {
public void testSaveSetsTime() {
DateTime transactionTime =
ofy()
.transact(
@ -69,7 +69,7 @@ public class UpdateAutoTimestampTest {
}
@Test
public void testResavingOverwritesOriginalTime() throws Exception {
public void testResavingOverwritesOriginalTime() {
DateTime transactionTime =
ofy()
.transact(

View file

@ -53,7 +53,7 @@ public class BillingEventTest extends EntityTestCase {
BillingEvent.Modification modification;
@Before
public void setUp() throws Exception {
public void setUp() {
createTld("tld");
domain = persistActiveDomain("foo.tld");
historyEntry = persistResource(
@ -126,7 +126,7 @@ public class BillingEventTest extends EntityTestCase {
}
@Test
public void testPersistence() throws Exception {
public void testPersistence() {
assertThat(ofy().load().entity(oneTime).now()).isEqualTo(oneTime);
assertThat(ofy().load().entity(oneTimeSynthetic).now()).isEqualTo(oneTimeSynthetic);
assertThat(ofy().load().entity(recurring).now()).isEqualTo(recurring);
@ -136,7 +136,7 @@ public class BillingEventTest extends EntityTestCase {
}
@Test
public void testParenting() throws Exception {
public void testParenting() {
// Note that these are all tested separately because BillingEvent is an abstract base class that
// lacks the @Entity annotation, and thus we cannot call .type(BillingEvent.class)
assertThat(ofy().load().type(BillingEvent.OneTime.class).ancestor(domain).list())
@ -158,7 +158,7 @@ public class BillingEventTest extends EntityTestCase {
}
@Test
public void testCancellationMatching() throws Exception {
public void testCancellationMatching() {
Key<?> recurringKey = ofy().load().entity(oneTimeSynthetic).now()
.getCancellationMatchingBillingEvent();
assertThat(ofy().load().key(recurringKey).now()).isEqualTo(recurring);
@ -306,7 +306,7 @@ public class BillingEventTest extends EntityTestCase {
}
@Test
public void testDeadCodeThatDeletedScrapCommandsReference() throws Exception {
public void testDeadCodeThatDeletedScrapCommandsReference() {
assertThat(recurring.getParentKey()).isEqualTo(Key.create(historyEntry));
new BillingEvent.OneTime.Builder().setParent(Key.create(historyEntry));
}

View file

@ -51,7 +51,7 @@ public final class RegistrarBillingEntryTest extends EntityTestCase {
}
@Test
public void testGetters() throws Exception {
public void testGetters() {
RegistrarBillingEntry entry =
new RegistrarBillingEntry.Builder()
.setPrevious(null)
@ -71,7 +71,7 @@ public final class RegistrarBillingEntryTest extends EntityTestCase {
}
@Test
public void testToJsonMap() throws Exception {
public void testToJsonMap() {
assertThat(
new RegistrarBillingEntry.Builder()
.setPrevious(null)
@ -95,7 +95,7 @@ public final class RegistrarBillingEntryTest extends EntityTestCase {
}
@Test
public void testBadTimeOrdering_causesError() throws Exception {
public void testBadTimeOrdering_causesError() {
IllegalStateException thrown =
assertThrows(
IllegalStateException.class,
@ -119,7 +119,7 @@ public final class RegistrarBillingEntryTest extends EntityTestCase {
}
@Test
public void testRegistrarMismatch_causesError() throws Exception {
public void testRegistrarMismatch_causesError() {
IllegalStateException thrown =
assertThrows(
IllegalStateException.class,
@ -143,7 +143,7 @@ public final class RegistrarBillingEntryTest extends EntityTestCase {
}
@Test
public void testCurrencyMismatch_causesError() throws Exception {
public void testCurrencyMismatch_causesError() {
assertThrows(
CurrencyMismatchException.class,
() ->
@ -165,7 +165,7 @@ public final class RegistrarBillingEntryTest extends EntityTestCase {
}
@Test
public void testZeroAmount_causesError() throws Exception {
public void testZeroAmount_causesError() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,

View file

@ -56,7 +56,7 @@ public final class RegistrarBillingUtilsTest {
private Registrar registrar;
@Before
public void before() throws Exception {
public void before() {
inject.setStaticField(Ofy.class, "clock", clock);
registrar = loadRegistrar("NewRegistrar");
createTlds("xn--q9jyb4c", "com", "net");

View file

@ -48,7 +48,7 @@ public class RegistrarCreditBalanceTest extends EntityTestCase {
Map<DateTime, ? extends Map<DateTime, Money>> rawBalanceMap;
@Before
public void setUp() throws Exception {
public void setUp() {
createTld("tld");
theRegistrar = loadRegistrar("TheRegistrar");
unpersistedCredit = makeCredit(theRegistrar, clock.nowUtc());
@ -79,7 +79,7 @@ public class RegistrarCreditBalanceTest extends EntityTestCase {
}
@Test
public void testPersistence() throws Exception {
public void testPersistence() {
assertThat(ofy().load().entity(balance).now()).isEqualTo(balance);
}
@ -89,19 +89,19 @@ public class RegistrarCreditBalanceTest extends EntityTestCase {
verifyIndexing(balance);
}
@Test
public void testSuccess_balanceWithUnpersistedCredit() throws Exception {
public void testSuccess_balanceWithUnpersistedCredit() {
balance.asBuilder().setParent(unpersistedCredit).build();
}
@Test
public void testFailure_balanceNotInCreditCurrency() throws Exception {
public void testFailure_balanceNotInCreditCurrency() {
assertThrows(
IllegalStateException.class,
() -> balance.asBuilder().setAmount(Money.parse("JPY 1")).build());
}
@Test
public void testFailure_balanceNotInCreditCurrencyWithUnpersistedCredit() throws Exception {
public void testFailure_balanceNotInCreditCurrencyWithUnpersistedCredit() {
assertThrows(
IllegalStateException.class,
() ->
@ -113,17 +113,17 @@ public class RegistrarCreditBalanceTest extends EntityTestCase {
}
@Test
public void testSuccess_balanceMap_createForCredit() throws Exception {
public void testSuccess_balanceMap_createForCredit() {
assertThat(BalanceMap.createForCredit(credit)).isEqualTo(rawBalanceMap);
}
@Test
public void testSuccess_balanceMap_createForEmptyCredit() throws Exception {
public void testSuccess_balanceMap_createForEmptyCredit() {
assertThat(BalanceMap.createForCredit(makeCredit(theRegistrar, clock.nowUtc()))).isEmpty();
}
@Test
public void testSuccess_balanceMap_getActiveBalance_emptyMap() throws Exception {
public void testSuccess_balanceMap_getActiveBalance_emptyMap() {
BalanceMap map = new BalanceMap(ImmutableMap.of());
assertThat(map.getActiveBalanceAtTime(START_OF_TIME)).isEmpty();
assertThat(map.getActiveBalanceAtTime(clock.nowUtc())).isEmpty();
@ -134,7 +134,7 @@ public class RegistrarCreditBalanceTest extends EntityTestCase {
}
@Test
public void testSuccess_balanceMap_getActiveBalanceAtTime() throws Exception {
public void testSuccess_balanceMap_getActiveBalanceAtTime() {
BalanceMap map = new BalanceMap(rawBalanceMap);
assertThat(map.getActiveBalanceAtTime(START_OF_TIME)).isEmpty();
assertThat(map.getActiveBalanceAtTime(clock.nowUtc().minusMillis(1))).isEmpty();
@ -150,7 +150,7 @@ public class RegistrarCreditBalanceTest extends EntityTestCase {
}
@Test
public void testSuccess_balanceMap_getActiveBalanceBeforeTime() throws Exception {
public void testSuccess_balanceMap_getActiveBalanceBeforeTime() {
BalanceMap map = new BalanceMap(rawBalanceMap);
assertThat(map.getActiveBalanceBeforeTime(START_OF_TIME)).isEmpty();
assertThat(map.getActiveBalanceBeforeTime(clock.nowUtc().minusMillis(1))).isEmpty();

View file

@ -37,7 +37,7 @@ public class RegistrarCreditTest extends EntityTestCase {
private RegistrarCredit promoCredit;
@Before
public void setUp() throws Exception {
public void setUp() {
createTld("tld");
Registrar theRegistrar = ofy().load()
.type(Registrar.class)
@ -62,7 +62,7 @@ public class RegistrarCreditTest extends EntityTestCase {
}
@Test
public void testPersistence() throws Exception {
public void testPersistence() {
assertThat(ofy().load().entity(auctionCredit).now()).isEqualTo(auctionCredit);
assertThat(ofy().load().entity(promoCredit).now()).isEqualTo(promoCredit);
}
@ -75,7 +75,7 @@ public class RegistrarCreditTest extends EntityTestCase {
}
@Test
public void testFailure_missingTld() throws Exception {
public void testFailure_missingTld() {
NullPointerException thrown =
assertThrows(
NullPointerException.class, () -> promoCredit.asBuilder().setTld(null).build());
@ -83,7 +83,7 @@ public class RegistrarCreditTest extends EntityTestCase {
}
@Test
public void testFailure_NonexistentTld() throws Exception {
public void testFailure_NonexistentTld() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,
@ -92,7 +92,7 @@ public class RegistrarCreditTest extends EntityTestCase {
}
@Test
public void testFailure_CurrencyDoesNotMatchTldCurrency() throws Exception {
public void testFailure_CurrencyDoesNotMatchTldCurrency() {
assertThat(Registry.get("tld").getCurrency()).isEqualTo(USD);
IllegalArgumentException thrown =
assertThrows(

View file

@ -65,7 +65,7 @@ public class CursorTest extends EntityTestCase {
}
@Test
public void testFailure_invalidScopeOnCreate() throws Exception {
public void testFailure_invalidScopeOnCreate() {
createTld("tld");
clock.advanceOneMilli();
final DateTime time = DateTime.parse("2012-07-12T03:30:00.000Z");
@ -81,7 +81,7 @@ public class CursorTest extends EntityTestCase {
}
@Test
public void testFailure_invalidScopeOnKeyCreate() throws Exception {
public void testFailure_invalidScopeOnKeyCreate() {
createTld("tld");
IllegalArgumentException thrown =
assertThrows(
@ -93,14 +93,14 @@ public class CursorTest extends EntityTestCase {
}
@Test
public void testFailure_createGlobalKeyForScopedCursorType() throws Exception {
public void testFailure_createGlobalKeyForScopedCursorType() {
IllegalArgumentException thrown =
assertThrows(IllegalArgumentException.class, () -> Cursor.createGlobalKey(RDE_UPLOAD));
assertThat(thrown).hasMessageThat().contains("Cursor type is not a global cursor");
}
@Test
public void testFailure_invalidScopeOnGlobalKeyCreate() throws Exception {
public void testFailure_invalidScopeOnGlobalKeyCreate() {
createTld("tld");
IllegalArgumentException thrown =
assertThrows(
@ -112,7 +112,7 @@ public class CursorTest extends EntityTestCase {
}
@Test
public void testFailure_nullScope() throws Exception {
public void testFailure_nullScope() {
NullPointerException thrown =
assertThrows(
NullPointerException.class,
@ -121,7 +121,7 @@ public class CursorTest extends EntityTestCase {
}
@Test
public void testFailure_nullCursorType() throws Exception {
public void testFailure_nullCursorType() {
createTld("tld");
NullPointerException thrown =
assertThrows(
@ -131,7 +131,7 @@ public class CursorTest extends EntityTestCase {
}
@Test
public void testFailure_nullTime() throws Exception {
public void testFailure_nullTime() {
createTld("tld");
NullPointerException thrown =
assertThrows(

View file

@ -34,14 +34,14 @@ public class TimeOfYearTest {
private static final DateTime march1 = DateTime.parse("2012-03-01T01:02:03.0Z");
@Test
public void testSuccess_fromDateTime() throws Exception {
public void testSuccess_fromDateTime() {
// We intentionally don't allow leap years in TimeOfYear, so February 29 should be February 28.
assertThat(TimeOfYear.fromDateTime(february28)).isEqualTo(TimeOfYear.fromDateTime(february29));
assertThat(TimeOfYear.fromDateTime(february29)).isNotEqualTo(TimeOfYear.fromDateTime(march1));
}
@Test
public void testSuccess_nextAfter() throws Exception {
public void testSuccess_nextAfter() {
// This should be lossless because atOrAfter includes an exact match.
assertThat(TimeOfYear.fromDateTime(march1).getNextInstanceAtOrAfter(march1)).isEqualTo(march1);
// This should be a year later because we stepped forward a millisecond
@ -50,7 +50,7 @@ public class TimeOfYearTest {
}
@Test
public void testSuccess_nextBefore() throws Exception {
public void testSuccess_nextBefore() {
// This should be lossless because beforeOrAt includes an exact match.
assertThat(TimeOfYear.fromDateTime(march1).getLastInstanceBeforeOrAt(march1)).isEqualTo(march1);
// This should be a year earlier because we stepped backward a millisecond

Some files were not shown because too many files have changed in this diff Show more