Merge JUnitBackport's expectThrows into assertThrows

More information: https://github.com/junit-team/junit5/issues/531

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187034408
This commit is contained in:
cushon 2018-02-26 09:38:17 -08:00 committed by jianglai
parent f96a0b7da9
commit 606b470cd0
180 changed files with 1325 additions and 1381 deletions

View file

@ -20,7 +20,7 @@ import static google.registry.testing.DatastoreHelper.assertNoBillingEvents;
import static google.registry.testing.DatastoreHelper.persistActiveContact;
import static google.registry.testing.DatastoreHelper.persistDeletedContact;
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
import static google.registry.testing.JUnitBackports.expectThrows;
import static google.registry.testing.JUnitBackports.assertThrows;
import google.registry.flows.EppException;
import google.registry.flows.ResourceFlowTestCase;
@ -71,7 +71,7 @@ public class ContactCreateFlowTest
public void testFailure_alreadyExists() throws Exception {
persistActiveContact(getUniqueIdFromCommand());
ResourceAlreadyExistsException thrown =
expectThrows(ResourceAlreadyExistsException.class, this::runFlow);
assertThrows(ResourceAlreadyExistsException.class, this::runFlow);
assertThat(thrown)
.hasMessageThat()
.contains(
@ -89,7 +89,7 @@ public class ContactCreateFlowTest
public void testFailure_nonAsciiInIntAddress() throws Exception {
setEppInput("contact_create_hebrew_int.xml");
EppException thrown =
expectThrows(BadInternationalizedPostalInfoException.class, this::runFlow);
assertThrows(BadInternationalizedPostalInfoException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@ -97,7 +97,7 @@ public class ContactCreateFlowTest
public void testFailure_declineDisclosure() throws Exception {
setEppInput("contact_create_decline_disclosure.xml");
EppException thrown =
expectThrows(DeclineContactDisclosureFieldDisallowedPolicyException.class, this::runFlow);
assertThrows(DeclineContactDisclosureFieldDisallowedPolicyException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}