mirror of
https://github.com/google/nomulus
synced 2026-09-26 18:04:36 +00:00
Automatically refactor more exception testing to use new JUnit rules
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=179072309
This commit is contained in:
@@ -21,6 +21,7 @@ import static google.registry.model.registry.label.ReservationType.FULLY_BLOCKED
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
import static google.registry.testing.DatastoreHelper.persistReservedList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.expectThrows;
|
||||
import static google.registry.tools.CreateReservedListCommand.INVALID_FORMAT_ERROR_MESSAGE;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
|
||||
@@ -90,9 +91,11 @@ public class CreateReservedListCommandTest extends
|
||||
public void testFailure_reservedListWithThatNameAlreadyExists() throws Exception {
|
||||
ReservedList rl = persistReservedList("xn--q9jyb4c_foo", "jones,FULLY_BLOCKED");
|
||||
persistResource(Registry.get("xn--q9jyb4c").asBuilder().setReservedLists(rl).build());
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("A reserved list already exists by this name");
|
||||
runCommandForced("--name=xn--q9jyb4c_foo", "--input=" + reservedTermsPath);
|
||||
IllegalArgumentException thrown =
|
||||
expectThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> runCommandForced("--name=xn--q9jyb4c_foo", "--input=" + reservedTermsPath));
|
||||
assertThat(thrown).hasMessageThat().contains("A reserved list already exists by this name");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user