diff --git a/javatests/google/registry/export/BigqueryPollJobActionTest.java b/javatests/google/registry/export/BigqueryPollJobActionTest.java index 9ce3f3b10..a9850cbbe 100644 --- a/javatests/google/registry/export/BigqueryPollJobActionTest.java +++ b/javatests/google/registry/export/BigqueryPollJobActionTest.java @@ -189,13 +189,13 @@ public class BigqueryPollJobActionTest { public void testJobPending() throws Exception { when(bigqueryJobsGet.execute()).thenReturn( new Job().setStatus(new JobStatus().setState("PENDING"))); - assertThrows(NotModifiedException.class, () -> action.run()); + assertThrows(NotModifiedException.class, action::run); } @Test public void testJobStatusUnreadable() throws Exception { when(bigqueryJobsGet.execute()).thenThrow(IOException.class); - assertThrows(NotModifiedException.class, () -> action.run()); + assertThrows(NotModifiedException.class, action::run); } @Test @@ -203,7 +203,7 @@ public class BigqueryPollJobActionTest { when(bigqueryJobsGet.execute()).thenReturn( new Job().setStatus(new JobStatus().setState("DONE"))); action.payload = "payload".getBytes(UTF_8); - BadRequestException thrown = expectThrows(BadRequestException.class, () -> action.run()); + BadRequestException thrown = expectThrows(BadRequestException.class, action::run); assertThat(thrown).hasMessageThat().contains("Cannot deserialize task from payload"); } } diff --git a/javatests/google/registry/export/CheckSnapshotActionTest.java b/javatests/google/registry/export/CheckSnapshotActionTest.java index 22fab01c0..de0c4b9fe 100644 --- a/javatests/google/registry/export/CheckSnapshotActionTest.java +++ b/javatests/google/registry/export/CheckSnapshotActionTest.java @@ -122,7 +122,7 @@ public class CheckSnapshotActionTest { public void testPost_forPendingBackup_returnsNotModified() throws Exception { setPendingBackup(); - NotModifiedException thrown = expectThrows(NotModifiedException.class, () -> action.run()); + NotModifiedException thrown = expectThrows(NotModifiedException.class, action::run); assertThat(thrown).hasMessageThat().contains("Datastore backup some_backup still pending"); } @@ -138,7 +138,7 @@ public class CheckSnapshotActionTest { .plus(Duration.standardMinutes(3)) .plus(Duration.millis(1234))); - NoContentException thrown = expectThrows(NoContentException.class, () -> action.run()); + NoContentException thrown = expectThrows(NoContentException.class, action::run); assertThat(thrown) .hasMessageThat() .contains( @@ -186,7 +186,7 @@ public class CheckSnapshotActionTest { when(backupService.findByName("some_backup")) .thenThrow(new IllegalArgumentException("No backup found")); - BadRequestException thrown = expectThrows(BadRequestException.class, () -> action.run()); + BadRequestException thrown = expectThrows(BadRequestException.class, action::run); assertThat(thrown).hasMessageThat().contains("Bad backup name some_backup: No backup found"); } @@ -216,7 +216,7 @@ public class CheckSnapshotActionTest { when(backupService.findByName("some_backup")) .thenThrow(new IllegalArgumentException("No backup found")); - BadRequestException thrown = expectThrows(BadRequestException.class, () -> action.run()); + BadRequestException thrown = expectThrows(BadRequestException.class, action::run); assertThat(thrown).hasMessageThat().contains("Bad backup name some_backup: No backup found"); } } diff --git a/javatests/google/registry/export/LoadSnapshotActionTest.java b/javatests/google/registry/export/LoadSnapshotActionTest.java index 626f4c2ff..6583431b9 100644 --- a/javatests/google/registry/export/LoadSnapshotActionTest.java +++ b/javatests/google/registry/export/LoadSnapshotActionTest.java @@ -182,7 +182,7 @@ public class LoadSnapshotActionTest { @Test public void testFailure_doPost_badGcsFilename() throws Exception { action.snapshotFile = "gs://bucket/snapshot"; - BadRequestException thrown = expectThrows(BadRequestException.class, () -> action.run()); + BadRequestException thrown = expectThrows(BadRequestException.class, action::run); assertThat(thrown) .hasMessageThat() .contains("Error calling load snapshot: backup info file extension missing"); @@ -192,7 +192,7 @@ public class LoadSnapshotActionTest { public void testFailure_doPost_bigqueryThrowsException() throws Exception { when(bigqueryJobsInsert.execute()).thenThrow(new IOException("The Internet has gone missing")); InternalServerErrorException thrown = - expectThrows(InternalServerErrorException.class, () -> action.run()); + expectThrows(InternalServerErrorException.class, action::run); assertThat(thrown) .hasMessageThat() .contains("Error loading snapshot: The Internet has gone missing"); diff --git a/javatests/google/registry/export/UpdateSnapshotViewActionTest.java b/javatests/google/registry/export/UpdateSnapshotViewActionTest.java index 5b308953e..eee61a3b5 100644 --- a/javatests/google/registry/export/UpdateSnapshotViewActionTest.java +++ b/javatests/google/registry/export/UpdateSnapshotViewActionTest.java @@ -124,7 +124,7 @@ public class UpdateSnapshotViewActionTest { when(bigqueryTables.update(anyString(), anyString(), anyString(), any(Table.class))) .thenThrow(new IOException("I'm sorry Dave, I can't let you do that")); InternalServerErrorException thrown = - expectThrows(InternalServerErrorException.class, () -> action.run()); + expectThrows(InternalServerErrorException.class, action::run); assertThat(thrown).hasMessageThat().contains("Error in update snapshot view action"); } } diff --git a/javatests/google/registry/flows/ResourceFlowTestCase.java b/javatests/google/registry/flows/ResourceFlowTestCase.java index fdeee3ed3..25434fa5f 100644 --- a/javatests/google/registry/flows/ResourceFlowTestCase.java +++ b/javatests/google/registry/flows/ResourceFlowTestCase.java @@ -132,7 +132,7 @@ public abstract class ResourceFlowTestCase runFlow()); + assertThrows(NotLoggedInException.class, this::runFlow); } /** diff --git a/javatests/google/registry/flows/contact/ContactCheckFlowTest.java b/javatests/google/registry/flows/contact/ContactCheckFlowTest.java index 6fb842c6e..1e9ae1190 100644 --- a/javatests/google/registry/flows/contact/ContactCheckFlowTest.java +++ b/javatests/google/registry/flows/contact/ContactCheckFlowTest.java @@ -77,7 +77,7 @@ public class ContactCheckFlowTest @Test public void testTooManyIds() throws Exception { setEppInput("contact_check_51.xml"); - assertThrows(TooManyResourceChecksException.class, () -> runFlow()); + assertThrows(TooManyResourceChecksException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/contact/ContactCreateFlowTest.java b/javatests/google/registry/flows/contact/ContactCreateFlowTest.java index 9491fa9c2..882f1854d 100644 --- a/javatests/google/registry/flows/contact/ContactCreateFlowTest.java +++ b/javatests/google/registry/flows/contact/ContactCreateFlowTest.java @@ -70,7 +70,7 @@ public class ContactCreateFlowTest public void testFailure_alreadyExists() throws Exception { persistActiveContact(getUniqueIdFromCommand()); ResourceAlreadyExistsException thrown = - expectThrows(ResourceAlreadyExistsException.class, () -> runFlow()); + expectThrows(ResourceAlreadyExistsException.class, this::runFlow); assertThat(thrown) .hasMessageThat() .contains( @@ -86,13 +86,13 @@ public class ContactCreateFlowTest @Test public void testFailure_nonAsciiInIntAddress() throws Exception { setEppInput("contact_create_hebrew_int.xml"); - assertThrows(BadInternationalizedPostalInfoException.class, () -> runFlow()); + assertThrows(BadInternationalizedPostalInfoException.class, this::runFlow); } @Test public void testFailure_declineDisclosure() throws Exception { setEppInput("contact_create_decline_disclosure.xml"); - assertThrows(DeclineContactDisclosureFieldDisallowedPolicyException.class, () -> runFlow()); + assertThrows(DeclineContactDisclosureFieldDisallowedPolicyException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/contact/ContactDeleteFlowTest.java b/javatests/google/registry/flows/contact/ContactDeleteFlowTest.java index a9ee77b71..ec102d09f 100644 --- a/javatests/google/registry/flows/contact/ContactDeleteFlowTest.java +++ b/javatests/google/registry/flows/contact/ContactDeleteFlowTest.java @@ -73,7 +73,7 @@ public class ContactDeleteFlowTest @Test public void testFailure_neverExisted() throws Exception { ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -81,7 +81,7 @@ public class ContactDeleteFlowTest public void testFailure_existedButWasDeleted() throws Exception { persistDeletedContact(getUniqueIdFromCommand(), clock.nowUtc().minusDays(1)); ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -117,7 +117,7 @@ public class ContactDeleteFlowTest public void testFailure_unauthorizedClient() throws Exception { sessionMetadata.setClientId("NewRegistrar"); persistActiveContact(getUniqueIdFromCommand()); - assertThrows(ResourceNotOwnedException.class, () -> runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -142,7 +142,7 @@ public class ContactDeleteFlowTest createTld("tld"); persistResource( newDomainResource("example.tld", persistActiveContact(getUniqueIdFromCommand()))); - assertThrows(ResourceToDeleteIsReferencedException.class, () -> runFlow()); + assertThrows(ResourceToDeleteIsReferencedException.class, this::runFlow); } @Test @@ -150,7 +150,7 @@ public class ContactDeleteFlowTest createTld("tld"); persistResource( newDomainResource("example.tld", persistActiveContact(getUniqueIdFromCommand()))); - assertThrows(ResourceToDeleteIsReferencedException.class, () -> runFlow()); + assertThrows(ResourceToDeleteIsReferencedException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/contact/ContactInfoFlowTest.java b/javatests/google/registry/flows/contact/ContactInfoFlowTest.java index 2d695a74b..34b8eae0f 100644 --- a/javatests/google/registry/flows/contact/ContactInfoFlowTest.java +++ b/javatests/google/registry/flows/contact/ContactInfoFlowTest.java @@ -165,7 +165,7 @@ public class ContactInfoFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -173,7 +173,7 @@ public class ContactInfoFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } diff --git a/javatests/google/registry/flows/contact/ContactUpdateFlowTest.java b/javatests/google/registry/flows/contact/ContactUpdateFlowTest.java index aadad3632..7893b74a7 100644 --- a/javatests/google/registry/flows/contact/ContactUpdateFlowTest.java +++ b/javatests/google/registry/flows/contact/ContactUpdateFlowTest.java @@ -257,7 +257,7 @@ public class ContactUpdateFlowTest @Test public void testFailure_neverExisted() throws Exception { ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -265,7 +265,7 @@ public class ContactUpdateFlowTest public void testFailure_existedButWasDeleted() throws Exception { persistDeletedContact(getUniqueIdFromCommand(), clock.nowUtc().minusDays(1)); ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -273,7 +273,7 @@ public class ContactUpdateFlowTest public void testFailure_statusValueNotClientSettable() throws Exception { setEppInput("contact_update_prohibited_status.xml"); persistActiveContact(getUniqueIdFromCommand()); - assertThrows(StatusNotClientSettableException.class, () -> runFlow()); + assertThrows(StatusNotClientSettableException.class, this::runFlow); } @Test @@ -291,7 +291,7 @@ public class ContactUpdateFlowTest public void testFailure_unauthorizedClient() throws Exception { sessionMetadata.setClientId("NewRegistrar"); persistActiveContact(getUniqueIdFromCommand()); - assertThrows(ResourceNotOwnedException.class, () -> runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -338,7 +338,7 @@ public class ContactUpdateFlowTest newContactResource(getUniqueIdFromCommand()).asBuilder() .setStatusValues(ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED)) .build()); - assertThrows(ResourceHasClientUpdateProhibitedException.class, () -> runFlow()); + assertThrows(ResourceHasClientUpdateProhibitedException.class, this::runFlow); } @Test @@ -348,7 +348,7 @@ public class ContactUpdateFlowTest .setStatusValues(ImmutableSet.of(StatusValue.SERVER_UPDATE_PROHIBITED)) .build()); ResourceStatusProhibitsOperationException thrown = - expectThrows(ResourceStatusProhibitsOperationException.class, () -> runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("serverUpdateProhibited"); } @@ -359,7 +359,7 @@ public class ContactUpdateFlowTest .setStatusValues(ImmutableSet.of(StatusValue.PENDING_DELETE)) .build()); ResourceStatusProhibitsOperationException thrown = - expectThrows(ResourceStatusProhibitsOperationException.class, () -> runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("pendingDelete"); } @@ -373,21 +373,21 @@ public class ContactUpdateFlowTest public void testFailure_nonAsciiInIntAddress() throws Exception { setEppInput("contact_update_hebrew_int.xml"); persistActiveContact(getUniqueIdFromCommand()); - assertThrows(BadInternationalizedPostalInfoException.class, () -> runFlow()); + assertThrows(BadInternationalizedPostalInfoException.class, this::runFlow); } @Test public void testFailure_declineDisclosure() throws Exception { setEppInput("contact_update_decline_disclosure.xml"); persistActiveContact(getUniqueIdFromCommand()); - assertThrows(DeclineContactDisclosureFieldDisallowedPolicyException.class, () -> runFlow()); + assertThrows(DeclineContactDisclosureFieldDisallowedPolicyException.class, this::runFlow); } @Test public void testFailure_addRemoveSameValue() throws Exception { setEppInput("contact_update_add_remove_same.xml"); persistActiveContact(getUniqueIdFromCommand()); - assertThrows(AddRemoveSameValueException.class, () -> runFlow()); + assertThrows(AddRemoveSameValueException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/domain/DomainAllocateFlowTest.java b/javatests/google/registry/flows/domain/DomainAllocateFlowTest.java index fdf1c41bb..9e6881efe 100644 --- a/javatests/google/registry/flows/domain/DomainAllocateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainAllocateFlowTest.java @@ -256,7 +256,7 @@ public class DomainAllocateFlowTest .setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns2.example.net")) .build()); NameserversNotAllowedForTldException thrown = - expectThrows(NameserversNotAllowedForTldException.class, () -> runFlowAsSuperuser()); + expectThrows(NameserversNotAllowedForTldException.class, this::runFlowAsSuperuser); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -271,7 +271,7 @@ public class DomainAllocateFlowTest ImmutableSet.of("ns1.example.net", "ns2.example.net")) .build()); RegistrantNotAllowedException thrown = - expectThrows(RegistrantNotAllowedException.class, () -> runFlowAsSuperuser()); + expectThrows(RegistrantNotAllowedException.class, this::runFlowAsSuperuser); assertThat(thrown).hasMessageThat().contains("jd1234"); } @@ -287,7 +287,7 @@ public class DomainAllocateFlowTest .build()); assertThrows( NameserversNotSpecifiedForTldWithNameserverWhitelistException.class, - () -> runFlowAsSuperuser()); + this::runFlowAsSuperuser); } @Test @@ -317,7 +317,7 @@ public class DomainAllocateFlowTest "example-one,NAMESERVER_RESTRICTED," + "ns2.example.net:ns3.example.net")) .build()); NameserversNotAllowedForDomainException thrown = - expectThrows(NameserversNotAllowedForDomainException.class, () -> runFlowAsSuperuser()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlowAsSuperuser); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -335,7 +335,7 @@ public class DomainAllocateFlowTest .build()); assertThrows( NameserversNotSpecifiedForNameserverRestrictedDomainException.class, - () -> runFlowAsSuperuser()); + this::runFlowAsSuperuser); } @Test @@ -371,7 +371,7 @@ public class DomainAllocateFlowTest ImmutableSet.of("ns1.example.net", "ns2.example.net", "ns3.example.net")) .build()); NameserversNotAllowedForDomainException thrown = - expectThrows(NameserversNotAllowedForDomainException.class, () -> runFlowAsSuperuser()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlowAsSuperuser); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -390,7 +390,7 @@ public class DomainAllocateFlowTest ImmutableSet.of("ns4.example.net", "ns2.example.net", "ns3.example.net")) .build()); NameserversNotAllowedForTldException thrown = - expectThrows(NameserversNotAllowedForTldException.class, () -> runFlowAsSuperuser()); + expectThrows(NameserversNotAllowedForTldException.class, this::runFlowAsSuperuser); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -575,7 +575,7 @@ public class DomainAllocateFlowTest public void testFailure_alreadyExists() throws Exception { setupDomainApplication("tld", TldState.QUIET_PERIOD); persistActiveDomain(getUniqueIdFromCommand()); - assertThrows(ResourceAlreadyExistsException.class, () -> runFlowAsSuperuser()); + assertThrows(ResourceAlreadyExistsException.class, this::runFlowAsSuperuser); } @Test @@ -610,7 +610,7 @@ public class DomainAllocateFlowTest public void testFailure_applicationDeleted() throws Exception { setupDomainApplication("tld", TldState.QUIET_PERIOD); persistResource(application.asBuilder().setDeletionTime(clock.nowUtc()).build()); - assertThrows(MissingApplicationException.class, () -> runFlowAsSuperuser()); + assertThrows(MissingApplicationException.class, this::runFlowAsSuperuser); } @Test @@ -619,7 +619,7 @@ public class DomainAllocateFlowTest persistResource(application.asBuilder() .setApplicationStatus(ApplicationStatus.REJECTED) .build()); - assertThrows(HasFinalStatusException.class, () -> runFlowAsSuperuser()); + assertThrows(HasFinalStatusException.class, this::runFlowAsSuperuser); } @Test @@ -628,14 +628,14 @@ public class DomainAllocateFlowTest persistResource(application.asBuilder() .setApplicationStatus(ApplicationStatus.ALLOCATED) .build()); - assertThrows(HasFinalStatusException.class, () -> runFlowAsSuperuser()); + assertThrows(HasFinalStatusException.class, this::runFlowAsSuperuser); } @Test public void testFailure_applicationDoesNotExist() throws Exception { setupDomainApplication("tld", TldState.QUIET_PERIOD); setEppInput("domain_allocate_bad_application_roid.xml"); - assertThrows(MissingApplicationException.class, () -> runFlowAsSuperuser()); + assertThrows(MissingApplicationException.class, this::runFlowAsSuperuser); } @Test @@ -653,7 +653,7 @@ public class DomainAllocateFlowTest public void testFailure_max10Years() throws Exception { setupDomainApplication("tld", TldState.QUIET_PERIOD); setEppInput("domain_allocate_11_years.xml"); - assertThrows(ExceedsMaxRegistrationYearsException.class, () -> runFlowAsSuperuser()); + assertThrows(ExceedsMaxRegistrationYearsException.class, this::runFlowAsSuperuser); } @Test diff --git a/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java index 279d2859c..cfabc19f5 100644 --- a/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java @@ -246,7 +246,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrush_encoded_signed_mark_corrupt.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(SignedMarkParsingErrorException.class, () -> runFlow()); + assertThrows(SignedMarkParsingErrorException.class, this::runFlow); } @Test @@ -255,7 +255,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrush_encoded_signed_mark_revoked_cert.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(SignedMarkCertificateRevokedException.class, () -> runFlow()); + assertThrows(SignedMarkCertificateRevokedException.class, this::runFlow); } @Test @@ -266,7 +266,7 @@ public class DomainApplicationCreateFlowTest clock.advanceOneMilli(); clock.setTo(DateTime.parse("2022-01-01")); clock.setTo(DateTime.parse("2022-01-01")); - assertThrows(SignedMarkCertificateExpiredException.class, () -> runFlow()); + assertThrows(SignedMarkCertificateExpiredException.class, this::runFlow); } @Test @@ -276,7 +276,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); clock.setTo(DateTime.parse("2012-07-22T00:01:00Z")); - assertThrows(SignedMarkCertificateNotYetValidException.class, () -> runFlow()); + assertThrows(SignedMarkCertificateNotYetValidException.class, this::runFlow); } @Test @@ -293,7 +293,7 @@ public class DomainApplicationCreateFlowTest public void verify(byte[] smdXml) throws GeneralSecurityException { throw new GeneralSecurityException(); }}; - assertThrows(SignedMarkCertificateInvalidException.class, () -> runFlow()); + assertThrows(SignedMarkCertificateInvalidException.class, this::runFlow); } @Test @@ -303,7 +303,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrush_encoded_signed_mark.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(SignedMarkCertificateSignatureException.class, () -> runFlow()); + assertThrows(SignedMarkCertificateSignatureException.class, this::runFlow); } @Test @@ -312,7 +312,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrush_encoded_signed_mark_signature_corrupt.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(SignedMarkSignatureException.class, () -> runFlow()); + assertThrows(SignedMarkSignatureException.class, this::runFlow); } @Test @@ -388,7 +388,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_allowedinsunrise.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(DomainReservedException.class, () -> runFlow()); + assertThrows(DomainReservedException.class, this::runFlow); } @Test @@ -399,7 +399,7 @@ public class DomainApplicationCreateFlowTest clock.advanceOneMilli(); // Modify the Registrar to block premium names. persistResource(loadRegistrar("TheRegistrar").asBuilder().setBlockPremiumNames(true).build()); - assertThrows(PremiumNameBlockedException.class, () -> runFlow()); + assertThrows(PremiumNameBlockedException.class, this::runFlow); } @Test @@ -408,7 +408,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_premium.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(FeesRequiredForPremiumNameException.class, () -> runFlow()); + assertThrows(FeesRequiredForPremiumNameException.class, this::runFlow); } @Test @@ -517,7 +517,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); setEppInput("domain_create_landrush_fee_refundable.xml", ImmutableMap.of("FEE_VERSION", "0.6")); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -527,7 +527,7 @@ public class DomainApplicationCreateFlowTest clock.advanceOneMilli(); setEppInput( "domain_create_landrush_fee_refundable.xml", ImmutableMap.of("FEE_VERSION", "0.11")); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -537,7 +537,7 @@ public class DomainApplicationCreateFlowTest clock.advanceOneMilli(); setEppInput( "domain_create_landrush_fee_refundable.xml", ImmutableMap.of("FEE_VERSION", "0.12")); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -547,7 +547,7 @@ public class DomainApplicationCreateFlowTest clock.advanceOneMilli(); setEppInput( "domain_create_landrush_fee_grace_period.xml", ImmutableMap.of("FEE_VERSION", "0.6")); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -557,7 +557,7 @@ public class DomainApplicationCreateFlowTest clock.advanceOneMilli(); setEppInput( "domain_create_landrush_fee_grace_period.xml", ImmutableMap.of("FEE_VERSION", "0.11")); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -567,7 +567,7 @@ public class DomainApplicationCreateFlowTest clock.advanceOneMilli(); setEppInput( "domain_create_landrush_fee_grace_period.xml", ImmutableMap.of("FEE_VERSION", "0.12")); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -576,7 +576,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); setEppInput("domain_create_landrush_fee_applied.xml", ImmutableMap.of("FEE_VERSION", "0.6")); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -585,7 +585,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); setEppInput("domain_create_landrush_fee_applied.xml", ImmutableMap.of("FEE_VERSION", "0.11")); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -594,7 +594,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); setEppInput("domain_create_landrush_fee_applied.xml", ImmutableMap.of("FEE_VERSION", "0.12")); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -700,7 +700,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_without_marks.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(LandrushApplicationDisallowedDuringSunriseException.class, () -> runFlow()); + assertThrows(LandrushApplicationDisallowedDuringSunriseException.class, this::runFlow); } @Test @@ -715,7 +715,7 @@ public class DomainApplicationCreateFlowTest .setState(State.SUSPENDED) .build()); clock.advanceOneMilli(); - assertThrows(RegistrarMustBeActiveToCreateDomainsException.class, () -> runFlow()); + assertThrows(RegistrarMustBeActiveToCreateDomainsException.class, this::runFlow); } @Test @@ -724,7 +724,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_signed_mark.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(SunriseApplicationDisallowedDuringLandrushException.class, () -> runFlow()); + assertThrows(SunriseApplicationDisallowedDuringLandrushException.class, this::runFlow); } @Test @@ -732,7 +732,7 @@ public class DomainApplicationCreateFlowTest SignedMarkRevocationList.create(clock.nowUtc(), ImmutableMap.of(SMD_ID, clock.nowUtc())).save(); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(SignedMarkRevokedErrorException.class, () -> runFlow()); + assertThrows(SignedMarkRevokedErrorException.class, this::runFlow); } @Test @@ -741,7 +741,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrush_14_nameservers.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(TooManyNameserversException.class, () -> runFlow()); + assertThrows(TooManyNameserversException.class, this::runFlow); } @Test @@ -749,7 +749,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_with_secdns_maxsiglife.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(MaxSigLifeNotSupportedException.class, () -> runFlow()); + assertThrows(MaxSigLifeNotSupportedException.class, this::runFlow); } @Test @@ -757,7 +757,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_signed_mark_with_secdns_9_records.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(TooManyDsRecordsException.class, () -> runFlow()); + assertThrows(TooManyDsRecordsException.class, this::runFlow); } @Test @@ -765,7 +765,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_wrong_extension.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(UnimplementedExtensionException.class, () -> runFlow()); + assertThrows(UnimplementedExtensionException.class, this::runFlow); } @Test @@ -773,7 +773,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_signed_mark_reserved.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(DomainReservedException.class, () -> runFlow()); + assertThrows(DomainReservedException.class, this::runFlow); } @Test @@ -825,7 +825,7 @@ public class DomainApplicationCreateFlowTest persistSunriseApplication(); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(UncontestedSunriseApplicationBlockedInLandrushException.class, () -> runFlow()); + assertThrows(UncontestedSunriseApplicationBlockedInLandrushException.class, this::runFlow); } @Test @@ -912,7 +912,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_lrp.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(InvalidLrpTokenException.class, () -> runFlow()); + assertThrows(InvalidLrpTokenException.class, this::runFlow); } @Test @@ -932,7 +932,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_lrp.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(InvalidLrpTokenException.class, () -> runFlow()); + assertThrows(InvalidLrpTokenException.class, this::runFlow); } @Test @@ -951,7 +951,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_lrp.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(InvalidLrpTokenException.class, () -> runFlow()); + assertThrows(InvalidLrpTokenException.class, this::runFlow); } @Test @@ -1006,7 +1006,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(InvalidLrpTokenException.class, () -> runFlow()); + assertThrows(InvalidLrpTokenException.class, this::runFlow); } @Test @@ -1015,7 +1015,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_months.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(BadPeriodUnitException.class, () -> runFlow()); + assertThrows(BadPeriodUnitException.class, this::runFlow); } @Test @@ -1024,7 +1024,7 @@ public class DomainApplicationCreateFlowTest persistActiveContact("jd1234"); persistActiveContact("sh8013"); LinkedResourcesDoNotExistException thrown = - expectThrows(LinkedResourcesDoNotExistException.class, () -> runFlow()); + expectThrows(LinkedResourcesDoNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(ns2.example.net)"); } @@ -1034,7 +1034,7 @@ public class DomainApplicationCreateFlowTest persistActiveHost("ns2.example.net"); persistActiveContact("jd1234"); LinkedResourcesDoNotExistException thrown = - expectThrows(LinkedResourcesDoNotExistException.class, () -> runFlow()); + expectThrows(LinkedResourcesDoNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(sh8013)"); } @@ -1044,7 +1044,7 @@ public class DomainApplicationCreateFlowTest createTld("foo", TldState.SUNRISE); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(TldDoesNotExistException.class, () -> runFlow()); + assertThrows(TldDoesNotExistException.class, this::runFlow); } @Test @@ -1052,7 +1052,7 @@ public class DomainApplicationCreateFlowTest createTld("tld", TldState.PREDELEGATION); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(BadCommandForRegistryPhaseException.class, () -> runFlow()); + assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow); } @Test @@ -1060,7 +1060,7 @@ public class DomainApplicationCreateFlowTest persistResource( loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistContactsAndHosts(); - assertThrows(NotAuthorizedForTldException.class, () -> runFlow()); + assertThrows(NotAuthorizedForTldException.class, this::runFlow); } @Test @@ -1068,7 +1068,7 @@ public class DomainApplicationCreateFlowTest createTld("tld", TldState.SUNRUSH); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(LaunchPhaseMismatchException.class, () -> runFlow()); + assertThrows(LaunchPhaseMismatchException.class, this::runFlow); } @Test @@ -1076,7 +1076,7 @@ public class DomainApplicationCreateFlowTest createTld("tld", TldState.QUIET_PERIOD); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(BadCommandForRegistryPhaseException.class, () -> runFlow()); + assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow); } @Test @@ -1084,7 +1084,7 @@ public class DomainApplicationCreateFlowTest createTld("tld", TldState.GENERAL_AVAILABILITY); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(BadCommandForRegistryPhaseException.class, () -> runFlow()); + assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow); } @Test @@ -1092,7 +1092,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_signed_mark.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(LaunchPhaseMismatchException.class, () -> runFlow()); + assertThrows(LaunchPhaseMismatchException.class, this::runFlow); } @Test @@ -1149,7 +1149,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_duplicate_contact.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(DuplicateContactForRoleException.class, () -> runFlow()); + assertThrows(DuplicateContactForRoleException.class, this::runFlow); } @Test @@ -1158,7 +1158,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); // We need to test for missing type, but not for invalid - the schema enforces that for us. - assertThrows(MissingContactTypeException.class, () -> runFlow()); + assertThrows(MissingContactTypeException.class, this::runFlow); } @Test @@ -1166,7 +1166,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_no_matching_marks.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(NoMarksFoundMatchingDomainException.class, () -> runFlow()); + assertThrows(NoMarksFoundMatchingDomainException.class, this::runFlow); } @Test @@ -1175,7 +1175,7 @@ public class DomainApplicationCreateFlowTest clock.setTo(DateTime.parse("2013-08-09T10:05:59Z").minusSeconds(1)); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(NoMarksFoundMatchingDomainException.class, () -> runFlow()); + assertThrows(NoMarksFoundMatchingDomainException.class, this::runFlow); } @Test @@ -1184,7 +1184,7 @@ public class DomainApplicationCreateFlowTest clock.setTo(DateTime.parse("2017-07-23T22:00:00.000Z")); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(NoMarksFoundMatchingDomainException.class, () -> runFlow()); + assertThrows(NoMarksFoundMatchingDomainException.class, this::runFlow); } @Test @@ -1192,7 +1192,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_hex_encoding.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(Base64RequiredForEncodedSignedMarksException.class, () -> runFlow()); + assertThrows(Base64RequiredForEncodedSignedMarksException.class, this::runFlow); } @Test @@ -1200,7 +1200,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_bad_encoding.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(SignedMarkEncodingErrorException.class, () -> runFlow()); + assertThrows(SignedMarkEncodingErrorException.class, this::runFlow); } @Test @@ -1208,7 +1208,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_bad_encoded_xml.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(SignedMarkParsingErrorException.class, () -> runFlow()); + assertThrows(SignedMarkParsingErrorException.class, this::runFlow); } @Test @@ -1217,7 +1217,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrush_bad_idn_minna.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(InvalidIdnDomainLabelException.class, () -> runFlow()); + assertThrows(InvalidIdnDomainLabelException.class, this::runFlow); } @Test @@ -1227,7 +1227,7 @@ public class DomainApplicationCreateFlowTest persistClaimsList(ImmutableMap.of("exampleone", CLAIMS_KEY)); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(InvalidTrademarkValidatorException.class, () -> runFlow()); + assertThrows(InvalidTrademarkValidatorException.class, this::runFlow); } @Test @@ -1235,7 +1235,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_signed_mark.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(SignedMarksMustBeEncodedException.class, () -> runFlow()); + assertThrows(SignedMarksMustBeEncodedException.class, this::runFlow); } @Test @@ -1243,7 +1243,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_code_with_mark.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(UnsupportedMarkTypeException.class, () -> runFlow()); + assertThrows(UnsupportedMarkTypeException.class, this::runFlow); } @Test @@ -1251,7 +1251,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_empty_encoded_signed_mark.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(SignedMarkParsingErrorException.class, () -> runFlow()); + assertThrows(SignedMarkParsingErrorException.class, this::runFlow); } @Test @@ -1260,7 +1260,7 @@ public class DomainApplicationCreateFlowTest persistClaimsList(ImmutableMap.of("exampleone", CLAIMS_KEY)); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(NoticeCannotBeUsedWithSignedMarkException.class, () -> runFlow()); + assertThrows(NoticeCannotBeUsedWithSignedMarkException.class, this::runFlow); } @Test @@ -1268,7 +1268,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrise_two_signed_marks.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(TooManySignedMarksException.class, () -> runFlow()); + assertThrows(TooManySignedMarksException.class, this::runFlow); } @Test @@ -1278,7 +1278,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrush.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(MissingClaimsNoticeException.class, () -> runFlow()); + assertThrows(MissingClaimsNoticeException.class, this::runFlow); } @Test @@ -1287,7 +1287,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_claim_notice.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(UnexpectedClaimsNoticeException.class, () -> runFlow()); + assertThrows(UnexpectedClaimsNoticeException.class, this::runFlow); } @Test @@ -1299,7 +1299,7 @@ public class DomainApplicationCreateFlowTest persistResource(Registry.get("tld").asBuilder() .setClaimsPeriodEnd(clock.nowUtc()) .build()); - assertThrows(ClaimsPeriodEndedException.class, () -> runFlow()); + assertThrows(ClaimsPeriodEndedException.class, this::runFlow); } @Test @@ -1310,7 +1310,7 @@ public class DomainApplicationCreateFlowTest persistClaimsList(ImmutableMap.of("example-one", CLAIMS_KEY)); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(ExpiredClaimException.class, () -> runFlow()); + assertThrows(ExpiredClaimException.class, this::runFlow); } @Test @@ -1321,7 +1321,7 @@ public class DomainApplicationCreateFlowTest persistClaimsList(ImmutableMap.of("example-one", CLAIMS_KEY)); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(AcceptedTooLongAgoException.class, () -> runFlow()); + assertThrows(AcceptedTooLongAgoException.class, this::runFlow); } @Test @@ -1332,7 +1332,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrush_malformed_claim_notice1.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(MalformedTcnIdException.class, () -> runFlow()); + assertThrows(MalformedTcnIdException.class, this::runFlow); } @Test @@ -1343,7 +1343,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_sunrush_malformed_claim_notice2.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(MalformedTcnIdException.class, () -> runFlow()); + assertThrows(MalformedTcnIdException.class, this::runFlow); } @Test @@ -1354,7 +1354,7 @@ public class DomainApplicationCreateFlowTest persistClaimsList(ImmutableMap.of("example-one", CLAIMS_KEY)); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(InvalidTcnIdChecksumException.class, () -> runFlow()); + assertThrows(InvalidTcnIdChecksumException.class, this::runFlow); } @Test @@ -1365,7 +1365,7 @@ public class DomainApplicationCreateFlowTest Registry.get("tld").asBuilder().setCreateBillingCost(Money.of(USD, 20)).build()); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(FeesMismatchException.class, () -> runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -1376,7 +1376,7 @@ public class DomainApplicationCreateFlowTest Registry.get("tld").asBuilder().setCreateBillingCost(Money.of(USD, 20)).build()); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(FeesMismatchException.class, () -> runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -1387,7 +1387,7 @@ public class DomainApplicationCreateFlowTest Registry.get("tld").asBuilder().setCreateBillingCost(Money.of(USD, 20)).build()); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(FeesMismatchException.class, () -> runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -1404,7 +1404,7 @@ public class DomainApplicationCreateFlowTest .build()); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(CurrencyUnitMismatchException.class, () -> runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test @@ -1421,7 +1421,7 @@ public class DomainApplicationCreateFlowTest .build()); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(CurrencyUnitMismatchException.class, () -> runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test @@ -1438,7 +1438,7 @@ public class DomainApplicationCreateFlowTest .build()); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(CurrencyUnitMismatchException.class, () -> runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test @@ -1447,7 +1447,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.6")); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test @@ -1456,7 +1456,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.11")); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test @@ -1465,7 +1465,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.12")); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @@ -1494,7 +1494,7 @@ public class DomainApplicationCreateFlowTest .setAllowedRegistrantContactIds(ImmutableSet.of("someone")) .build()); RegistrantNotAllowedException thrown = - expectThrows(RegistrantNotAllowedException.class, () -> runFlow()); + expectThrows(RegistrantNotAllowedException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("jd1234"); } @@ -1505,7 +1505,7 @@ public class DomainApplicationCreateFlowTest .setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns2.example.net")) .build()); NameserversNotAllowedForTldException thrown = - expectThrows(NameserversNotAllowedForTldException.class, () -> runFlow()); + expectThrows(NameserversNotAllowedForTldException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -1532,7 +1532,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); assertThrows( - NameserversNotSpecifiedForTldWithNameserverWhitelistException.class, () -> runFlow()); + NameserversNotSpecifiedForTldWithNameserverWhitelistException.class, this::runFlow); } @Test @@ -1567,7 +1567,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); NameserversNotAllowedForDomainException thrown = - expectThrows(NameserversNotAllowedForDomainException.class, () -> runFlow()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -1585,7 +1585,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); assertThrows( - NameserversNotSpecifiedForNameserverRestrictedDomainException.class, () -> runFlow()); + NameserversNotSpecifiedForNameserverRestrictedDomainException.class, this::runFlow); } @Test @@ -1626,7 +1626,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); NameserversNotAllowedForDomainException thrown = - expectThrows(NameserversNotAllowedForDomainException.class, () -> runFlow()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -1646,7 +1646,7 @@ public class DomainApplicationCreateFlowTest persistContactsAndHosts(); clock.advanceOneMilli(); NameserversNotAllowedForTldException thrown = - expectThrows(NameserversNotAllowedForTldException.class, () -> runFlow()); + expectThrows(NameserversNotAllowedForTldException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -1656,7 +1656,7 @@ public class DomainApplicationCreateFlowTest setEppInput("domain_create_landrush_11_years.xml"); persistContactsAndHosts(); clock.advanceOneMilli(); - assertThrows(ExceedsMaxRegistrationYearsException.class, () -> runFlow()); + assertThrows(ExceedsMaxRegistrationYearsException.class, this::runFlow); } private void doFailingDomainNameTest(String domainName, Class exception) diff --git a/javatests/google/registry/flows/domain/DomainApplicationDeleteFlowTest.java b/javatests/google/registry/flows/domain/DomainApplicationDeleteFlowTest.java index 30fa6061b..a438530ce 100644 --- a/javatests/google/registry/flows/domain/DomainApplicationDeleteFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainApplicationDeleteFlowTest.java @@ -126,7 +126,7 @@ public class DomainApplicationDeleteFlowTest @Test public void testFailure_neverExisted() throws Exception { ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -137,7 +137,7 @@ public class DomainApplicationDeleteFlowTest .setDeletionTime(clock.nowUtc().minusSeconds(1)) .build()); ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -146,7 +146,7 @@ public class DomainApplicationDeleteFlowTest sessionMetadata.setClientId("NewRegistrar"); persistResource( newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build()); - assertThrows(ResourceNotOwnedException.class, () -> runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -164,7 +164,7 @@ public class DomainApplicationDeleteFlowTest persistResource(newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build()); persistResource( loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); - assertThrows(NotAuthorizedForTldException.class, () -> runFlow()); + assertThrows(NotAuthorizedForTldException.class, this::runFlow); } @Test @@ -186,7 +186,7 @@ public class DomainApplicationDeleteFlowTest .setRepoId("1-TLD") .setPhase(LaunchPhase.SUNRISE) .build()); - assertThrows(SunriseApplicationCannotBeDeletedInLandrushException.class, () -> runFlow()); + assertThrows(SunriseApplicationCannotBeDeletedInLandrushException.class, this::runFlow); } @Test @@ -232,14 +232,14 @@ public class DomainApplicationDeleteFlowTest setEppInput("domain_delete_application_landrush.xml", ImmutableMap.of("DOMAIN", "example.tld")); persistResource( newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build()); - assertThrows(LaunchPhaseMismatchException.class, () -> runFlow()); + assertThrows(LaunchPhaseMismatchException.class, this::runFlow); } @Test public void testFailure_wrongExtension() throws Exception { setEppInput("domain_delete_application_wrong_extension.xml"); persistActiveDomainApplication("example.tld"); - assertThrows(UnimplementedExtensionException.class, () -> runFlow()); + assertThrows(UnimplementedExtensionException.class, this::runFlow); } @Test @@ -247,7 +247,7 @@ public class DomainApplicationDeleteFlowTest createTld("tld", TldState.PREDELEGATION); persistResource( newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build()); - assertThrows(BadCommandForRegistryPhaseException.class, () -> runFlow()); + assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow); } @Test @@ -255,7 +255,7 @@ public class DomainApplicationDeleteFlowTest createTld("tld", TldState.QUIET_PERIOD); persistResource( newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build()); - assertThrows(BadCommandForRegistryPhaseException.class, () -> runFlow()); + assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow); } @Test @@ -263,7 +263,7 @@ public class DomainApplicationDeleteFlowTest createTld("tld", TldState.GENERAL_AVAILABILITY); persistResource( newDomainApplication("example.tld").asBuilder().setRepoId("1-TLD").build()); - assertThrows(BadCommandForRegistryPhaseException.class, () -> runFlow()); + assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow); } @Test @@ -300,7 +300,7 @@ public class DomainApplicationDeleteFlowTest public void testFailure_applicationIdForDifferentDomain() throws Exception { persistResource( newDomainApplication("invalid.tld").asBuilder().setRepoId("1-TLD").build()); - assertThrows(ApplicationDomainNameMismatchException.class, () -> runFlow()); + assertThrows(ApplicationDomainNameMismatchException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/domain/DomainApplicationInfoFlowTest.java b/javatests/google/registry/flows/domain/DomainApplicationInfoFlowTest.java index 77d2bb5c5..0d964d3d0 100644 --- a/javatests/google/registry/flows/domain/DomainApplicationInfoFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainApplicationInfoFlowTest.java @@ -264,7 +264,7 @@ public class DomainApplicationInfoFlowTest @Test public void testFailure_neverExisted() throws Exception { ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -277,7 +277,7 @@ public class DomainApplicationInfoFlowTest .setRegistrant(Key.create(persistActiveContact("jd1234"))) .build()); ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -287,7 +287,7 @@ public class DomainApplicationInfoFlowTest AppEngineRule.makeRegistrar1().asBuilder().setClientId("ClientZ").build()); sessionMetadata.setClientId("ClientZ"); persistTestEntities(HostsState.NO_HOSTS_EXIST, MarksState.NO_MARKS_EXIST); - assertThrows(ResourceNotOwnedException.class, () -> runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -298,14 +298,14 @@ public class DomainApplicationInfoFlowTest .setRegistrant(Key.create(persistActiveContact("jd1234"))) .setPhase(LaunchPhase.SUNRUSH) .build()); - assertThrows(ApplicationDomainNameMismatchException.class, () -> runFlow()); + assertThrows(ApplicationDomainNameMismatchException.class, this::runFlow); } @Test public void testFailure_noApplicationId() throws Exception { setEppInput("domain_info_sunrise_no_application_id.xml"); persistTestEntities(HostsState.NO_HOSTS_EXIST, MarksState.NO_MARKS_EXIST); - assertThrows(MissingApplicationIdException.class, () -> runFlow()); + assertThrows(MissingApplicationIdException.class, this::runFlow); } @Test @@ -313,7 +313,7 @@ public class DomainApplicationInfoFlowTest persistTestEntities(HostsState.NO_HOSTS_EXIST, MarksState.NO_MARKS_EXIST); application = persistResource( application.asBuilder().setPhase(LaunchPhase.SUNRISE).build()); - assertThrows(ApplicationLaunchPhaseMismatchException.class, () -> runFlow()); + assertThrows(ApplicationLaunchPhaseMismatchException.class, this::runFlow); } /** Test that we load contacts and hosts as a batch rather than individually. */ diff --git a/javatests/google/registry/flows/domain/DomainApplicationUpdateFlowTest.java b/javatests/google/registry/flows/domain/DomainApplicationUpdateFlowTest.java index 58dfec515..3244de097 100644 --- a/javatests/google/registry/flows/domain/DomainApplicationUpdateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainApplicationUpdateFlowTest.java @@ -372,7 +372,7 @@ public class DomainApplicationUpdateFlowTest setEppInput("domain_update_sunrise_dsdata_add.xml"); persistResource(newApplicationBuilder().setDsData(builder.build()).build()); - assertThrows(TooManyDsRecordsException.class, () -> runFlow()); + assertThrows(TooManyDsRecordsException.class, this::runFlow); } private void modifyApplicationToHave13Nameservers() throws Exception { @@ -395,27 +395,27 @@ public class DomainApplicationUpdateFlowTest // Modify application to have 13 nameservers. We will then remove one and add one in the test. modifyApplicationToHave13Nameservers(); setEppInput("domain_update_sunrise_add_nameserver.xml"); - assertThrows(TooManyNameserversException.class, () -> runFlow()); + assertThrows(TooManyNameserversException.class, this::runFlow); } @Test public void testFailure_wrongExtension() throws Exception { setEppInput("domain_update_sunrise_wrong_extension.xml"); - assertThrows(UnimplementedExtensionException.class, () -> runFlow()); + assertThrows(UnimplementedExtensionException.class, this::runFlow); } @Test public void testFailure_applicationDomainNameMismatch() throws Exception { persistReferencedEntities(); persistResource(newApplicationBuilder().setFullyQualifiedDomainName("something.tld").build()); - assertThrows(ApplicationDomainNameMismatchException.class, () -> runFlow()); + assertThrows(ApplicationDomainNameMismatchException.class, this::runFlow); } @Test public void testFailure_neverExisted() throws Exception { persistReferencedEntities(); ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -424,7 +424,7 @@ public class DomainApplicationUpdateFlowTest persistReferencedEntities(); persistResource(newApplicationBuilder().setDeletionTime(START_OF_TIME).build()); ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -434,7 +434,7 @@ public class DomainApplicationUpdateFlowTest persistReferencedEntities(); persistResource(newApplicationBuilder().setStatusValues( ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED)).build()); - assertThrows(ResourceHasClientUpdateProhibitedException.class, () -> runFlow()); + assertThrows(ResourceHasClientUpdateProhibitedException.class, this::runFlow); } @Test @@ -443,14 +443,14 @@ public class DomainApplicationUpdateFlowTest persistResource(newApplicationBuilder().setStatusValues( ImmutableSet.of(StatusValue.SERVER_UPDATE_PROHIBITED)).build()); ResourceStatusProhibitsOperationException thrown = - expectThrows(ResourceStatusProhibitsOperationException.class, () -> runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("serverUpdateProhibited"); } private void doIllegalApplicationStatusTest(ApplicationStatus status) throws Exception { persistReferencedEntities(); persistResource(newApplicationBuilder().setApplicationStatus(status).build()); - assertThrows(ApplicationStatusProhibitsUpdateException.class, () -> runFlow()); + assertThrows(ApplicationStatusProhibitsUpdateException.class, this::runFlow); } @Test @@ -475,7 +475,7 @@ public class DomainApplicationUpdateFlowTest persistActiveContact("mak21"); persistNewApplication(); LinkedResourcesDoNotExistException thrown = - expectThrows(LinkedResourcesDoNotExistException.class, () -> runFlow()); + expectThrows(LinkedResourcesDoNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(ns2.example.tld)"); } @@ -486,7 +486,7 @@ public class DomainApplicationUpdateFlowTest persistActiveContact("mak21"); persistNewApplication(); LinkedResourcesDoNotExistException thrown = - expectThrows(LinkedResourcesDoNotExistException.class, () -> runFlow()); + expectThrows(LinkedResourcesDoNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(sh8013)"); } @@ -500,7 +500,7 @@ public class DomainApplicationUpdateFlowTest persistResource(reloadDomainApplication().asBuilder().setContacts(ImmutableSet.of( DesignatedContact.create(Type.TECH, Key.create( loadByForeignKey(ContactResource.class, "foo", clock.nowUtc()))))).build()); - assertThrows(DuplicateContactForRoleException.class, () -> runFlow()); + assertThrows(DuplicateContactForRoleException.class, this::runFlow); } @Test @@ -508,7 +508,7 @@ public class DomainApplicationUpdateFlowTest setEppInput("domain_update_sunrise_prohibited_status.xml"); persistReferencedEntities(); persistNewApplication(); - assertThrows(StatusNotClientSettableException.class, () -> runFlow()); + assertThrows(StatusNotClientSettableException.class, this::runFlow); } @@ -529,7 +529,7 @@ public class DomainApplicationUpdateFlowTest setEppInput("domain_update_sunrise_duplicate_contact.xml"); persistReferencedEntities(); persistNewApplication(); - assertThrows(DuplicateContactForRoleException.class, () -> runFlow()); + assertThrows(DuplicateContactForRoleException.class, this::runFlow); } @Test @@ -538,7 +538,7 @@ public class DomainApplicationUpdateFlowTest persistReferencedEntities(); persistNewApplication(); // We need to test for missing type, but not for invalid - the schema enforces that for us. - assertThrows(MissingContactTypeException.class, () -> runFlow()); + assertThrows(MissingContactTypeException.class, this::runFlow); } @Test @@ -546,7 +546,7 @@ public class DomainApplicationUpdateFlowTest sessionMetadata.setClientId("NewRegistrar"); persistReferencedEntities(); persistApplication(); - assertThrows(ResourceNotOwnedException.class, () -> runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -565,7 +565,7 @@ public class DomainApplicationUpdateFlowTest loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistReferencedEntities(); persistApplication(); - assertThrows(NotAuthorizedForTldException.class, () -> runFlow()); + assertThrows(NotAuthorizedForTldException.class, this::runFlow); } @Test @@ -587,7 +587,7 @@ public class DomainApplicationUpdateFlowTest .setNameservers(ImmutableSet.of(Key.create( loadByForeignKey(HostResource.class, "ns1.example.tld", clock.nowUtc())))) .build()); - assertThrows(AddRemoveSameValueException.class, () -> runFlow()); + assertThrows(AddRemoveSameValueException.class, this::runFlow); } @Test @@ -600,7 +600,7 @@ public class DomainApplicationUpdateFlowTest Key.create( loadByForeignKey(ContactResource.class, "sh8013", clock.nowUtc()))))) .build()); - assertThrows(AddRemoveSameValueException.class, () -> runFlow()); + assertThrows(AddRemoveSameValueException.class, this::runFlow); } @Test @@ -612,7 +612,7 @@ public class DomainApplicationUpdateFlowTest DesignatedContact.create(Type.ADMIN, Key.create(sh8013Contact)), DesignatedContact.create(Type.TECH, Key.create(sh8013Contact)))) .build()); - assertThrows(MissingAdminContactException.class, () -> runFlow()); + assertThrows(MissingAdminContactException.class, this::runFlow); } @Test @@ -624,7 +624,7 @@ public class DomainApplicationUpdateFlowTest DesignatedContact.create(Type.ADMIN, Key.create(sh8013Contact)), DesignatedContact.create(Type.TECH, Key.create(sh8013Contact)))) .build()); - assertThrows(MissingTechnicalContactException.class, () -> runFlow()); + assertThrows(MissingTechnicalContactException.class, this::runFlow); } @Test @@ -636,7 +636,7 @@ public class DomainApplicationUpdateFlowTest .setAllowedRegistrantContactIds(ImmutableSet.of("contact1234")) .build()); clock.advanceOneMilli(); - assertThrows(RegistrantNotAllowedException.class, () -> runFlow()); + assertThrows(RegistrantNotAllowedException.class, this::runFlow); } @Test @@ -648,7 +648,7 @@ public class DomainApplicationUpdateFlowTest .setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.foo")) .build()); clock.advanceOneMilli(); - assertThrows(NameserversNotAllowedForTldException.class, () -> runFlow()); + assertThrows(NameserversNotAllowedForTldException.class, this::runFlow); } @Test @@ -676,7 +676,7 @@ public class DomainApplicationUpdateFlowTest .build()); clock.advanceOneMilli(); assertThrows( - NameserversNotSpecifiedForTldWithNameserverWhitelistException.class, () -> runFlow()); + NameserversNotSpecifiedForTldWithNameserverWhitelistException.class, this::runFlow); } @Test @@ -730,7 +730,7 @@ public class DomainApplicationUpdateFlowTest .build()); clock.advanceOneMilli(); NameserversNotAllowedForDomainException thrown = - expectThrows(NameserversNotAllowedForDomainException.class, () -> runFlow()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns2.example.tld"); } @@ -748,7 +748,7 @@ public class DomainApplicationUpdateFlowTest .build()); clock.advanceOneMilli(); assertThrows( - NameserversNotSpecifiedForNameserverRestrictedDomainException.class, () -> runFlow()); + NameserversNotSpecifiedForNameserverRestrictedDomainException.class, this::runFlow); } @Test @@ -809,7 +809,7 @@ public class DomainApplicationUpdateFlowTest .build()); clock.advanceOneMilli(); NameserversNotAllowedForDomainException thrown = - expectThrows(NameserversNotAllowedForDomainException.class, () -> runFlow()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns2.example.tld"); } @@ -829,7 +829,7 @@ public class DomainApplicationUpdateFlowTest .build()); clock.advanceOneMilli(); NameserversNotAllowedForTldException thrown = - expectThrows(NameserversNotAllowedForTldException.class, () -> runFlow()); + expectThrows(NameserversNotAllowedForTldException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns2.example.tld"); } @@ -842,7 +842,7 @@ public class DomainApplicationUpdateFlowTest "domain_update_sunrise_fee.xml", ImmutableMap.of("DOMAIN", "non-free-update.tld", "AMOUNT", "12.00")); clock.advanceOneMilli(); - assertThrows(FeesMismatchException.class, () -> runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/domain/DomainCheckFlowTest.java b/javatests/google/registry/flows/domain/DomainCheckFlowTest.java index 48cd13e98..413137597 100644 --- a/javatests/google/registry/flows/domain/DomainCheckFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCheckFlowTest.java @@ -274,20 +274,20 @@ public class DomainCheckFlowTest @Test public void testFailure_tooManyIds() throws Exception { setEppInput("domain_check_51.xml"); - assertThrows(TooManyResourceChecksException.class, () -> runFlow()); + assertThrows(TooManyResourceChecksException.class, this::runFlow); } @Test public void testFailure_wrongTld() throws Exception { setEppInput("domain_check.xml"); - assertThrows(TldDoesNotExistException.class, () -> runFlow()); + assertThrows(TldDoesNotExistException.class, this::runFlow); } @Test public void testFailure_notAuthorizedForTld() throws Exception { persistResource( loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); - assertThrows(NotAuthorizedForTldException.class, () -> runFlow()); + assertThrows(NotAuthorizedForTldException.class, this::runFlow); } @Test @@ -386,7 +386,7 @@ public class DomainCheckFlowTest @Test public void testFailure_predelegation() throws Exception { createTld("tld", TldState.PREDELEGATION); - assertThrows(BadCommandForRegistryPhaseException.class, () -> runFlow()); + assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow); } @Test @@ -673,152 +673,152 @@ public class DomainCheckFlowTest @Test public void testFeeExtension_wrongCurrency_v06() throws Exception { setEppInput("domain_check_fee_euro_v06.xml"); - assertThrows(CurrencyUnitMismatchException.class, () -> runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test public void testFeeExtension_wrongCurrency_v11() throws Exception { setEppInput("domain_check_fee_euro_v11.xml"); - assertThrows(CurrencyUnitMismatchException.class, () -> runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test public void testFeeExtension_wrongCurrency_v12() throws Exception { setEppInput("domain_check_fee_euro_v12.xml"); - assertThrows(CurrencyUnitMismatchException.class, () -> runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test public void testFeeExtension_periodNotInYears_v06() throws Exception { setEppInput("domain_check_fee_bad_period_v06.xml"); - assertThrows(BadPeriodUnitException.class, () -> runFlow()); + assertThrows(BadPeriodUnitException.class, this::runFlow); } @Test public void testFeeExtension_periodNotInYears_v11() throws Exception { setEppInput("domain_check_fee_bad_period_v11.xml"); - assertThrows(BadPeriodUnitException.class, () -> runFlow()); + assertThrows(BadPeriodUnitException.class, this::runFlow); } @Test public void testFeeExtension_periodNotInYears_v12() throws Exception { setEppInput("domain_check_fee_bad_period_v12.xml"); - assertThrows(BadPeriodUnitException.class, () -> runFlow()); + assertThrows(BadPeriodUnitException.class, this::runFlow); } @Test public void testFeeExtension_commandWithPhase_v06() throws Exception { setEppInput("domain_check_fee_command_phase_v06.xml"); - assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow()); + assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow); } @Test public void testFeeExtension_commandWithPhase_v11() throws Exception { setEppInput("domain_check_fee_command_phase_v11.xml"); - assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow()); + assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow); } @Test public void testFeeExtension_commandWithPhase_v12() throws Exception { setEppInput("domain_check_fee_command_phase_v12.xml"); - assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow()); + assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow); } @Test public void testFeeExtension_commandSubphase_v06() throws Exception { setEppInput("domain_check_fee_command_subphase_v06.xml"); - assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow()); + assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow); } @Test public void testFeeExtension_commandSubphase_v11() throws Exception { setEppInput("domain_check_fee_command_subphase_v11.xml"); - assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow()); + assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow); } @Test public void testFeeExtension_commandSubphase_v12() throws Exception { setEppInput("domain_check_fee_command_subphase_v12.xml"); - assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow()); + assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow); } // This test is only relevant for v06, since domain names are not specified in v11 or v12. @Test public void testFeeExtension_feeCheckNotInAvailabilityCheck() throws Exception { setEppInput("domain_check_fee_not_in_avail.xml"); - assertThrows(OnlyCheckedNamesCanBeFeeCheckedException.class, () -> runFlow()); + assertThrows(OnlyCheckedNamesCanBeFeeCheckedException.class, this::runFlow); } @Test public void testFeeExtension_multiyearRestore_v06() throws Exception { setEppInput("domain_check_fee_multiyear_restore_v06.xml"); - assertThrows(RestoresAreAlwaysForOneYearException.class, () -> runFlow()); + assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow); } @Test public void testFeeExtension_multiyearRestore_v11() throws Exception { setEppInput("domain_check_fee_multiyear_restore_v11.xml"); - assertThrows(RestoresAreAlwaysForOneYearException.class, () -> runFlow()); + assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow); } @Test public void testFeeExtension_multiyearRestore_v12() throws Exception { setEppInput("domain_check_fee_multiyear_restore_v12.xml"); - assertThrows(RestoresAreAlwaysForOneYearException.class, () -> runFlow()); + assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow); } @Test public void testFeeExtension_multiyearTransfer_v06() throws Exception { setEppInput("domain_check_fee_multiyear_transfer_v06.xml"); - assertThrows(TransfersAreAlwaysForOneYearException.class, () -> runFlow()); + assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow); } @Test public void testFeeExtension_multiyearTransfer_v11() throws Exception { setEppInput("domain_check_fee_multiyear_transfer_v11.xml"); - assertThrows(TransfersAreAlwaysForOneYearException.class, () -> runFlow()); + assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow); } @Test public void testFeeExtension_multiyearTransfer_v12() throws Exception { setEppInput("domain_check_fee_multiyear_transfer_v12.xml"); - assertThrows(TransfersAreAlwaysForOneYearException.class, () -> runFlow()); + assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow); } @Test public void testFeeExtension_unknownCommand_v06() throws Exception { setEppInput("domain_check_fee_unknown_command_v06.xml"); - assertThrows(UnknownFeeCommandException.class, () -> runFlow()); + assertThrows(UnknownFeeCommandException.class, this::runFlow); } @Test public void testFeeExtension_unknownCommand_v11() throws Exception { setEppInput("domain_check_fee_unknown_command_v11.xml"); - assertThrows(UnknownFeeCommandException.class, () -> runFlow()); + assertThrows(UnknownFeeCommandException.class, this::runFlow); } @Test public void testFeeExtension_unknownCommand_v12() throws Exception { setEppInput("domain_check_fee_unknown_command_v12.xml"); - assertThrows(UnknownFeeCommandException.class, () -> runFlow()); + assertThrows(UnknownFeeCommandException.class, this::runFlow); } @Test public void testFeeExtension_invalidCommand_v06() throws Exception { setEppInput("domain_check_fee_invalid_command_v06.xml"); - assertThrows(UnknownFeeCommandException.class, () -> runFlow()); + assertThrows(UnknownFeeCommandException.class, this::runFlow); } @Test public void testFeeExtension_invalidCommand_v11() throws Exception { setEppInput("domain_check_fee_invalid_command_v11.xml"); - assertThrows(UnknownFeeCommandException.class, () -> runFlow()); + assertThrows(UnknownFeeCommandException.class, this::runFlow); } @Test public void testFeeExtension_invalidCommand_v12() throws Exception { setEppInput("domain_check_fee_invalid_command_v12.xml"); - assertThrows(UnknownFeeCommandException.class, () -> runFlow()); + assertThrows(UnknownFeeCommandException.class, this::runFlow); } private void runEapFeeCheckTest(String inputFile, String outputFile) throws Exception { diff --git a/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java b/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java index 00db01b38..b0bf55a4f 100644 --- a/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainClaimsCheckFlowTest.java @@ -102,20 +102,20 @@ public class DomainClaimsCheckFlowTest @Test public void testFailure_TooManyIds() throws Exception { setEppInput("domain_check_claims_51.xml"); - assertThrows(TooManyResourceChecksException.class, () -> runFlow()); + assertThrows(TooManyResourceChecksException.class, this::runFlow); } @Test public void testFailure_tldDoesntExist() throws Exception { setEppInput("domain_check_claims_bad_tld.xml"); - assertThrows(TldDoesNotExistException.class, () -> runFlow()); + assertThrows(TldDoesNotExistException.class, this::runFlow); } @Test public void testFailure_notAuthorizedForTld() throws Exception { persistResource( loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); - assertThrows(NotAuthorizedForTldException.class, () -> runFlow()); + assertThrows(NotAuthorizedForTldException.class, this::runFlow); } @Test @@ -136,7 +136,7 @@ public class DomainClaimsCheckFlowTest createTld("tld", TldState.PREDELEGATION); persistResource(Registry.get("tld").asBuilder().build()); setEppInput("domain_check_claims.xml"); - assertThrows(BadCommandForRegistryPhaseException.class, () -> runFlow()); + assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow); } @Test @@ -144,7 +144,7 @@ public class DomainClaimsCheckFlowTest createTld("tld", TldState.SUNRISE); persistResource(Registry.get("tld").asBuilder().build()); setEppInput("domain_check_claims.xml"); - assertThrows(DomainClaimsCheckNotAllowedInSunrise.class, () -> runFlow()); + assertThrows(DomainClaimsCheckNotAllowedInSunrise.class, this::runFlow); } @Test @@ -154,7 +154,7 @@ public class DomainClaimsCheckFlowTest persistResource( Registry.get("tld2").asBuilder().setClaimsPeriodEnd(clock.nowUtc().minusMillis(1)).build()); setEppInput("domain_check_claims_multiple_tlds.xml"); - assertThrows(ClaimsPeriodEndedException.class, () -> runFlow()); + assertThrows(ClaimsPeriodEndedException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java index 139ccbc43..22a6d92f7 100644 --- a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java @@ -386,7 +386,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(DomainNameExistsAsTldException.class, this::runFlow); } @Test @@ -394,7 +394,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadDomainNameCharacterException.class, this::runFlow); } @Test @@ -534,63 +534,63 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_refundableFee_v11() throws Exception { setEppInput("domain_create_fee_refundable.xml", ImmutableMap.of("FEE_VERSION", "0.11")); persistContactsAndHosts(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_refundableFee_v12() throws Exception { setEppInput("domain_create_fee_refundable.xml", ImmutableMap.of("FEE_VERSION", "0.12")); persistContactsAndHosts(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_gracePeriodFee_v06() throws Exception { setEppInput("domain_create_fee_grace_period.xml", ImmutableMap.of("FEE_VERSION", "0.6")); persistContactsAndHosts(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_gracePeriodFee_v11() throws Exception { setEppInput("domain_create_fee_grace_period.xml", ImmutableMap.of("FEE_VERSION", "0.11")); persistContactsAndHosts(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_gracePeriodFee_v12() throws Exception { setEppInput("domain_create_fee_grace_period.xml", ImmutableMap.of("FEE_VERSION", "0.12")); persistContactsAndHosts(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_appliedFee_v06() throws Exception { setEppInput("domain_create_fee_applied.xml", ImmutableMap.of("FEE_VERSION", "0.6")); persistContactsAndHosts(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_appliedFee_v11() throws Exception { setEppInput("domain_create_fee_applied.xml", ImmutableMap.of("FEE_VERSION", "0.11")); persistContactsAndHosts(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_appliedFee_v12() throws Exception { setEppInput("domain_create_fee_applied.xml", ImmutableMap.of("FEE_VERSION", "0.12")); persistContactsAndHosts(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -610,7 +610,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(OnlyToolCanPassMetadataException.class, this::runFlow); } @Test @@ -637,7 +637,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + InvalidLrpTokenException thrown = expectThrows(InvalidLrpTokenException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("Invalid limited registration period token"); } @@ -737,7 +737,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadPeriodUnitException.class, this::runFlow); } @Test @@ -769,7 +769,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(MissingClaimsNoticeException.class, this::runFlow); } @Test @@ -777,7 +777,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(UnexpectedClaimsNoticeException.class, this::runFlow); } @Test @@ -788,35 +788,35 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ClaimsPeriodEndedException.class, this::runFlow); } @Test public void testFailure_tooManyNameservers() throws Exception { setEppInput("domain_create_14_nameservers.xml"); persistContactsAndHosts(); - assertThrows(TooManyNameserversException.class, () -> runFlow()); + assertThrows(TooManyNameserversException.class, this::runFlow); } @Test public void testFailure_secDnsMaxSigLife() throws Exception { setEppInput("domain_create_dsdata.xml"); persistContactsAndHosts(); - assertThrows(MaxSigLifeNotSupportedException.class, () -> runFlow()); + assertThrows(MaxSigLifeNotSupportedException.class, this::runFlow); } @Test public void testFailure_secDnsTooManyDsRecords() throws Exception { setEppInput("domain_create_dsdata_9_records.xml"); persistContactsAndHosts(); - assertThrows(TooManyDsRecordsException.class, () -> runFlow()); + assertThrows(TooManyDsRecordsException.class, this::runFlow); } @Test public void testFailure_wrongExtension() throws Exception { setEppInput("domain_create_wrong_extension.xml"); persistContactsAndHosts(); - assertThrows(UnimplementedExtensionException.class, () -> runFlow()); + assertThrows(UnimplementedExtensionException.class, this::runFlow); } @Test @@ -825,7 +825,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -834,7 +834,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -843,7 +843,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -858,7 +858,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test @@ -873,7 +873,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test @@ -888,7 +888,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test @@ -912,14 +912,14 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(DomainReservedException.class, this::runFlow); } @Test public void testFailure_anchorTenantViaAuthCode_wrongAuthCode() throws Exception { setEppInput("domain_create_anchor_wrong_authcode.xml"); persistContactsAndHosts(); - assertThrows(DomainReservedException.class, () -> runFlow()); + assertThrows(DomainReservedException.class, this::runFlow); } @Test @@ -1017,7 +1017,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(LinkedResourcesDoNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(ns2.example.net)"); } @@ -1032,7 +1032,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + LinkedResourceInPendingDeleteProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns2.example.net"); } @@ -1041,7 +1041,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(DomainHasOpenApplicationsException.class, this::runFlow); } @Test @@ -1067,7 +1067,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(LinkedResourcesDoNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(sh8013)"); } @@ -1082,7 +1082,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + LinkedResourceInPendingDeleteProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("jd1234"); } @@ -1090,42 +1090,42 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(TldDoesNotExistException.class, this::runFlow); } @Test public void testFailure_predelegation() throws Exception { createTld("tld", TldState.PREDELEGATION); persistContactsAndHosts(); - assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, () -> runFlow()); + assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, this::runFlow); } @Test public void testFailure_sunrise() throws Exception { createTld("tld", TldState.SUNRISE); persistContactsAndHosts(); - assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, () -> runFlow()); + assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, this::runFlow); } @Test public void testFailure_sunrush() throws Exception { createTld("tld", TldState.SUNRUSH); persistContactsAndHosts(); - assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, () -> runFlow()); + assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, this::runFlow); } @Test public void testFailure_landrush() throws Exception { createTld("tld", TldState.LANDRUSH); persistContactsAndHosts(); - assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, () -> runFlow()); + assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, this::runFlow); } @Test public void testFailure_quietPeriod() throws Exception { createTld("tld", TldState.QUIET_PERIOD); persistContactsAndHosts(); - assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, () -> runFlow()); + assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, this::runFlow); } @Test @@ -1198,7 +1198,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(DuplicateContactForRoleException.class, this::runFlow); } @Test @@ -1206,35 +1206,35 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(MissingContactTypeException.class, this::runFlow); } @Test public void testFailure_missingRegistrant() throws Exception { setEppInput("domain_create_missing_registrant.xml"); persistContactsAndHosts(); - assertThrows(MissingRegistrantException.class, () -> runFlow()); + assertThrows(MissingRegistrantException.class, this::runFlow); } @Test public void testFailure_missingAdmin() throws Exception { setEppInput("domain_create_missing_admin.xml"); persistContactsAndHosts(); - assertThrows(MissingAdminContactException.class, () -> runFlow()); + assertThrows(MissingAdminContactException.class, this::runFlow); } @Test public void testFailure_missingTech() throws Exception { setEppInput("domain_create_missing_tech.xml"); persistContactsAndHosts(); - assertThrows(MissingTechnicalContactException.class, () -> runFlow()); + assertThrows(MissingTechnicalContactException.class, this::runFlow); } @Test public void testFailure_missingNonRegistrantContacts() throws Exception { setEppInput("domain_create_missing_non_registrant_contacts.xml"); persistContactsAndHosts(); - assertThrows(MissingAdminContactException.class, () -> runFlow()); + assertThrows(MissingAdminContactException.class, this::runFlow); } @Test @@ -1242,7 +1242,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(InvalidIdnDomainLabelException.class, this::runFlow); } @Test @@ -1250,14 +1250,14 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(InvalidTrademarkValidatorException.class, this::runFlow); } @Test public void testFailure_codeMark() throws Exception { setEppInput("domain_create_code_with_mark.xml"); persistContactsAndHosts(); - assertThrows(UnsupportedMarkTypeException.class, () -> runFlow()); + assertThrows(UnsupportedMarkTypeException.class, this::runFlow); } @Test @@ -1265,7 +1265,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, this::runFlow); } @Test @@ -1273,7 +1273,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ExpiredClaimException.class, this::runFlow); } @Test @@ -1281,7 +1281,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(AcceptedTooLongAgoException.class, this::runFlow); } @Test @@ -1289,7 +1289,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(MalformedTcnIdException.class, this::runFlow); } @Test @@ -1297,7 +1297,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(MalformedTcnIdException.class, this::runFlow); } @Test @@ -1305,7 +1305,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(InvalidTcnIdChecksumException.class, this::runFlow); } @Test @@ -1318,7 +1318,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(PremiumNameBlockedException.class, this::runFlow); } @Test @@ -1326,7 +1326,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeesRequiredForPremiumNameException.class, this::runFlow); } @Test @@ -1337,7 +1337,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(UndeclaredServiceExtensionException.class, this::runFlow); } @Test @@ -1348,7 +1348,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(UndeclaredServiceExtensionException.class, this::runFlow); } @Test @@ -1359,28 +1359,28 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(UndeclaredServiceExtensionException.class, this::runFlow); } @Test public void testFailure_feeGivenInWrongScale_v06() throws Exception { setEppInput("domain_create_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.6")); persistContactsAndHosts(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test public void testFailure_feeGivenInWrongScale_v11() throws Exception { setEppInput("domain_create_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.11")); persistContactsAndHosts(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test public void testFailure_feeGivenInWrongScale_v12() throws Exception { setEppInput("domain_create_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.12")); persistContactsAndHosts(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test @@ -1393,7 +1393,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(RegistrarMustBeActiveToCreateDomainsException.class, this::runFlow); } private void doFailingDomainNameTest( @@ -1476,7 +1476,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, this::runFlow); } @Test @@ -1527,7 +1527,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, this::runFlow); } @Test @@ -1539,7 +1539,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(NotAuthorizedForTldException.class, this::runFlow); } @Test @@ -1590,7 +1590,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(NoGeneralRegistrationsInCurrentPhaseException.class, this::runFlow); } @Test @@ -1644,7 +1644,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(RegistrantNotAllowedException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("jd1234"); } @@ -1655,7 +1655,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(NameserversNotAllowedForTldException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -1667,7 +1667,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + NameserversNotSpecifiedForTldWithNameserverWhitelistException.class, this::runFlow); } @Test @@ -1709,7 +1709,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + NameserversNotSpecifiedForNameserverRestrictedDomainException.class, this::runFlow); } @Test @@ -1723,7 +1723,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -1739,7 +1739,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(DomainNotAllowedForTldWithCreateRestrictionException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("example.tld"); } @@ -1789,7 +1789,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(NameserversNotAllowedForTldException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -1808,7 +1808,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns1.example.net"); } @@ -1829,7 +1829,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(DomainNotAllowedForTldWithCreateRestrictionException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("example.tld"); } @@ -1958,7 +1958,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ExceedsMaxRegistrationYearsException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/domain/DomainDeleteFlowTest.java b/javatests/google/registry/flows/domain/DomainDeleteFlowTest.java index c248c8448..b629eaf4a 100644 --- a/javatests/google/registry/flows/domain/DomainDeleteFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainDeleteFlowTest.java @@ -638,7 +638,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow); } @Test @@ -653,7 +653,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -661,7 +661,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -675,14 +675,14 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(DomainToDeleteHasHostsException.class, this::runFlow); } @Test public void testFailure_unauthorizedClient() throws Exception { sessionMetadata.setClientId("NewRegistrar"); persistActiveDomain(getUniqueIdFromCommand()); - assertThrows(ResourceNotOwnedException.class, () -> runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -699,7 +699,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(NotAuthorizedForTldException.class, this::runFlow); } @Test @@ -718,7 +718,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("clientDeleteProhibited"); } @@ -728,7 +728,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("serverDeleteProhibited"); } @@ -738,7 +738,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("pendingDelete"); } @@ -762,7 +762,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(OnlyToolCanPassMetadataException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/domain/DomainInfoFlowTest.java b/javatests/google/registry/flows/domain/DomainInfoFlowTest.java index df9f4d16a..11b49c870 100644 --- a/javatests/google/registry/flows/domain/DomainInfoFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainInfoFlowTest.java @@ -376,7 +376,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -386,7 +386,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -399,7 +399,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadAuthInfoForResourceException.class, this::runFlow); } @Test @@ -410,7 +410,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadAuthInfoForResourceException.class, this::runFlow); } @Test @@ -425,7 +425,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadAuthInfoForResourceException.class, this::runFlow); } @Test @@ -439,7 +439,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadAuthInfoForResourceException.class, this::runFlow); } @Test @@ -454,7 +454,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadAuthInfoForResourceException.class, this::runFlow); } @Test @@ -468,7 +468,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadAuthInfoForResourceException.class, this::runFlow); } @Test @@ -479,7 +479,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadAuthInfoForResourceException.class, this::runFlow); } @Test @@ -489,7 +489,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadAuthInfoForResourceException.class, this::runFlow); } /** @@ -568,7 +568,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } /** Test requesting a period that isn't in years. */ @@ -576,7 +576,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadPeriodUnitException.class, this::runFlow); } /** Test a command that specifies a phase. */ @@ -584,7 +584,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow); } /** Test a command that specifies a subphase. */ @@ -592,7 +592,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow); } /** Test a restore for more than one year. */ @@ -600,7 +600,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow); } /** Test a transfer for more than one year. */ @@ -608,7 +608,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow); } /** Test that we load contacts and hosts as a batch rather than individually. */ diff --git a/javatests/google/registry/flows/domain/DomainRenewFlowTest.java b/javatests/google/registry/flows/domain/DomainRenewFlowTest.java index f775984a7..f2c879d88 100644 --- a/javatests/google/registry/flows/domain/DomainRenewFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainRenewFlowTest.java @@ -293,63 +293,63 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_refundableFee_v11() throws Exception { setEppInput("domain_renew_fee_refundable.xml", FEE_11_MAP); persistDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_refundableFee_v12() throws Exception { setEppInput("domain_renew_fee_refundable.xml", FEE_12_MAP); persistDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_gracePeriodFee_v06() throws Exception { setEppInput("domain_renew_fee_grace_period.xml", FEE_06_MAP); persistDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_gracePeriodFee_v11() throws Exception { setEppInput("domain_renew_fee_grace_period.xml", FEE_11_MAP); persistDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_gracePeriodFee_v12() throws Exception { setEppInput("domain_renew_fee_grace_period.xml", FEE_12_MAP); persistDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_appliedFee_v06() throws Exception { setEppInput("domain_renew_fee_applied.xml", FEE_06_MAP); persistDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_appliedFee_v11() throws Exception { setEppInput("domain_renew_fee_applied.xml", FEE_11_MAP); persistDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_appliedFee_v12() throws Exception { setEppInput("domain_renew_fee_applied.xml", FEE_12_MAP); persistDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -404,7 +404,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -412,7 +412,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -420,7 +420,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("clientRenewProhibited"); } @@ -428,7 +428,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("serverRenewProhibited"); } @@ -440,7 +440,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("pendingDelete"); } @@ -453,7 +453,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -465,7 +465,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -477,7 +477,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -494,7 +494,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test @@ -511,7 +511,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test @@ -528,28 +528,28 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test public void testFailure_feeGivenInWrongScale_v06() throws Exception { setEppInput("domain_renew_fee_bad_scale.xml", FEE_06_MAP); persistDomain(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test public void testFailure_feeGivenInWrongScale_v11() throws Exception { setEppInput("domain_renew_fee_bad_scale.xml", FEE_11_MAP); persistDomain(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test public void testFailure_feeGivenInWrongScale_v12() throws Exception { setEppInput("domain_renew_fee_bad_scale.xml", FEE_12_MAP); persistDomain(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test @@ -560,7 +560,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("pendingTransfer"); } @@ -568,14 +568,14 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(BadPeriodUnitException.class, this::runFlow); } @Test public void testFailure_max10Years() throws Exception { setEppInput("domain_renew_11_years.xml"); persistDomain(); - assertThrows(ExceedsMaxRegistrationYearsException.class, () -> runFlow()); + assertThrows(ExceedsMaxRegistrationYearsException.class, this::runFlow); } @Test @@ -585,14 +585,14 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(IncorrectCurrentExpirationDateException.class, this::runFlow); } @Test public void testFailure_unauthorizedClient() throws Exception { sessionMetadata.setClientId("NewRegistrar"); persistActiveDomain(getUniqueIdFromCommand()); - assertThrows(ResourceNotOwnedException.class, () -> runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -608,7 +608,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(NotAuthorizedForTldException.class, this::runFlow); } @Test @@ -626,7 +626,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeesRequiredForPremiumNameException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/domain/DomainRestoreRequestFlowTest.java b/javatests/google/registry/flows/domain/DomainRestoreRequestFlowTest.java index 304f3a5a7..77bce8116 100644 --- a/javatests/google/registry/flows/domain/DomainRestoreRequestFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainRestoreRequestFlowTest.java @@ -234,63 +234,63 @@ public class DomainRestoreRequestFlowTest extends public void testFailure_refundableFee_v06() throws Exception { setEppInput("domain_update_restore_request_fee_refundable.xml", FEE_06_MAP); persistPendingDeleteDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_refundableFee_v11() throws Exception { setEppInput("domain_update_restore_request_fee_refundable.xml", FEE_11_MAP); persistPendingDeleteDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_refundableFee_v12() throws Exception { setEppInput("domain_update_restore_request_fee_refundable.xml", FEE_12_MAP); persistPendingDeleteDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_gracePeriodFee_v06() throws Exception { setEppInput("domain_update_restore_request_fee_grace_period.xml", FEE_06_MAP); persistPendingDeleteDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_gracePeriodFee_v11() throws Exception { setEppInput("domain_update_restore_request_fee_grace_period.xml", FEE_11_MAP); persistPendingDeleteDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_gracePeriodFee_v12() throws Exception { setEppInput("domain_update_restore_request_fee_grace_period.xml", FEE_12_MAP); persistPendingDeleteDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_appliedFee_v06() throws Exception { setEppInput("domain_update_restore_request_fee_applied.xml", FEE_06_MAP); persistPendingDeleteDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_appliedFee_v11() throws Exception { setEppInput("domain_update_restore_request_fee_applied.xml", FEE_11_MAP); persistPendingDeleteDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test public void testFailure_appliedFee_v12() throws Exception { setEppInput("domain_update_restore_request_fee_applied.xml", FEE_12_MAP); persistPendingDeleteDomain(); - assertThrows(UnsupportedFeeAttributeException.class, () -> runFlow()); + assertThrows(UnsupportedFeeAttributeException.class, this::runFlow); } @Test @@ -334,7 +334,7 @@ public class DomainRestoreRequestFlowTest extends @Test public void testFailure_doesNotExist() throws Exception { ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -344,7 +344,7 @@ public class DomainRestoreRequestFlowTest extends persistPendingDeleteDomain(); persistResource( Registry.get("tld").asBuilder().setRestoreBillingCost(Money.of(USD, 100)).build()); - assertThrows(FeesMismatchException.class, () -> runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -353,7 +353,7 @@ public class DomainRestoreRequestFlowTest extends persistPendingDeleteDomain(); persistResource( Registry.get("tld").asBuilder().setRestoreBillingCost(Money.of(USD, 100)).build()); - assertThrows(FeesMismatchException.class, () -> runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } @Test @@ -362,7 +362,7 @@ public class DomainRestoreRequestFlowTest extends persistPendingDeleteDomain(); persistResource( Registry.get("tld").asBuilder().setRestoreBillingCost(Money.of(USD, 100)).build()); - assertThrows(FeesMismatchException.class, () -> runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } private void runWrongCurrencyTest(Map substitutions) throws Exception { @@ -378,7 +378,7 @@ public class DomainRestoreRequestFlowTest extends .setEapFeeSchedule(ImmutableSortedMap.of(START_OF_TIME, Money.zero(EUR))) .setServerStatusChangeBillingCost(Money.of(EUR, 19)) .build()); - assertThrows(CurrencyUnitMismatchException.class, () -> runFlow()); + assertThrows(CurrencyUnitMismatchException.class, this::runFlow); } @Test @@ -400,21 +400,21 @@ public class DomainRestoreRequestFlowTest extends public void testFailure_feeGivenInWrongScale_v06() throws Exception { setEppInput("domain_update_restore_request_fee_bad_scale.xml", FEE_06_MAP); persistPendingDeleteDomain(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test public void testFailure_feeGivenInWrongScale_v11() throws Exception { setEppInput("domain_update_restore_request_fee_bad_scale.xml", FEE_11_MAP); persistPendingDeleteDomain(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test public void testFailure_feeGivenInWrongScale_v12() throws Exception { setEppInput("domain_update_restore_request_fee_bad_scale.xml", FEE_12_MAP); persistPendingDeleteDomain(); - assertThrows(CurrencyValueScaleException.class, () -> runFlow()); + assertThrows(CurrencyValueScaleException.class, this::runFlow); } @Test @@ -425,54 +425,54 @@ public class DomainRestoreRequestFlowTest extends .setDeletionTime(clock.nowUtc().plusDays(4)) .setStatusValues(ImmutableSet.of(StatusValue.PENDING_DELETE)) .build()); - assertThrows(DomainNotEligibleForRestoreException.class, () -> runFlow()); + assertThrows(DomainNotEligibleForRestoreException.class, this::runFlow); } @Test public void testFailure_notDeleted() throws Exception { persistActiveDomain(getUniqueIdFromCommand()); - assertThrows(DomainNotEligibleForRestoreException.class, () -> runFlow()); + assertThrows(DomainNotEligibleForRestoreException.class, this::runFlow); } @Test public void testFailure_fullyDeleted() throws Exception { persistDeletedDomain(getUniqueIdFromCommand(), clock.nowUtc().minusDays(1)); - assertThrows(ResourceDoesNotExistException.class, () -> runFlow()); + assertThrows(ResourceDoesNotExistException.class, this::runFlow); } @Test public void testFailure_withChange() throws Exception { persistPendingDeleteDomain(); setEppInput("domain_update_restore_request_with_change.xml"); - assertThrows(RestoreCommandIncludesChangesException.class, () -> runFlow()); + assertThrows(RestoreCommandIncludesChangesException.class, this::runFlow); } @Test public void testFailure_withAdd() throws Exception { persistPendingDeleteDomain(); setEppInput("domain_update_restore_request_with_add.xml"); - assertThrows(RestoreCommandIncludesChangesException.class, () -> runFlow()); + assertThrows(RestoreCommandIncludesChangesException.class, this::runFlow); } @Test public void testFailure_withRemove() throws Exception { persistPendingDeleteDomain(); setEppInput("domain_update_restore_request_with_remove.xml"); - assertThrows(RestoreCommandIncludesChangesException.class, () -> runFlow()); + assertThrows(RestoreCommandIncludesChangesException.class, this::runFlow); } @Test public void testFailure_withSecDnsExtension() throws Exception { persistPendingDeleteDomain(); setEppInput("domain_update_restore_request_with_secdns.xml"); - assertThrows(UnimplementedExtensionException.class, () -> runFlow()); + assertThrows(UnimplementedExtensionException.class, this::runFlow); } @Test public void testFailure_unauthorizedClient() throws Exception { sessionMetadata.setClientId("NewRegistrar"); persistPendingDeleteDomain(); - assertThrows(ResourceNotOwnedException.class, () -> runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -489,7 +489,7 @@ public class DomainRestoreRequestFlowTest extends persistResource( loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build()); persistPendingDeleteDomain(); - assertThrows(NotAuthorizedForTldException.class, () -> runFlow()); + assertThrows(NotAuthorizedForTldException.class, this::runFlow); } @Test @@ -508,7 +508,7 @@ public class DomainRestoreRequestFlowTest extends persistPendingDeleteDomain(); // Modify the Registrar to block premium names. persistResource(loadRegistrar("TheRegistrar").asBuilder().setBlockPremiumNames(true).build()); - assertThrows(PremiumNameBlockedException.class, () -> runFlow()); + assertThrows(PremiumNameBlockedException.class, this::runFlow); } @Test @@ -520,7 +520,7 @@ public class DomainRestoreRequestFlowTest extends .setReservedLists(persistReservedList("tld-reserved", "example,FULLY_BLOCKED")) .build()); persistPendingDeleteDomain(); - assertThrows(DomainReservedException.class, () -> runFlow()); + assertThrows(DomainReservedException.class, this::runFlow); } @Test @@ -528,7 +528,7 @@ public class DomainRestoreRequestFlowTest extends createTld("example"); setEppInput("domain_update_restore_request_premium.xml"); persistPendingDeleteDomain(); - assertThrows(FeesRequiredForPremiumNameException.class, () -> runFlow()); + assertThrows(FeesRequiredForPremiumNameException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java b/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java index b13b3d7bd..2d1b9e27c 100644 --- a/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainUpdateFlowTest.java @@ -440,7 +440,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(OnlyToolCanPassMetadataException.class, this::runFlow); } @Test @@ -794,7 +794,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(TooManyDsRecordsException.class, this::runFlow); } @Test @@ -804,7 +804,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(TooManyNameserversException.class, this::runFlow); } @Test @@ -812,14 +812,14 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(UnimplementedExtensionException.class, this::runFlow); } @Test public void testFailure_neverExisted() throws Exception { persistReferencedEntities(); ResourceDoesNotExistException thrown = - expectThrows(ResourceDoesNotExistException.class, () -> runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -828,7 +828,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -839,7 +839,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(LinkedResourcesDoNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(ns2.example.foo)"); } @@ -850,7 +850,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(LinkedResourcesDoNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(sh8013)"); } @@ -867,7 +867,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(DuplicateContactForRoleException.class, this::runFlow); } @Test @@ -875,7 +875,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(StatusNotClientSettableException.class, this::runFlow); } @Test @@ -935,7 +935,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceHasClientUpdateProhibitedException.class, this::runFlow); } @Test @@ -946,7 +946,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("serverUpdateProhibited"); } @@ -959,7 +959,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("pendingDelete"); } @@ -968,7 +968,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(DuplicateContactForRoleException.class, this::runFlow); } @Test @@ -977,7 +977,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(MissingContactTypeException.class, this::runFlow); } @Test @@ -985,7 +985,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -1004,7 +1004,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(NotAuthorizedForTldException.class, this::runFlow); } @Test @@ -1027,7 +1027,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(AddRemoveSameValueException.class, this::runFlow); } @Test @@ -1041,7 +1041,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(AddRemoveSameValueException.class, this::runFlow); } @Test @@ -1054,7 +1054,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(MissingAdminContactException.class, this::runFlow); } @Test @@ -1067,7 +1067,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(MissingTechnicalContactException.class, this::runFlow); } @Test @@ -1083,7 +1083,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + LinkedResourceInPendingDeleteProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("mak21"); } @@ -1101,7 +1101,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + LinkedResourceInPendingDeleteProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns2.example.foo"); } @@ -1114,7 +1114,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(RegistrantNotAllowedException.class, this::runFlow); } @Test @@ -1126,7 +1126,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(NameserversNotAllowedForTldException.class, this::runFlow); } @Test @@ -1209,7 +1209,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + NameserversNotSpecifiedForTldWithNameserverWhitelistException.class, this::runFlow); } @Test @@ -1238,7 +1238,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns2.example.foo"); } @@ -1255,7 +1255,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + NameserversNotSpecifiedForNameserverRestrictedDomainException.class, this::runFlow); } @Test @@ -1300,7 +1300,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns2.example.foo"); } @@ -1335,7 +1335,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(NameserversNotAllowedForDomainException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns2.example.foo"); } @@ -1353,7 +1353,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(NameserversNotAllowedForTldException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns2.example.foo"); } @@ -1372,7 +1372,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(DomainNotAllowedForTldWithCreateRestrictionException.class, this::runFlow); } @Test @@ -1387,7 +1387,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(DomainNotAllowedForTldWithCreateRestrictionException.class, this::runFlow); } @Test @@ -1441,7 +1441,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeesMismatchException.class, this::runFlow); } // This test should throw an exception, because the fee extension is required when the fee is not @@ -1451,7 +1451,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(FeesRequiredForNonFreeOperationException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/host/HostCheckFlowTest.java b/javatests/google/registry/flows/host/HostCheckFlowTest.java index a2a6bb2cd..df00b6132 100644 --- a/javatests/google/registry/flows/host/HostCheckFlowTest.java +++ b/javatests/google/registry/flows/host/HostCheckFlowTest.java @@ -76,7 +76,7 @@ public class HostCheckFlowTest extends ResourceCheckFlowTestCase runFlow()); + assertThrows(TooManyResourceChecksException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/host/HostCreateFlowTest.java b/javatests/google/registry/flows/host/HostCreateFlowTest.java index cc13b907d..fc8b7530b 100644 --- a/javatests/google/registry/flows/host/HostCreateFlowTest.java +++ b/javatests/google/registry/flows/host/HostCreateFlowTest.java @@ -126,7 +126,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(HostNameTooShallowException.class, this::runFlow); } @Test @@ -154,7 +154,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(SubordinateHostMustHaveIpException.class, this::runFlow); } @Test @@ -162,7 +162,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(UnexpectedExternalHostIpException.class, this::runFlow); } @Test @@ -170,7 +170,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(SuperordinateDomainDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(example.tld)"); } @@ -185,7 +185,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(SuperordinateDomainInPendingDeleteException.class, this::runFlow); assertThat(thrown) .hasMessageThat() .contains("Superordinate domain for this hostname is in pending delete"); @@ -196,7 +196,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceAlreadyExistsException.class, this::runFlow); assertThat(thrown) .hasMessageThat() .contains( @@ -206,27 +206,27 @@ public class HostCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(HostNameNotLowerCaseException.class, this::runFlow); } @Test public void testFailure_nonPunyCodedHostname() throws Exception { setEppHostCreateInput("ns1.çauçalito.みんな", null); HostNameNotPunyCodedException thrown = - expectThrows(HostNameNotPunyCodedException.class, () -> runFlow()); + expectThrows(HostNameNotPunyCodedException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("expected ns1.xn--aualito-txac.xn--q9jyb4c"); } @Test public void testFailure_nonCanonicalHostname() throws Exception { setEppHostCreateInput("ns1.example.tld.", null); - assertThrows(HostNameNotNormalizedException.class, () -> runFlow()); + assertThrows(HostNameNotNormalizedException.class, this::runFlow); } @Test public void testFailure_longHostName() throws Exception { setEppHostCreateInputWithIps("a" + Strings.repeat(".labelpart", 25) + ".tld"); - assertThrows(HostNameTooLongException.class, () -> runFlow()); + assertThrows(HostNameTooLongException.class, this::runFlow); } @Test @@ -236,7 +236,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase192.0.2.2\n" + "192.0.2.29\n" + "1080:0:0:0:8:800:200C:417A"); - assertThrows(IpAddressVersionMismatchException.class, () -> runFlow()); + assertThrows(IpAddressVersionMismatchException.class, this::runFlow); } private void doFailingHostNameTest(String hostName, Class exception) @@ -279,7 +279,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(HostNameTooShallowException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/host/HostDeleteFlowTest.java b/javatests/google/registry/flows/host/HostDeleteFlowTest.java index 07868960b..6d8faf793 100644 --- a/javatests/google/registry/flows/host/HostDeleteFlowTest.java +++ b/javatests/google/registry/flows/host/HostDeleteFlowTest.java @@ -85,7 +85,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(ns1.example.tld)"); } @@ -93,7 +93,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(ns1.example.tld)"); } @@ -130,7 +130,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -181,7 +181,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -236,7 +236,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -246,7 +246,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceToDeleteIsReferencedException.class, this::runFlow); } @Test @@ -256,27 +256,27 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceToDeleteIsReferencedException.class, this::runFlow); } @Test public void testFailure_nonLowerCaseHostname() throws Exception { setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "NS1.EXAMPLE.NET")); - assertThrows(HostNameNotLowerCaseException.class, () -> runFlow()); + assertThrows(HostNameNotLowerCaseException.class, this::runFlow); } @Test public void testFailure_nonPunyCodedHostname() throws Exception { setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "ns1.çauçalito.tld")); HostNameNotPunyCodedException thrown = - expectThrows(HostNameNotPunyCodedException.class, () -> runFlow()); + expectThrows(HostNameNotPunyCodedException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("expected ns1.xn--aualito-txac.tld"); } @Test public void testFailure_nonCanonicalHostname() throws Exception { setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld.")); - assertThrows(HostNameNotNormalizedException.class, () -> runFlow()); + assertThrows(HostNameNotNormalizedException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/host/HostInfoFlowTest.java b/javatests/google/registry/flows/host/HostInfoFlowTest.java index bb3703b1c..bdcae1cd8 100644 --- a/javatests/google/registry/flows/host/HostInfoFlowTest.java +++ b/javatests/google/registry/flows/host/HostInfoFlowTest.java @@ -147,7 +147,7 @@ public class HostInfoFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -156,28 +156,28 @@ public class HostInfoFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @Test public void testFailure_nonLowerCaseHostname() throws Exception { setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "NS1.EXAMPLE.NET")); - assertThrows(HostNameNotLowerCaseException.class, () -> runFlow()); + assertThrows(HostNameNotLowerCaseException.class, this::runFlow); } @Test public void testFailure_nonPunyCodedHostname() throws Exception { setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "ns1.çauçalito.tld")); HostNameNotPunyCodedException thrown = - expectThrows(HostNameNotPunyCodedException.class, () -> runFlow()); + expectThrows(HostNameNotPunyCodedException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("expected ns1.xn--aualito-txac.tld"); } @Test public void testFailure_nonCanonicalHostname() throws Exception { setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld.")); - assertThrows(HostNameNotNormalizedException.class, () -> runFlow()); + assertThrows(HostNameNotNormalizedException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/host/HostUpdateFlowTest.java b/javatests/google/registry/flows/host/HostUpdateFlowTest.java index 5a66883ec..d3a7caced 100644 --- a/javatests/google/registry/flows/host/HostUpdateFlowTest.java +++ b/javatests/google/registry/flows/host/HostUpdateFlowTest.java @@ -408,7 +408,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(CannotRenameExternalHostException.class, this::runFlow); } @Test @@ -760,7 +760,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(SuperordinateDomainDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("(example.tld)"); } @@ -781,7 +781,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(SuperordinateDomainInPendingDeleteException.class, this::runFlow); assertThat(thrown) .hasMessageThat() .contains("Superordinate domain for this hostname is in pending delete"); @@ -790,7 +790,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -798,7 +798,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -806,7 +806,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceDoesNotExistException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); } @@ -817,7 +817,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(HostAlreadyExistsException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns1.example.tld"); } @@ -827,28 +827,28 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(HostAlreadyExistsException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("ns2.example.tld"); } @Test public void testFailure_referToNonLowerCaseHostname() throws Exception { setEppHostUpdateInput("ns1.EXAMPLE.tld", "ns2.example.tld", null, null); - assertThrows(HostNameNotLowerCaseException.class, () -> runFlow()); + assertThrows(HostNameNotLowerCaseException.class, this::runFlow); } @Test public void testFailure_renameToNonLowerCaseHostname() throws Exception { persistActiveHost("ns1.example.tld"); setEppHostUpdateInput("ns1.example.tld", "ns2.EXAMPLE.tld", null, null); - assertThrows(HostNameNotLowerCaseException.class, () -> runFlow()); + assertThrows(HostNameNotLowerCaseException.class, this::runFlow); } @Test public void testFailure_referToNonPunyCodedHostname() throws Exception { setEppHostUpdateInput("ns1.çauçalito.tld", "ns1.sausalito.tld", null, null); HostNameNotPunyCodedException thrown = - expectThrows(HostNameNotPunyCodedException.class, () -> runFlow()); + expectThrows(HostNameNotPunyCodedException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("expected ns1.xn--aualito-txac.tld"); } @@ -857,7 +857,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(HostNameNotPunyCodedException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("expected ns1.xn--aualito-txac.tld"); } @@ -865,14 +865,14 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(HostNameNotNormalizedException.class, this::runFlow); } @Test public void testFailure_renameToNonCanonicalHostname() throws Exception { persistActiveHost("ns1.example.tld"); setEppHostUpdateInput("ns1.example.tld", "ns2.example.tld.", null, null); - assertThrows(HostNameNotNormalizedException.class, () -> runFlow()); + assertThrows(HostNameNotNormalizedException.class, this::runFlow); } @Test @@ -884,7 +884,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase1080:0:0:0:8:800:200C:417A"); createTld("tld"); persistActiveSubordinateHost(oldHostName(), persistActiveDomain("example.tld")); - assertThrows(CannotRemoveSubordinateHostLastIpException.class, () -> runFlow()); + assertThrows(CannotRemoveSubordinateHostLastIpException.class, this::runFlow); } @Test @@ -896,7 +896,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(RenameHostToExternalRemoveIpException.class, this::runFlow); } @Test @@ -908,7 +908,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(CannotAddIpToExternalHostException.class, this::runFlow); } @Test @@ -921,7 +921,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase", ""); persistActiveSubordinateHost(oldHostName(), persistActiveDomain("example.tld")); - assertThrows(AddRemoveSameValueException.class, () -> runFlow()); + assertThrows(AddRemoveSameValueException.class, this::runFlow); } @Test @@ -933,7 +933,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase192.0.2.22", "192.0.2.22"); - assertThrows(AddRemoveSameValueException.class, () -> runFlow()); + assertThrows(AddRemoveSameValueException.class, this::runFlow); } @Test @@ -957,7 +957,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceHasClientUpdateProhibitedException.class, this::runFlow); } @Test @@ -969,7 +969,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("serverUpdateProhibited"); } @@ -982,7 +982,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + expectThrows(ResourceStatusProhibitsOperationException.class, this::runFlow); assertThat(thrown).hasMessageThat().contains("pendingDelete"); } @@ -991,7 +991,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(StatusNotClientSettableException.class, this::runFlow); } @Test @@ -1012,7 +1012,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -1059,7 +1059,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -1092,7 +1092,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(ResourceNotOwnedException.class, this::runFlow); } @Test @@ -1112,7 +1112,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(HostDomainNotOwnedException.class, this::runFlow); } @Test @@ -1132,7 +1132,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase runFlow()); + assertThrows(HostDomainNotOwnedException.class, this::runFlow); } @Test diff --git a/javatests/google/registry/flows/poll/PollRequestFlowTest.java b/javatests/google/registry/flows/poll/PollRequestFlowTest.java index 4afe651ff..e6ea25697 100644 --- a/javatests/google/registry/flows/poll/PollRequestFlowTest.java +++ b/javatests/google/registry/flows/poll/PollRequestFlowTest.java @@ -221,6 +221,6 @@ public class PollRequestFlowTest extends FlowTestCase { public void testFailure_messageIdProvided() throws Exception { setEppInput("poll_with_id.xml"); assertTransactionalFlow(false); - assertThrows(UnexpectedMessageIdException.class, () -> runFlow()); + assertThrows(UnexpectedMessageIdException.class, this::runFlow); } } diff --git a/javatests/google/registry/flows/session/LogoutFlowTest.java b/javatests/google/registry/flows/session/LogoutFlowTest.java index da6b8d38e..5a2ad740e 100644 --- a/javatests/google/registry/flows/session/LogoutFlowTest.java +++ b/javatests/google/registry/flows/session/LogoutFlowTest.java @@ -44,6 +44,6 @@ public class LogoutFlowTest extends FlowTestCase { @Test public void testFailure() throws Exception { sessionMetadata.setClientId(null); // Turn off the implicit login - assertThrows(NotLoggedInException.class, () -> runFlow()); + assertThrows(NotLoggedInException.class, this::runFlow); } } diff --git a/javatests/google/registry/model/common/TimedTransitionPropertyTest.java b/javatests/google/registry/model/common/TimedTransitionPropertyTest.java index 3298b070f..57bbc18a4 100644 --- a/javatests/google/registry/model/common/TimedTransitionPropertyTest.java +++ b/javatests/google/registry/model/common/TimedTransitionPropertyTest.java @@ -165,7 +165,7 @@ public class TimedTransitionPropertyTest { timedString = forMapify("0", StringTimedTransition.class); // Simulate a load from Datastore by clearing, but don't insert any transitions. timedString.clear(); - assertThrows(IllegalStateException.class, () -> timedString.checkValidity()); + assertThrows(IllegalStateException.class, timedString::checkValidity); } @Test @@ -177,6 +177,6 @@ public class TimedTransitionPropertyTest { // omit a transition corresponding to START_OF_TIME. timedString.clear(); timedString.put(DATE_1, transition1); - assertThrows(IllegalStateException.class, () -> timedString.checkValidity()); + assertThrows(IllegalStateException.class, timedString::checkValidity); } } diff --git a/javatests/google/registry/rde/RdeStagingActionTest.java b/javatests/google/registry/rde/RdeStagingActionTest.java index d03a03dfb..2221fc045 100644 --- a/javatests/google/registry/rde/RdeStagingActionTest.java +++ b/javatests/google/registry/rde/RdeStagingActionTest.java @@ -159,7 +159,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { createTldWithEscrowEnabled("lol"); clock.setTo(DateTime.parse("2000-01-01TZ")); action.modeStrings = ImmutableSet.of("full"); - assertThrows(BadRequestException.class, () -> action.run()); + assertThrows(BadRequestException.class, action::run); } @Test @@ -167,7 +167,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { createTldWithEscrowEnabled("lol"); clock.setTo(DateTime.parse("2000-01-01TZ")); action.tlds = ImmutableSet.of("tld"); - assertThrows(BadRequestException.class, () -> action.run()); + assertThrows(BadRequestException.class, action::run); } @Test @@ -175,7 +175,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { createTldWithEscrowEnabled("lol"); clock.setTo(DateTime.parse("2000-01-01TZ")); action.watermarks = ImmutableSet.of(clock.nowUtc()); - assertThrows(BadRequestException.class, () -> action.run()); + assertThrows(BadRequestException.class, action::run); } @Test @@ -183,7 +183,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { createTldWithEscrowEnabled("lol"); clock.setTo(DateTime.parse("2000-01-01TZ")); action.revision = Optional.of(42); - assertThrows(BadRequestException.class, () -> action.run()); + assertThrows(BadRequestException.class, action::run); } @Test @@ -241,7 +241,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { action.modeStrings = ImmutableSet.of(); action.tlds = ImmutableSet.of("lol"); action.watermarks = ImmutableSet.of(clock.nowUtc()); - assertThrows(BadRequestException.class, () -> action.run()); + assertThrows(BadRequestException.class, action::run); } @Test @@ -253,7 +253,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { action.modeStrings = ImmutableSet.of("full", "thing"); action.tlds = ImmutableSet.of("lol"); action.watermarks = ImmutableSet.of(clock.nowUtc()); - assertThrows(BadRequestException.class, () -> action.run()); + assertThrows(BadRequestException.class, action::run); } @Test @@ -265,7 +265,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { action.modeStrings = ImmutableSet.of("full"); action.tlds = ImmutableSet.of(); action.watermarks = ImmutableSet.of(clock.nowUtc()); - assertThrows(BadRequestException.class, () -> action.run()); + assertThrows(BadRequestException.class, action::run); } @Test @@ -277,7 +277,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { action.modeStrings = ImmutableSet.of("full"); action.tlds = ImmutableSet.of("lol"); action.watermarks = ImmutableSet.of(); - assertThrows(BadRequestException.class, () -> action.run()); + assertThrows(BadRequestException.class, action::run); } @Test @@ -289,7 +289,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { action.modeStrings = ImmutableSet.of("full"); action.tlds = ImmutableSet.of("lol"); action.watermarks = ImmutableSet.of(DateTime.parse("2001-01-01T01:36:45Z")); - assertThrows(BadRequestException.class, () -> action.run()); + assertThrows(BadRequestException.class, action::run); } @Test @@ -302,7 +302,7 @@ public class RdeStagingActionTest extends MapreduceTestCase { action.tlds = ImmutableSet.of("lol"); action.watermarks = ImmutableSet.of(DateTime.parse("2001-01-01T00:00:00Z")); action.revision = Optional.of(-1); - assertThrows(BadRequestException.class, () -> action.run()); + assertThrows(BadRequestException.class, action::run); } @Test diff --git a/javatests/google/registry/tmch/NordnUploadActionTest.java b/javatests/google/registry/tmch/NordnUploadActionTest.java index 11864230f..8c80dfc00 100644 --- a/javatests/google/registry/tmch/NordnUploadActionTest.java +++ b/javatests/google/registry/tmch/NordnUploadActionTest.java @@ -199,7 +199,7 @@ public class NordnUploadActionTest { public void testFailure_nullRegistryUser() throws Exception { persistClaimsModeDomain(); persistResource(Registry.get("tld").asBuilder().setLordnUsername(null).build()); - VerifyException thrown = expectThrows(VerifyException.class, () -> action.run()); + VerifyException thrown = expectThrows(VerifyException.class, action::run); assertThat(thrown).hasMessageThat().contains("lordnUsername is not set for tld."); } @@ -207,7 +207,7 @@ public class NordnUploadActionTest { public void testFetchFailure() throws Exception { persistClaimsModeDomain(); when(httpResponse.getResponseCode()).thenReturn(SC_INTERNAL_SERVER_ERROR); - assertThrows(UrlFetchException.class, () -> action.run()); + assertThrows(UrlFetchException.class, action::run); } private HTTPRequest getCapturedHttpRequest() throws Exception { diff --git a/javatests/google/registry/tmch/NordnVerifyActionTest.java b/javatests/google/registry/tmch/NordnVerifyActionTest.java index 5ff637995..87b86cb1c 100644 --- a/javatests/google/registry/tmch/NordnVerifyActionTest.java +++ b/javatests/google/registry/tmch/NordnVerifyActionTest.java @@ -165,13 +165,13 @@ public class NordnVerifyActionTest { @Test public void failureVerifyUnauthorized() throws Exception { when(httpResponse.getResponseCode()).thenReturn(SC_UNAUTHORIZED); - assertThrows(Exception.class, () -> action.run()); + assertThrows(Exception.class, action::run); } @Test public void failureVerifyNotReady() throws Exception { when(httpResponse.getResponseCode()).thenReturn(SC_NO_CONTENT); - ConflictException thrown = expectThrows(ConflictException.class, () -> action.run()); + ConflictException thrown = expectThrows(ConflictException.class, action::run); assertThat(thrown).hasMessageThat().contains("Not ready"); } } diff --git a/javatests/google/registry/tools/server/DeleteEntityActionTest.java b/javatests/google/registry/tools/server/DeleteEntityActionTest.java index 67fbfe8b2..8de728336 100644 --- a/javatests/google/registry/tools/server/DeleteEntityActionTest.java +++ b/javatests/google/registry/tools/server/DeleteEntityActionTest.java @@ -85,7 +85,7 @@ public class DeleteEntityActionTest { Entity entity = new Entity("not", "here"); String rawKey = KeyFactory.keyToString(entity.getKey()); action.rawKeys = rawKey; - BadRequestException thrown = expectThrows(BadRequestException.class, () -> action.run()); + BadRequestException thrown = expectThrows(BadRequestException.class, action::run); assertThat(thrown).hasMessageThat().contains("Could not find entity with key " + rawKey); } @@ -97,7 +97,7 @@ public class DeleteEntityActionTest { Entity entity = new Entity("non", "existent"); String rawKey = KeyFactory.keyToString(entity.getKey()); action.rawKeys = String.format("%s,%s", ofyKey, rawKey); - BadRequestException thrown = expectThrows(BadRequestException.class, () -> action.run()); + BadRequestException thrown = expectThrows(BadRequestException.class, action::run); assertThat(thrown).hasMessageThat().contains("Could not find entity with key " + rawKey); } }