mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Replace ExceptionRule with ExpectedException
This is in preparation for running the automatic refactoring script that will replace all ExpectedExceptions with use of JUnit 4.13's assertThrows/ expectThrows. Note that I have recorded the callsites of assertions about EppExceptions being marshallable and will edit those specific assertions back in after running the automatic refactoring script (which do not understand these). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=178812403
This commit is contained in:
parent
c5515ab4e6
commit
03c782f38e
142 changed files with 285 additions and 359 deletions
|
@ -88,7 +88,6 @@ import google.registry.model.reporting.HistoryEntry;
|
|||
import google.registry.model.transfer.TransferData;
|
||||
import google.registry.model.transfer.TransferResponse;
|
||||
import google.registry.model.transfer.TransferStatus;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.FakeSleeper;
|
||||
|
@ -103,6 +102,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class DeleteContactsAndHostsActionTest
|
|||
extends MapreduceTestCase<DeleteContactsAndHostsAction> {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -43,7 +43,6 @@ import google.registry.model.poll.PollMessage;
|
|||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.Registry.TldType;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.mapreduce.MapreduceTestCase;
|
||||
import java.util.Set;
|
||||
|
@ -52,6 +51,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
private static final DateTime DELETION_TIME = DateTime.parse("2010-01-01T00:00:00.000Z");
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
|
|
|
@ -48,7 +48,6 @@ import google.registry.model.registry.Registry;
|
|||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
import google.registry.model.reporting.DomainTransactionRecord.TransactionReportField;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.InjectRule;
|
||||
|
@ -61,6 +60,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -70,7 +70,7 @@ public class ExpandRecurringBillingEventsActionTest
|
|||
extends MapreduceTestCase<ExpandRecurringBillingEventsAction> {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -46,7 +46,6 @@ import com.google.appengine.tools.pipeline.impl.model.JobRecord;
|
|||
import com.google.appengine.tools.pipeline.impl.model.ShardedValue;
|
||||
import com.google.appengine.tools.pipeline.impl.model.Slot;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.mapreduce.MapreduceTestCase;
|
||||
|
@ -55,6 +54,7 @@ import java.util.Optional;
|
|||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -62,7 +62,7 @@ import org.junit.runners.JUnit4;
|
|||
public class MapreduceEntityCleanupActionTest
|
||||
extends MapreduceTestCase<MapreduceEntityCleanupAction> {
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private static final DatastoreService datastore = getDatastoreService();
|
||||
private static final FetchOptions FETCH_OPTIONS = FetchOptions.Builder.withChunkSize(200);
|
||||
|
|
|
@ -46,7 +46,6 @@ import google.registry.flows.async.AsyncFlowEnqueuer;
|
|||
import google.registry.flows.async.AsyncFlowMetrics;
|
||||
import google.registry.flows.async.AsyncFlowMetrics.OperationResult;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.FakeSleeper;
|
||||
|
@ -61,6 +60,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -70,7 +70,7 @@ public class RefreshDnsOnHostRenameActionTest
|
|||
extends MapreduceTestCase<RefreshDnsOnHostRenameAction> {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -23,12 +23,12 @@ import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
|||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
|
||||
import com.google.api.services.bigquery.model.JobReference;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.DateTimeZone;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -37,7 +37,7 @@ import org.junit.runners.JUnit4;
|
|||
public class BigqueryUtilsTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private static final DateTime DATE_0 = DateTime.parse("2014-07-17T20:35:42Z");
|
||||
private static final DateTime DATE_1 = DateTime.parse("2014-07-17T20:35:42.1Z");
|
||||
|
|
|
@ -20,7 +20,6 @@ import static google.registry.testing.TaskQueueHelper.assertTasksEnqueued;
|
|||
import com.google.common.base.Joiner;
|
||||
import google.registry.model.ofy.CommitLogBucket;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
import google.registry.util.Retrier;
|
||||
import google.registry.util.TaskEnqueuer;
|
||||
|
@ -29,6 +28,7 @@ import java.util.List;
|
|||
import java.util.Optional;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class CommitLogFanoutActionTest {
|
|||
private static final String QUEUE = "the-queue";
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
|
|
|
@ -32,7 +32,6 @@ import com.google.common.collect.ImmutableSet;
|
|||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.Registry.TldType;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
import google.registry.util.Retrier;
|
||||
|
@ -42,6 +41,7 @@ import java.util.Optional;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class TldFanoutActionTest {
|
|||
private final FakeResponse response = new FakeResponse();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
|
|
|
@ -26,7 +26,6 @@ import google.registry.model.ofy.Ofy;
|
|||
import google.registry.request.HttpException.NotFoundException;
|
||||
import google.registry.request.RequestModule;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import java.io.PrintWriter;
|
||||
|
@ -37,6 +36,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public final class DnsInjectionTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -19,11 +19,11 @@ import static google.registry.testing.TaskQueueHelper.assertNoTasksEnqueued;
|
|||
import static google.registry.testing.TaskQueueHelper.assertTasksEnqueued;
|
||||
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class DnsQueueTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private DnsQueue dnsQueue;
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ import google.registry.model.ofy.Ofy;
|
|||
import google.registry.model.registry.Registry;
|
||||
import google.registry.request.HttpException.ServiceUnavailableException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeLockHandler;
|
||||
import google.registry.testing.InjectRule;
|
||||
|
@ -41,6 +40,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class PublishDnsUpdatesActionTest {
|
|||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final FakeClock clock = new FakeClock(DateTime.parse("1971-01-01TZ"));
|
||||
private final FakeLockHandler lockHandler = new FakeLockHandler(true);
|
||||
|
|
|
@ -27,11 +27,11 @@ import google.registry.model.domain.DomainResource;
|
|||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.request.HttpException.NotFoundException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class RefreshDnsActionTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final DnsQueue dnsQueue = mock(DnsQueue.class);
|
||||
private final FakeClock clock = new FakeClock();
|
||||
|
|
|
@ -45,7 +45,6 @@ import google.registry.model.domain.secdns.DelegationSignerData;
|
|||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.util.Retrier;
|
||||
import google.registry.util.SystemClock;
|
||||
import google.registry.util.SystemSleeper;
|
||||
|
@ -57,6 +56,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Captor;
|
||||
|
@ -85,7 +85,7 @@ public class CloudDnsWriterTest {
|
|||
private CloudDnsWriter writer;
|
||||
private ImmutableSet<ResourceRecordSet> stubZone;
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import static org.mockito.Mockito.verify;
|
|||
import static org.mockito.Mockito.when;
|
||||
|
||||
import com.google.common.base.VerifyException;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.EOFException;
|
||||
|
@ -37,6 +36,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.xbill.DNS.ARecord;
|
||||
|
@ -64,7 +64,7 @@ public class DnsMessageTransportTest {
|
|||
private DnsMessageTransport resolver;
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Before
|
||||
public void before() throws Exception {
|
||||
|
|
|
@ -42,7 +42,6 @@ import google.registry.model.eppcommon.StatusValue;
|
|||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import java.util.ArrayList;
|
||||
|
@ -53,6 +52,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Captor;
|
||||
|
@ -77,7 +77,7 @@ public class DnsUpdateWriterTest {
|
|||
AppEngineRule.builder().withDatastore().withTaskQueue().build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -37,7 +37,6 @@ import google.registry.export.BigqueryPollJobAction.BigqueryPollJobEnqueuer;
|
|||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.request.HttpException.NotModifiedException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeSleeper;
|
||||
import google.registry.testing.TaskQueueHelper;
|
||||
|
@ -56,6 +55,7 @@ import java.util.logging.Logger;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -70,7 +70,7 @@ public class BigqueryPollJobActionTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private static final String PROJECT_ID = "project_id";
|
||||
private static final String JOB_ID = "job_id";
|
||||
|
|
|
@ -30,7 +30,6 @@ import google.registry.request.HttpException.BadRequestException;
|
|||
import google.registry.request.HttpException.NoContentException;
|
||||
import google.registry.request.HttpException.NotModifiedException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.InjectRule;
|
||||
|
@ -41,6 +40,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class CheckSnapshotActionTest {
|
|||
|
||||
@Rule public final InjectRule inject = new InjectRule();
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withTaskQueue().build();
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final DatastoreBackupService backupService = mock(DatastoreBackupService.class);
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ import com.google.appengine.api.datastore.Text;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.export.DatastoreBackupInfo.BackupStatus;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import java.util.Date;
|
||||
|
@ -33,6 +32,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -41,7 +41,7 @@ import org.junit.runners.JUnit4;
|
|||
public class DatastoreBackupInfoTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -26,7 +26,6 @@ import com.google.appengine.api.modules.ModulesService;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
import java.util.Date;
|
||||
|
@ -34,6 +33,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -42,7 +42,7 @@ import org.junit.runners.JUnit4;
|
|||
public class DatastoreBackupServiceTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -44,7 +44,6 @@ import google.registry.export.BigqueryPollJobAction.BigqueryPollJobEnqueuer;
|
|||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.request.HttpException.InternalServerErrorException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
import java.io.IOException;
|
||||
|
@ -53,6 +52,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
|
@ -67,7 +67,7 @@ public class LoadSnapshotActionTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final BigqueryFactory bigqueryFactory = mock(BigqueryFactory.class);
|
||||
private final Bigquery bigquery = mock(Bigquery.class);
|
||||
|
|
|
@ -39,13 +39,13 @@ import google.registry.request.HttpException.BadRequestException;
|
|||
import google.registry.request.HttpException.InternalServerErrorException;
|
||||
import google.registry.storage.drive.DriveConnection;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Map;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -54,7 +54,7 @@ import org.junit.runners.JUnit4;
|
|||
public class PublishDetailReportActionTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
|
|
|
@ -40,7 +40,6 @@ import google.registry.model.registrar.Registrar;
|
|||
import google.registry.model.registrar.RegistrarContact;
|
||||
import google.registry.request.Response;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeSleeper;
|
||||
import google.registry.testing.InjectRule;
|
||||
|
@ -48,6 +47,7 @@ import google.registry.util.Retrier;
|
|||
import java.io.IOException;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class SyncGroupMembersActionTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -36,12 +36,12 @@ import com.google.common.collect.Iterables;
|
|||
import google.registry.bigquery.BigqueryFactory;
|
||||
import google.registry.request.HttpException.InternalServerErrorException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
import java.io.IOException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
|
@ -57,7 +57,7 @@ public class UpdateSnapshotViewActionTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final BigqueryFactory bigqueryFactory = mock(BigqueryFactory.class);
|
||||
private final Bigquery bigquery = mock(Bigquery.class);
|
||||
|
|
|
@ -31,7 +31,6 @@ import google.registry.model.ofy.Ofy;
|
|||
import google.registry.monitoring.whitebox.EppMetric;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.EppLoader;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeHttpSession;
|
||||
import google.registry.testing.InjectRule;
|
||||
|
@ -40,6 +39,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class EppCommitLogsTest extends ShardableTestCase {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -21,10 +21,10 @@ import static google.registry.util.ResourceUtils.readResourceBytes;
|
|||
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.ShardableTestCase;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -33,7 +33,7 @@ import org.junit.runners.JUnit4;
|
|||
public class EppXmlTransformerTest extends ShardableTestCase {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testUnmarshalingEppInput() throws Exception {
|
||||
|
|
|
@ -33,12 +33,12 @@ import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension;
|
|||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppinput.EppInput.CommandExtension;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.util.TypeUtils;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class ExtensionManagerTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testDuplicateExtensionsForbidden() throws Exception {
|
||||
|
|
|
@ -49,7 +49,6 @@ import google.registry.model.tmch.ClaimsListShard.ClaimsListSingleton;
|
|||
import google.registry.monitoring.whitebox.EppMetric;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.EppLoader;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeHttpSession;
|
||||
import google.registry.testing.InjectRule;
|
||||
|
@ -64,6 +63,7 @@ import java.util.Map;
|
|||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -88,7 +88,7 @@ public abstract class FlowTestCase<F extends Flow> extends ShardableTestCase {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -19,10 +19,10 @@ import static org.mockito.Mockito.mock;
|
|||
import static org.mockito.Mockito.when;
|
||||
|
||||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import org.junit.runners.JUnit4;
|
|||
@RunWith(JUnit4.class)
|
||||
public final class TlsCredentialsTest {
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testProvideClientCertificateHash() {
|
||||
|
|
|
@ -47,12 +47,12 @@ import com.google.api.services.groupssettings.model.Groups;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.groups.GroupsConnection.Role;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -63,7 +63,7 @@ import org.junit.runners.JUnit4;
|
|||
public class DirectoryGroupsConnectionTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final Directory directory = mock(Directory.class);
|
||||
private final Groupssettings groupsSettings = mock(Groupssettings.class);
|
||||
|
|
|
@ -39,7 +39,6 @@ import google.registry.model.domain.DomainResource;
|
|||
import google.registry.model.index.EppResourceIndex;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
|
@ -52,6 +51,7 @@ import org.joda.time.DateTime;
|
|||
import org.joda.time.DateTimeZone;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class ChildEntityInputTest {
|
|||
public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
DomainResource domainA;
|
||||
DomainResource domainB;
|
||||
|
|
|
@ -39,7 +39,6 @@ import google.registry.model.domain.DomainResource;
|
|||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.EppResourceIndex;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
|
@ -49,6 +48,7 @@ import java.util.NoSuchElementException;
|
|||
import java.util.Set;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class EppResourceInputsTest {
|
|||
public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T> T serializeAndDeserialize(T obj) throws Exception {
|
||||
|
|
|
@ -26,7 +26,6 @@ import static org.joda.time.DateTimeZone.UTC;
|
|||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -34,6 +33,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class EppResourceUtilsTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -19,12 +19,12 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.googlecode.objectify.annotation.Id;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -33,7 +33,7 @@ import org.junit.runners.JUnit4;
|
|||
public class ModelUtilsTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public AppEngineRule appEngineRule = new AppEngineRule.Builder().build();
|
||||
|
|
|
@ -32,18 +32,18 @@ import google.registry.model.domain.DomainResource;
|
|||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link BillingEvent}. */
|
||||
public class BillingEventTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final DateTime now = DateTime.now(UTC);
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@ import static org.joda.money.CurrencyUnit.USD;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.EntityTestCase;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.money.CurrencyMismatchException;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -36,7 +36,7 @@ import org.junit.runners.JUnit4;
|
|||
public final class RegistrarBillingEntryTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testIndexing() throws Exception {
|
||||
|
|
|
@ -28,7 +28,6 @@ import google.registry.model.EntityTestCase;
|
|||
import google.registry.model.billing.RegistrarCredit.CreditType;
|
||||
import google.registry.model.billing.RegistrarCreditBalance.BalanceMap;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.util.Map;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
import org.joda.money.Money;
|
||||
|
@ -36,12 +35,13 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link RegistrarCreditBalance}. */
|
||||
public class RegistrarCreditBalanceTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public ExceptionRule thrown = new ExceptionRule();
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private DateTime then = clock.nowUtc().plusDays(1);
|
||||
|
||||
|
|
|
@ -26,17 +26,17 @@ import google.registry.model.EntityTestCase;
|
|||
import google.registry.model.billing.RegistrarCredit.CreditType;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link RegistrarCredit}. */
|
||||
public class RegistrarCreditTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public ExceptionRule thrown = new ExceptionRule();
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private RegistrarCredit auctionCredit;
|
||||
private RegistrarCredit promoCredit;
|
||||
|
|
|
@ -26,15 +26,15 @@ import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
|||
import google.registry.model.EntityTestCase;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link Cursor}. */
|
||||
public class CursorTest extends EntityTestCase {
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testSuccess_persistScopedCursor() {
|
||||
|
|
|
@ -20,10 +20,10 @@ import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Range;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class TimeOfYearTest {
|
|||
private static final DateTime march1 = DateTime.parse("2012-03-01T01:02:03.0Z");
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testSuccess_fromDateTime() throws Exception {
|
||||
|
|
|
@ -22,13 +22,13 @@ import static org.joda.time.DateTimeZone.UTC;
|
|||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -37,7 +37,7 @@ import org.junit.runners.JUnit4;
|
|||
public class TimedTransitionPropertyTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private static final DateTime A_LONG_TIME_AGO = new DateTime(Long.MIN_VALUE, UTC);
|
||||
|
||||
|
|
|
@ -36,16 +36,16 @@ import google.registry.model.eppcommon.Trid;
|
|||
import google.registry.model.transfer.TransferData;
|
||||
import google.registry.model.transfer.TransferData.TransferServerApproveEntity;
|
||||
import google.registry.model.transfer.TransferStatus;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link ContactResource}. */
|
||||
public class ContactResourceTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
ContactResource contactResource;
|
||||
|
||||
|
|
|
@ -39,17 +39,17 @@ import google.registry.model.eppcommon.StatusValue;
|
|||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.smd.EncodedSignedMark;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.money.Money;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link DomainApplication}. */
|
||||
public class DomainApplicationTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
DomainApplication domainApplication;
|
||||
|
||||
|
|
|
@ -51,19 +51,19 @@ import google.registry.model.reporting.HistoryEntry;
|
|||
import google.registry.model.transfer.TransferData;
|
||||
import google.registry.model.transfer.TransferData.TransferServerApproveEntity;
|
||||
import google.registry.model.transfer.TransferStatus;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.util.stream.Stream;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link DomainResource}. */
|
||||
public class DomainResourceTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
DomainResource domain;
|
||||
|
||||
|
|
|
@ -24,13 +24,13 @@ import google.registry.model.billing.BillingEvent.Recurring;
|
|||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class GracePeriodTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final DateTime now = DateTime.now(UTC);
|
||||
private BillingEvent.OneTime onetime;
|
||||
|
|
|
@ -25,10 +25,10 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.EntityTestCase;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link LrpTokenEntity}. */
|
||||
public class LrpTokenEntityTest extends EntityTestCase {
|
||||
|
@ -37,7 +37,7 @@ public class LrpTokenEntityTest extends EntityTestCase {
|
|||
LrpTokenEntity redeemedToken;
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -33,18 +33,18 @@ import google.registry.model.eppcommon.Trid;
|
|||
import google.registry.model.transfer.TransferData;
|
||||
import google.registry.model.transfer.TransferData.TransferServerApproveEntity;
|
||||
import google.registry.model.transfer.TransferStatus;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.net.InetAddress;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link HostResource}. */
|
||||
public class HostResourceTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
final DateTime day3 = clock.nowUtc();
|
||||
final DateTime day2 = day3.minusDays(1);
|
||||
|
|
|
@ -30,17 +30,17 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.EntityTestCase;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link DomainApplicationIndex}. */
|
||||
public class DomainApplicationIndexTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Before
|
||||
public void init() throws Exception {
|
||||
|
|
|
@ -26,16 +26,16 @@ import com.googlecode.objectify.Key;
|
|||
import google.registry.model.EntityTestCase;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.ForeignKeyIndex.ForeignKeyHostIndex;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link ForeignKeyIndex}. */
|
||||
public class ForeignKeyIndexTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -25,11 +25,11 @@ import com.google.common.base.Suppliers;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.googlecode.objectify.annotation.Cache;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.InjectRule;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class CommitLogBucketTest {
|
|||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
CommitLogBucket bucket;
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@ import static org.joda.time.DateTimeZone.UTC;
|
|||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class CommitLogCheckpointTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private static final DateTime T1 = START_OF_TIME;
|
||||
private static final DateTime T2 = START_OF_TIME.plusMillis(1);
|
||||
|
|
|
@ -30,7 +30,6 @@ import google.registry.model.BackupGroupRoot;
|
|||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.common.EntityGroupRoot;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.TestObject.TestVirtualObject;
|
||||
|
@ -38,6 +37,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class OfyCommitLogTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -28,11 +28,11 @@ import com.googlecode.objectify.ObjectifyService;
|
|||
import com.googlecode.objectify.annotation.Entity;
|
||||
import com.googlecode.objectify.annotation.Id;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class OfyFilterTest {
|
|||
}
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
/**
|
||||
* Key.create looks up kind metadata for the class of the object it is given. If this happens
|
||||
|
|
|
@ -48,7 +48,6 @@ import google.registry.model.eppcommon.Trid;
|
|||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.DatastoreHelper;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.util.SystemClock;
|
||||
import java.util.ConcurrentModificationException;
|
||||
|
@ -56,6 +55,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -69,7 +69,7 @@ public class OfyTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
/** An entity to use in save and delete tests. */
|
||||
private HistoryEntry someObject;
|
||||
|
|
|
@ -32,13 +32,13 @@ import google.registry.model.ofy.Ofy;
|
|||
import google.registry.model.poll.PollMessageExternalKeyConverter.PollMessageExternalKeyParseException;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class PollMessageExternalKeyConverterTest {
|
|||
public InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
HistoryEntry historyEntry;
|
||||
FakeClock clock = new FakeClock(DateTime.parse("2007-07-07T01:01:01Z"));
|
||||
|
|
|
@ -20,10 +20,10 @@ import static google.registry.model.rde.RdeMode.THIN;
|
|||
import static google.registry.model.rde.RdeNamingUtils.makePartialName;
|
||||
import static google.registry.model.rde.RdeNamingUtils.makeRydeFilename;
|
||||
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -32,7 +32,7 @@ import org.junit.runners.JUnit4;
|
|||
public class RdeNamingUtilsTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testMakeRydeFilename_rdeDeposit() throws Exception {
|
||||
|
|
|
@ -23,10 +23,10 @@ import static google.registry.model.rde.RdeRevision.saveRevision;
|
|||
import com.google.common.base.VerifyException;
|
||||
import com.googlecode.objectify.VoidWork;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class RdeRevisionTest {
|
|||
public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testGetNextRevision_objectDoesntExist_returnsZero() throws Exception {
|
||||
|
|
|
@ -37,18 +37,18 @@ import google.registry.model.EntityTestCase;
|
|||
import google.registry.model.common.EntityGroupRoot;
|
||||
import google.registry.model.registrar.Registrar.State;
|
||||
import google.registry.model.registrar.Registrar.Type;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.util.CidrAddressBlock;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link Registrar}. */
|
||||
public class RegistrarTest extends EntityTestCase {
|
||||
|
||||
@Rule
|
||||
public ExceptionRule thrown = new ExceptionRule();
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private Registrar registrar;
|
||||
private RegistrarContact abuseAdminContact;
|
||||
|
|
|
@ -20,9 +20,9 @@ import static google.registry.testing.DatastoreHelper.createTlds;
|
|||
|
||||
import com.google.common.net.InternetDomainName;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -34,7 +34,7 @@ public class RegistriesTest {
|
|||
public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule
|
||||
public ExceptionRule thrown = new ExceptionRule();
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private void initTestTlds() {
|
||||
createTlds("foo", "a.b.c"); // Test a multipart tld.
|
||||
|
|
|
@ -40,18 +40,18 @@ import google.registry.model.registry.Registry.RegistryNotFoundException;
|
|||
import google.registry.model.registry.Registry.TldState;
|
||||
import google.registry.model.registry.label.PremiumList;
|
||||
import google.registry.model.registry.label.ReservedList;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.math.BigDecimal;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
/** Unit tests for {@link Registry}. */
|
||||
public class RegistryTest extends EntityTestCase {
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
Registry registry;
|
||||
|
||||
|
|
|
@ -26,10 +26,10 @@ import com.google.common.collect.ImmutableList;
|
|||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.label.PremiumList.PremiumListRevision;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -37,7 +37,7 @@ import org.junit.runners.JUnit4;
|
|||
@RunWith(JUnit4.class)
|
||||
public class PremiumListTest {
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Before
|
||||
|
|
|
@ -47,12 +47,12 @@ import google.registry.model.registry.Registry;
|
|||
import google.registry.model.registry.label.PremiumList.PremiumListEntry;
|
||||
import google.registry.model.registry.label.PremiumList.PremiumListRevision;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.util.Map;
|
||||
import org.joda.money.Money;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -60,7 +60,7 @@ import org.junit.runners.JUnit4;
|
|||
@RunWith(JUnit4.class)
|
||||
public class PremiumListUtilsTest {
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Before
|
||||
|
|
|
@ -43,13 +43,13 @@ import google.registry.model.ofy.Ofy;
|
|||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.label.ReservedList.ReservedListEntry;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class ReservedListTest {
|
|||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
|
|
|
@ -20,10 +20,10 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
|
||||
import com.google.common.base.Strings;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -32,7 +32,7 @@ public class KmsSecretRevisionTest {
|
|||
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private KmsSecretRevision secretRevision;
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ import static org.mockito.Mockito.when;
|
|||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.server.Lock.LockState;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.util.RequestStatusChecker;
|
||||
|
@ -36,6 +35,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class LockTest {
|
|||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private Optional<Lock> acquire(String tld, Duration leaseLength, LockState expectedLockState) {
|
||||
Lock.lockMetrics = mock(LockMetrics.class);
|
||||
|
|
|
@ -22,11 +22,11 @@ import static org.joda.time.Duration.standardDays;
|
|||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class SignedMarkRevocationListTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final FakeClock clock = new FakeClock(DateTime.parse("2013-01-01T00:00:00Z"));
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ import com.googlecode.objectify.Key;
|
|||
import google.registry.model.tmch.ClaimsListShard.ClaimsListRevision;
|
||||
import google.registry.model.tmch.ClaimsListShard.UnshardedSaveException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.InjectRule;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -33,6 +32,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class ClaimsListShardTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -28,7 +28,6 @@ import google.registry.model.common.CrossTldSingleton;
|
|||
import google.registry.model.ofy.CommitLogManifest;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import java.util.List;
|
||||
|
@ -36,6 +35,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class CommitLogRevisionsTranslatorFactoryTest {
|
|||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final FakeClock clock = new FakeClock(START_TIME);
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ import com.google.common.collect.ImmutableSortedMap;
|
|||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.label.PremiumList;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.util.Clock;
|
||||
import org.joda.money.Money;
|
||||
|
@ -36,6 +35,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -44,7 +44,7 @@ import org.junit.runners.JUnit4;
|
|||
public class PricingEngineProxyTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
|
|
|
@ -17,9 +17,9 @@ package google.registry.rdap;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import google.registry.request.HttpException.UnprocessableEntityException;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -28,7 +28,7 @@ import org.junit.runners.JUnit4;
|
|||
public class RdapSearchPatternTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testNoWildcards_ok() throws Exception {
|
||||
|
|
|
@ -30,7 +30,6 @@ import google.registry.rde.EscrowTaskRunner.EscrowTask;
|
|||
import google.registry.request.HttpException.NoContentException;
|
||||
import google.registry.request.HttpException.ServiceUnavailableException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeLockHandler;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -38,6 +37,7 @@ import org.joda.time.DateTimeZone;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -46,7 +46,7 @@ import org.junit.runners.JUnit4;
|
|||
public class EscrowTaskRunnerTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
|
|
|
@ -27,7 +27,6 @@ import com.google.common.io.ByteStreams;
|
|||
import google.registry.keyring.api.Keyring;
|
||||
import google.registry.rde.Ghostryde.DecodeResult;
|
||||
import google.registry.testing.BouncyCastleProviderRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeKeyringModule;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -43,6 +42,7 @@ import org.junit.Test;
|
|||
import org.junit.experimental.theories.DataPoints;
|
||||
import org.junit.experimental.theories.Theories;
|
||||
import org.junit.experimental.theories.Theory;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/** Unit tests for {@link Ghostryde}. */
|
||||
|
@ -51,7 +51,7 @@ import org.junit.runner.RunWith;
|
|||
public class GhostrydeTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final BouncyCastleProviderRule bouncy = new BouncyCastleProviderRule();
|
||||
|
|
|
@ -27,7 +27,6 @@ import google.registry.model.domain.DomainResource;
|
|||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.xjc.host.XjcHostStatusType;
|
||||
import google.registry.xjc.host.XjcHostStatusValueType;
|
||||
import google.registry.xjc.rdehost.XjcRdeHost;
|
||||
|
@ -37,6 +36,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class HostResourceToXjcConverterTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
|
|
|
@ -49,7 +49,6 @@ import google.registry.model.registry.Registry;
|
|||
import google.registry.request.HttpException.InternalServerErrorException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.BouncyCastleProviderRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeKeyringModule;
|
||||
import google.registry.testing.FakeResponse;
|
||||
|
@ -66,6 +65,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
|
@ -79,7 +79,7 @@ public class RdeReportActionTest {
|
|||
private static final ByteSource IIRDEA_GOOD_XML = RdeTestData.loadBytes("iirdea_good.xml");
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final BouncyCastleProviderRule bouncy = new BouncyCastleProviderRule();
|
||||
|
@ -182,9 +182,9 @@ public class RdeReportActionTest {
|
|||
|
||||
@Test
|
||||
public void testRunWithLock_fetchFailed_throwsRuntimeException() throws Exception {
|
||||
class ExpectedException extends RuntimeException {}
|
||||
when(urlFetchService.fetch(any(HTTPRequest.class))).thenThrow(new ExpectedException());
|
||||
thrown.expect(ExpectedException.class);
|
||||
class ExpectedThrownException extends RuntimeException {}
|
||||
when(urlFetchService.fetch(any(HTTPRequest.class))).thenThrow(new ExpectedThrownException());
|
||||
thrown.expect(ExpectedThrownException.class);
|
||||
createAction().runWithLock(loadRdeReportCursor());
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ import google.registry.model.ofy.Ofy;
|
|||
import google.registry.model.registry.Registry;
|
||||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.request.RequestParameters;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeKeyringModule;
|
||||
import google.registry.testing.FakeLockHandler;
|
||||
|
@ -93,6 +92,7 @@ import org.junit.Before;
|
|||
import org.junit.BeforeClass;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -109,7 +109,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final FakeClock clock = new FakeClock();
|
||||
private final FakeResponse response = new FakeResponse();
|
||||
|
|
|
@ -61,7 +61,6 @@ import google.registry.request.HttpException.ServiceUnavailableException;
|
|||
import google.registry.request.RequestParameters;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.BouncyCastleProviderRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeKeyringModule;
|
||||
import google.registry.testing.FakeResponse;
|
||||
|
@ -87,6 +86,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
@ -115,7 +115,7 @@ public class RdeUploadActionTest {
|
|||
new GcsFilename("bucket", "tld_2010-10-17_full_S1_R1-report.xml.ghostryde");
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final SftpServerRule sftpd = new SftpServerRule();
|
||||
|
|
|
@ -25,7 +25,6 @@ import com.google.common.io.ByteStreams;
|
|||
import google.registry.config.RegistryConfig.ConfigModule;
|
||||
import google.registry.gcs.GcsUtils;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.xjc.JaxbFragment;
|
||||
import google.registry.xjc.rdecontact.XjcRdeContact;
|
||||
import google.registry.xjc.rdecontact.XjcRdeContactElement;
|
||||
|
@ -39,6 +38,7 @@ import java.io.OutputStream;
|
|||
import java.util.NoSuchElementException;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class RdeContactReaderTest {
|
|||
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
/** Reads at least one result at 0 offset 1 maxResults */
|
||||
@Test
|
||||
|
|
|
@ -28,7 +28,6 @@ import com.google.common.io.ByteStreams;
|
|||
import google.registry.config.RegistryConfig.ConfigModule;
|
||||
import google.registry.gcs.GcsUtils;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.xjc.JaxbFragment;
|
||||
import google.registry.xjc.rdedomain.XjcRdeDomain;
|
||||
import google.registry.xjc.rdedomain.XjcRdeDomainElement;
|
||||
|
@ -43,6 +42,7 @@ import java.util.NoSuchElementException;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class RdeDomainReaderTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
|
|
|
@ -26,7 +26,6 @@ import com.google.common.io.ByteStreams;
|
|||
import google.registry.config.RegistryConfig.ConfigModule;
|
||||
import google.registry.gcs.GcsUtils;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
@ -34,6 +33,7 @@ import java.util.List;
|
|||
import java.util.Optional;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class RdeHostInputTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
/** Number of shards cannot be negative */
|
||||
@Test
|
||||
|
|
|
@ -26,7 +26,6 @@ import com.google.common.io.ByteStreams;
|
|||
import google.registry.config.RegistryConfig.ConfigModule;
|
||||
import google.registry.gcs.GcsUtils;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.xjc.JaxbFragment;
|
||||
import google.registry.xjc.rdehost.XjcRdeHost;
|
||||
import google.registry.xjc.rdehost.XjcRdeHostElement;
|
||||
|
@ -40,6 +39,7 @@ import java.io.OutputStream;
|
|||
import java.util.NoSuchElementException;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class RdeHostReaderTest {
|
|||
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
/** Reads at least one result at 0 offset 1 maxResults */
|
||||
@Test
|
||||
|
|
|
@ -48,7 +48,6 @@ import google.registry.model.index.ForeignKeyIndex;
|
|||
import google.registry.model.registrar.Registrar;
|
||||
import google.registry.model.registry.Registry.TldState;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.ShardableTestCase;
|
||||
import java.io.IOException;
|
||||
|
@ -60,6 +59,7 @@ import org.junit.After;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class RdeImportUtilsTest extends ShardableTestCase {
|
|||
public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final GcsUtils gcsUtils = mock(GcsUtils.class);
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ import static google.registry.rde.imports.RdeImportsTestData.loadBytes;
|
|||
|
||||
import com.google.common.io.ByteSource;
|
||||
import google.registry.rde.imports.RdeParser.RdeHeader;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.xjc.rdecontact.XjcRdeContact;
|
||||
import google.registry.xjc.rdedomain.XjcRdeDomain;
|
||||
import google.registry.xjc.rdeeppparams.XjcRdeEppParams;
|
||||
|
@ -34,6 +33,7 @@ import org.junit.After;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class RdeParserTest {
|
|||
|
||||
private InputStream xml;
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private void checkHeader(RdeHeader header) {
|
||||
assertThat(header.getTld()).isEqualTo("test");
|
||||
|
|
|
@ -50,7 +50,6 @@ import google.registry.model.transfer.TransferData;
|
|||
import google.registry.model.transfer.TransferStatus;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.DeterministicStringGenerator;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.util.StringGenerator;
|
||||
import google.registry.xjc.rdedomain.XjcRdeDomain;
|
||||
|
@ -66,6 +65,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class XjcToDomainResourceConverterTest {
|
|||
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule public final InjectRule inject = new InjectRule();
|
||||
|
||||
|
|
|
@ -29,13 +29,13 @@ import com.google.api.client.util.Base64;
|
|||
import com.google.api.client.util.StringUtils;
|
||||
import com.google.common.io.ByteSource;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class IcannHttpReporterTest {
|
|||
|
||||
private MockLowLevelHttpRequest mockRequest;
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule public AppEngineRule appEngineRule = new AppEngineRule.Builder().withDatastore().build();
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import static org.mockito.Mockito.when;
|
|||
|
||||
import google.registry.reporting.IcannReportingModule.ReportType;
|
||||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.util.Clock;
|
||||
import java.util.Optional;
|
||||
|
@ -30,6 +29,7 @@ import org.joda.time.YearMonth;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class IcannReportingModuleTest {
|
|||
HttpServletRequest req = mock(HttpServletRequest.class);
|
||||
Clock clock;
|
||||
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
|
|
@ -18,12 +18,12 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
import static google.registry.request.JsonResponse.JSON_SAFETY_PREFIX;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import java.util.Map;
|
||||
import org.json.simple.JSONValue;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -32,7 +32,7 @@ import org.junit.runners.JUnit4;
|
|||
public class JsonResponseTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
FakeResponse fakeResponse = new FakeResponse();
|
||||
JsonResponse jsonResponse = new JsonResponse(fakeResponse);
|
||||
|
|
|
@ -20,9 +20,9 @@ import static google.registry.request.RequestModule.provideJsonPayload;
|
|||
import com.google.common.net.MediaType;
|
||||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.request.HttpException.UnsupportedMediaTypeException;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -31,7 +31,7 @@ import org.junit.runners.JUnit4;
|
|||
public final class RequestModuleTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testProvideJsonPayload() throws Exception {
|
||||
|
|
|
@ -28,11 +28,11 @@ import static org.mockito.Mockito.when;
|
|||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -41,7 +41,7 @@ import org.junit.runners.JUnit4;
|
|||
public class RequestParametersTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final HttpServletRequest req = mock(HttpServletRequest.class);
|
||||
|
||||
|
|
|
@ -21,12 +21,12 @@ import static org.mockito.Mockito.verify;
|
|||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -35,7 +35,7 @@ import org.junit.runners.JUnit4;
|
|||
public class ResponseImplTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final HttpServletResponse rsp = mock(HttpServletResponse.class);
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ import static com.google.common.truth.Truth8.assertThat;
|
|||
import static google.registry.request.auth.Auth.AUTH_INTERNAL_ONLY;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Callable;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -32,7 +32,7 @@ import org.junit.runners.JUnit4;
|
|||
public final class RouterTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ import google.registry.request.auth.RequestAuthenticator.AuthSettings;
|
|||
import google.registry.request.auth.RequestAuthenticator.UserPolicy;
|
||||
import google.registry.security.XsrfTokenManager;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeOAuthService;
|
||||
import google.registry.testing.FakeUserService;
|
||||
|
@ -39,6 +38,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class RequestAuthenticatorTest {
|
|||
public final AppEngineRule appEngine = AppEngineRule.builder().build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private static final AuthSettings AUTH_NONE = AuthSettings.create(
|
||||
ImmutableList.of(AuthMethod.INTERNAL),
|
||||
|
|
|
@ -22,7 +22,6 @@ import static org.mockito.Mockito.verify;
|
|||
|
||||
import google.registry.model.server.Lock;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Callable;
|
||||
import javax.annotation.Nullable;
|
||||
|
@ -30,6 +29,7 @@ import org.joda.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public final class LockHandlerImplTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private static class CountingCallable implements Callable<Void> {
|
||||
int numCalled = 0;
|
||||
|
|
|
@ -34,12 +34,12 @@ import com.google.api.services.drive.model.File;
|
|||
import com.google.api.services.drive.model.ParentReference;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.net.MediaType;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.ArgumentMatcher;
|
||||
|
@ -49,7 +49,7 @@ import org.mockito.ArgumentMatcher;
|
|||
public class DriveConnectionTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final Drive drive = mock(Drive.class);
|
||||
private final Files files = mock(Files.class);
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
// Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.testing;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static com.google.common.base.Strings.nullToEmpty;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
|
||||
import google.registry.flows.EppException;
|
||||
import javax.annotation.Nullable;
|
||||
import org.junit.rules.TestRule;
|
||||
import org.junit.runner.Description;
|
||||
import org.junit.runners.model.Statement;
|
||||
|
||||
/**
|
||||
* A test rule similar to JUnit's {@code ExpectedException} rule that does extra checking to ensure
|
||||
* that {@link EppException} derivatives have EPP-compliant error messages.
|
||||
*/
|
||||
public class ExceptionRule implements TestRule {
|
||||
|
||||
@Nullable
|
||||
Class<? extends Throwable> expectedExceptionClass;
|
||||
|
||||
@Nullable
|
||||
String expectedMessage;
|
||||
|
||||
@Override
|
||||
public Statement apply(final Statement base, Description description) {
|
||||
return new Statement() {
|
||||
@Override
|
||||
public void evaluate() throws Throwable {
|
||||
try {
|
||||
base.evaluate();
|
||||
if (expectedExceptionClass != null) {
|
||||
throw new AssertionError(String.format(
|
||||
"Expected test to throw %s%s",
|
||||
expectedExceptionClass.getSimpleName(),
|
||||
expectedMessage == null ? "" : (" with message: " + expectedMessage)));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
if (expectedExceptionClass == null
|
||||
|| !(expectedExceptionClass.isAssignableFrom(e.getClass())
|
||||
&& nullToEmpty(e.getMessage()).contains(nullToEmpty(expectedMessage)))) {
|
||||
throw e; // We didn't expect this so pass it through.
|
||||
}
|
||||
if (e instanceof EppException) {
|
||||
assertAboutEppExceptions().that((EppException) e).marshalsToXml();
|
||||
}
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
public void expect(Class<? extends Throwable> expectedExceptionClass) {
|
||||
checkState(this.expectedExceptionClass == null,
|
||||
"Don't use multiple `thrown.expect()` statements in your test.");
|
||||
this.expectedExceptionClass = expectedExceptionClass;
|
||||
}
|
||||
|
||||
public void expectMessage(String expectedMessage) {
|
||||
this.expectedMessage = expectedMessage;
|
||||
}
|
||||
}
|
|
@ -17,11 +17,11 @@ package google.registry.tldconfig.idn;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.net.URI;
|
||||
import java.util.Optional;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import org.junit.runners.JUnit4;
|
|||
public class IdnTableTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Test
|
||||
public void testDigits() {
|
||||
|
|
|
@ -17,12 +17,12 @@ package google.registry.tmch;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.tmch.LordnLog.Result;
|
||||
import java.util.Map.Entry;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -31,7 +31,7 @@ import org.junit.runners.JUnit4;
|
|||
public class LordnLogTest {
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
public static final ImmutableList<String> EXAMPLE_FROM_RFC =
|
||||
ImmutableList.of(
|
||||
|
|
|
@ -40,7 +40,6 @@ import google.registry.model.domain.launch.LaunchNotice;
|
|||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.registrar.Registrar.Type;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
|
@ -50,6 +49,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class LordnTaskTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
|
@ -45,7 +45,6 @@ import google.registry.model.domain.launch.LaunchNotice;
|
|||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
|
@ -56,6 +55,7 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Captor;
|
||||
|
@ -88,7 +88,7 @@ public class NordnUploadActionTest {
|
|||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Mock
|
||||
private URLFetchService fetchService;
|
||||
|
|
|
@ -34,13 +34,13 @@ import com.google.appengine.api.urlfetch.URLFetchService;
|
|||
import google.registry.model.registry.Registry;
|
||||
import google.registry.request.HttpException.ConflictException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import java.net.URL;
|
||||
import java.util.Optional;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Captor;
|
||||
|
@ -88,7 +88,7 @@ public class NordnVerifyActionTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Mock
|
||||
private URLFetchService fetchService;
|
||||
|
|
|
@ -23,11 +23,11 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.google.common.io.CharSource;
|
||||
import google.registry.model.smd.SignedMarkRevocationList;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class SmdrlCsvParserTest {
|
|||
.build();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
private final FakeClock clock = new FakeClock();
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@ import com.google.appengine.api.urlfetch.HTTPResponse;
|
|||
import com.google.appengine.api.urlfetch.URLFetchService;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.BouncyCastleProviderRule;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Captor;
|
||||
|
@ -51,7 +51,7 @@ public class TmchActionTestCase {
|
|||
public final BouncyCastleProviderRule bouncy = new BouncyCastleProviderRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
public final ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue