mirror of
https://github.com/google/nomulus
synced 2026-09-07 16:47:03 +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:
@@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.model.registry.label.ReservationType.FULLY_BLOCKED;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.expectThrows;
|
||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -92,8 +93,11 @@ public class UpdateReservedListCommandTest extends
|
||||
public void testFailure_reservedListDoesntExist() throws Exception {
|
||||
String errorMessage =
|
||||
"Could not update reserved list xn--q9jyb4c_poobah because it doesn't exist.";
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage(errorMessage);
|
||||
runCommand("--force", "--name=xn--q9jyb4c_poobah", "--input=" + reservedTermsPath);
|
||||
IllegalArgumentException thrown =
|
||||
expectThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
runCommand("--force", "--name=xn--q9jyb4c_poobah", "--input=" + reservedTermsPath));
|
||||
assertThat(thrown).hasMessageThat().contains(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user