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:
mcilwain 2017-12-14 11:40:04 -08:00 committed by Ben McIlwain
parent d5d29959b4
commit 9157930983
100 changed files with 3900 additions and 3192 deletions

View file

@ -19,6 +19,7 @@ import static google.registry.testing.DatastoreHelper.newContactResource;
import static google.registry.testing.DatastoreHelper.persistActiveContact;
import static google.registry.testing.DatastoreHelper.persistDeletedContact;
import static google.registry.testing.DatastoreHelper.persistResource;
import static google.registry.testing.JUnitBackports.assertThrows;
import static org.joda.time.DateTimeZone.UTC;
import com.beust.jcommander.ParameterException;
@ -79,8 +80,7 @@ public class GetContactCommandTest extends CommandTestCase<GetContactCommand> {
@Test
public void testFailure_noContact() throws Exception {
thrown.expect(ParameterException.class);
runCommand();
assertThrows(ParameterException.class, () -> runCommand());
}
@Test