mirror of
https://github.com/google/nomulus.git
synced 2025-05-16 17:37:13 +02:00
Move ExceptionRule up to FlowTestCase
This removes a much larger number of independent field defs. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=135846921
This commit is contained in:
parent
a500812a91
commit
cfbf62ef4e
6 changed files with 4 additions and 25 deletions
|
@ -47,6 +47,7 @@ import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.tmch.ClaimsListShard.ClaimsListSingleton;
|
import google.registry.model.tmch.ClaimsListShard.ClaimsListSingleton;
|
||||||
import google.registry.testing.AppEngineRule;
|
import google.registry.testing.AppEngineRule;
|
||||||
import google.registry.testing.EppLoader;
|
import google.registry.testing.EppLoader;
|
||||||
|
import google.registry.testing.ExceptionRule;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeHttpSession;
|
import google.registry.testing.FakeHttpSession;
|
||||||
import google.registry.testing.InjectRule;
|
import google.registry.testing.InjectRule;
|
||||||
|
@ -82,6 +83,9 @@ public abstract class FlowTestCase<F extends Flow> extends ShardableTestCase {
|
||||||
.withTaskQueue()
|
.withTaskQueue()
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
@Rule
|
||||||
|
public final ExceptionRule thrown = new ExceptionRule();
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public final InjectRule inject = new InjectRule();
|
public final InjectRule inject = new InjectRule();
|
||||||
|
|
||||||
|
|
|
@ -36,12 +36,10 @@ import google.registry.model.index.EppResourceIndex;
|
||||||
import google.registry.model.index.EppResourceIndexBucket;
|
import google.registry.model.index.EppResourceIndexBucket;
|
||||||
import google.registry.model.tmch.ClaimsListShard.ClaimsListRevision;
|
import google.registry.model.tmch.ClaimsListShard.ClaimsListRevision;
|
||||||
import google.registry.model.tmch.ClaimsListShard.ClaimsListSingleton;
|
import google.registry.model.tmch.ClaimsListShard.ClaimsListSingleton;
|
||||||
import google.registry.testing.ExceptionRule;
|
|
||||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||||
import google.registry.util.TypeUtils.TypeInstantiator;
|
import google.registry.util.TypeUtils.TypeInstantiator;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,9 +51,6 @@ import org.junit.Test;
|
||||||
public abstract class ResourceFlowTestCase<F extends Flow, R extends EppResource>
|
public abstract class ResourceFlowTestCase<F extends Flow, R extends EppResource>
|
||||||
extends FlowTestCase<F> {
|
extends FlowTestCase<F> {
|
||||||
|
|
||||||
@Rule
|
|
||||||
public final ExceptionRule thrown = new ExceptionRule();
|
|
||||||
|
|
||||||
protected R reloadResourceByForeignKey(DateTime now) throws Exception {
|
protected R reloadResourceByForeignKey(DateTime now) throws Exception {
|
||||||
// Force the session to be cleared so that when we read it back, we read from the datastore and
|
// Force the session to be cleared so that when we read it back, we read from the datastore and
|
||||||
// not from the transaction cache or memcache.
|
// not from the transaction cache or memcache.
|
||||||
|
|
|
@ -29,10 +29,8 @@ import google.registry.flows.poll.PollAckFlow.NotAuthorizedToAckMessageException
|
||||||
import google.registry.model.contact.ContactResource;
|
import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DomainResource;
|
import google.registry.model.domain.DomainResource;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
import google.registry.testing.ExceptionRule;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/** Unit tests for {@link PollAckFlow}. */
|
/** Unit tests for {@link PollAckFlow}. */
|
||||||
|
@ -44,9 +42,6 @@ public class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
private DomainResource domain;
|
private DomainResource domain;
|
||||||
private ContactResource contact;
|
private ContactResource contact;
|
||||||
|
|
||||||
@Rule
|
|
||||||
public final ExceptionRule thrown = new ExceptionRule();
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
setEppInput("poll_ack.xml");
|
setEppInput("poll_ack.xml");
|
||||||
|
|
|
@ -34,10 +34,8 @@ import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.transfer.TransferResponse.ContactTransferResponse;
|
import google.registry.model.transfer.TransferResponse.ContactTransferResponse;
|
||||||
import google.registry.model.transfer.TransferResponse.DomainTransferResponse;
|
import google.registry.model.transfer.TransferResponse.DomainTransferResponse;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.testing.ExceptionRule;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/** Unit tests for {@link PollRequestFlow}. */
|
/** Unit tests for {@link PollRequestFlow}. */
|
||||||
|
@ -47,9 +45,6 @@ public class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
private ContactResource contact;
|
private ContactResource contact;
|
||||||
private HostResource host;
|
private HostResource host;
|
||||||
|
|
||||||
@Rule
|
|
||||||
public final ExceptionRule thrown = new ExceptionRule();
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
setEppInput("poll.xml");
|
setEppInput("poll.xml");
|
||||||
|
|
|
@ -30,17 +30,12 @@ import google.registry.flows.session.LoginFlow.TooManyFailedLoginsException;
|
||||||
import google.registry.flows.session.LoginFlow.UnsupportedLanguageException;
|
import google.registry.flows.session.LoginFlow.UnsupportedLanguageException;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.Registrar.State;
|
import google.registry.model.registrar.Registrar.State;
|
||||||
import google.registry.testing.ExceptionRule;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/** Unit tests for {@link LoginFlow}. */
|
/** Unit tests for {@link LoginFlow}. */
|
||||||
public abstract class LoginFlowTestCase extends FlowTestCase<LoginFlow> {
|
public abstract class LoginFlowTestCase extends FlowTestCase<LoginFlow> {
|
||||||
|
|
||||||
@Rule
|
|
||||||
public final ExceptionRule thrown = new ExceptionRule();
|
|
||||||
|
|
||||||
Registrar registrar;
|
Registrar registrar;
|
||||||
Registrar.Builder registrarBuilder;
|
Registrar.Builder registrarBuilder;
|
||||||
|
|
||||||
|
|
|
@ -18,17 +18,12 @@ import static google.registry.testing.DatastoreHelper.createTld;
|
||||||
|
|
||||||
import google.registry.flows.FlowTestCase;
|
import google.registry.flows.FlowTestCase;
|
||||||
import google.registry.flows.LoggedInFlow.NotLoggedInException;
|
import google.registry.flows.LoggedInFlow.NotLoggedInException;
|
||||||
import google.registry.testing.ExceptionRule;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/** Unit tests for {@link LogoutFlow}. */
|
/** Unit tests for {@link LogoutFlow}. */
|
||||||
public class LogoutFlowTest extends FlowTestCase<LogoutFlow> {
|
public class LogoutFlowTest extends FlowTestCase<LogoutFlow> {
|
||||||
|
|
||||||
@Rule
|
|
||||||
public final ExceptionRule thrown = new ExceptionRule();
|
|
||||||
|
|
||||||
public LogoutFlowTest() {
|
public LogoutFlowTest() {
|
||||||
setEppInput("logout.xml");
|
setEppInput("logout.xml");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue