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
|
@ -17,6 +17,7 @@ package google.registry.tools;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.expectThrows;
|
||||
|
||||
import com.beust.jcommander.ParameterException;
|
||||
import google.registry.model.common.Cursor;
|
||||
|
@ -49,9 +50,9 @@ public class ListCursorsCommandTest extends CommandTestCase<ListCursorsCommand>
|
|||
|
||||
@Test
|
||||
public void testListCursors_badCursor_throwsIae() throws Exception {
|
||||
thrown.expect(ParameterException.class);
|
||||
thrown.expectMessage("Invalid value for --type parameter.");
|
||||
runCommand("--type=love");
|
||||
ParameterException thrown =
|
||||
expectThrows(ParameterException.class, () -> runCommand("--type=love"));
|
||||
assertThat(thrown).hasMessageThat().contains("Invalid value for --type parameter.");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue