mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 16:37: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,9 +14,11 @@
|
|||
|
||||
package google.registry.tools;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomainApplication;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.expectThrows;
|
||||
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
|
@ -79,8 +81,10 @@ public class GetLrpTokenCommandTest extends CommandTestCase<GetLrpTokenCommand>
|
|||
|
||||
@Test
|
||||
public void testFailure_noArgs() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("Exactly one of either token or assignee must be specified.");
|
||||
runCommand();
|
||||
IllegalArgumentException thrown =
|
||||
expectThrows(IllegalArgumentException.class, () -> runCommand());
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.contains("Exactly one of either token or assignee must be specified.");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue