mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +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
|
@ -14,6 +14,8 @@
|
|||
|
||||
package google.registry.tools;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.JUnitBackports.expectThrows;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
|
@ -54,9 +56,12 @@ public class CreateRegistrarGroupsCommandTest extends
|
|||
|
||||
@Test
|
||||
public void test_throwsExceptionForNonExistentRegistrar() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage(
|
||||
"Could not load registrar with id FakeRegistrarThatDefinitelyDoesNotExist");
|
||||
runCommandForced("FakeRegistrarThatDefinitelyDoesNotExist");
|
||||
IllegalArgumentException thrown =
|
||||
expectThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> runCommandForced("FakeRegistrarThatDefinitelyDoesNotExist"));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.contains("Could not load registrar with id FakeRegistrarThatDefinitelyDoesNotExist");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue