mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02: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:
parent
d5d29959b4
commit
9157930983
100 changed files with 3900 additions and 3192 deletions
|
@ -22,6 +22,7 @@ import static google.registry.testing.DatastoreHelper.createTld;
|
|||
import static google.registry.testing.DatastoreHelper.loadPremiumListEntries;
|
||||
import static google.registry.testing.DatastoreHelper.persistPremiumList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.expectThrows;
|
||||
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.label.PremiumList;
|
||||
|
@ -48,9 +49,11 @@ public class DeletePremiumListCommandTest extends CommandTestCase<DeletePremiumL
|
|||
|
||||
@Test
|
||||
public void testFailure_whenPremiumListDoesNotExist() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("Cannot delete the premium list foo because it doesn't exist.");
|
||||
runCommandForced("--name=foo");
|
||||
IllegalArgumentException thrown =
|
||||
expectThrows(IllegalArgumentException.class, () -> runCommandForced("--name=foo"));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.contains("Cannot delete the premium list foo because it doesn't exist.");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue