mirror of
https://github.com/google/nomulus.git
synced 2025-08-06 01:35:17 +02:00
Migrate away fully from MockitoJUnitRunner
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=192291786
This commit is contained in:
parent
8f1848e32e
commit
183dae6e80
14 changed files with 134 additions and 128 deletions
|
@ -48,6 +48,7 @@ import google.registry.model.registry.Registry;
|
|||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.MockitoJUnitRule;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
import google.registry.util.UrlFetchException;
|
||||
import java.net.URL;
|
||||
|
@ -57,13 +58,13 @@ import org.junit.Before;
|
|||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Captor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
/** Unit tests for {@link NordnUploadAction}. */
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
@RunWith(JUnit4.class)
|
||||
public class NordnUploadActionTest {
|
||||
|
||||
private static final String CLAIMS_CSV = "1,2000-01-01T00:00:00.000Z,1\n"
|
||||
|
@ -79,21 +80,15 @@ public class NordnUploadActionTest {
|
|||
private static final String LOCATION_URL = "http://trololol";
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
.withDatastore()
|
||||
.withTaskQueue()
|
||||
.build();
|
||||
public final AppEngineRule appEngine =
|
||||
AppEngineRule.builder().withDatastore().withTaskQueue().build();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
@Mock
|
||||
private URLFetchService fetchService;
|
||||
@Rule public final MockitoJUnitRule mocks = MockitoJUnitRule.create();
|
||||
@Rule public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Captor
|
||||
private ArgumentCaptor<HTTPRequest> httpRequestCaptor;
|
||||
|
||||
@Mock
|
||||
private HTTPResponse httpResponse;
|
||||
@Mock private URLFetchService fetchService;
|
||||
@Mock private HTTPResponse httpResponse;
|
||||
@Captor private ArgumentCaptor<HTTPRequest> httpRequestCaptor;
|
||||
|
||||
private final FakeClock clock = new FakeClock(DateTime.parse("2000-01-01TZ"));
|
||||
private final LordnRequestInitializer lordnRequestInitializer = new LordnRequestInitializer();
|
||||
|
|
|
@ -36,19 +36,20 @@ import google.registry.model.registry.Registry;
|
|||
import google.registry.request.HttpException.ConflictException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.MockitoJUnitRule;
|
||||
import java.net.URL;
|
||||
import java.util.Optional;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Captor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
/** Unit tests for {@link NordnVerifyAction}. */
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
@RunWith(JUnit4.class)
|
||||
public class NordnVerifyActionTest {
|
||||
|
||||
private static final String CSV_DATA = "1,2012-08-16T00:00:00.0Z,3\n"
|
||||
|
@ -82,18 +83,14 @@ public class NordnVerifyActionTest {
|
|||
+ "bogpog,4611\n";
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
.withDatastore()
|
||||
.withTaskQueue()
|
||||
.build();
|
||||
@Mock
|
||||
private URLFetchService fetchService;
|
||||
public final AppEngineRule appEngine =
|
||||
AppEngineRule.builder().withDatastore().withTaskQueue().build();
|
||||
|
||||
@Captor
|
||||
private ArgumentCaptor<HTTPRequest> httpRequestCaptor;
|
||||
@Rule public final MockitoJUnitRule mocks = MockitoJUnitRule.create();
|
||||
|
||||
@Mock
|
||||
private HTTPResponse httpResponse;
|
||||
@Mock private URLFetchService fetchService;
|
||||
@Mock private HTTPResponse httpResponse;
|
||||
@Captor private ArgumentCaptor<HTTPRequest> httpRequestCaptor;
|
||||
|
||||
private final FakeResponse response = new FakeResponse();
|
||||
private final LordnRequestInitializer lordnRequestInitializer = new LordnRequestInitializer();
|
||||
|
|
|
@ -25,41 +25,30 @@ import google.registry.testing.AppEngineRule;
|
|||
import google.registry.testing.BouncyCastleProviderRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.MockitoJUnitRule;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Captor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
/** Common code for unit tests of classes that extend {@link Marksdb}. */
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
@RunWith(JUnit4.class)
|
||||
public class TmchActionTestCase {
|
||||
|
||||
static final String MARKSDB_LOGIN = "lolcat:attack";
|
||||
static final String MARKSDB_LOGIN_BASE64 = "bG9sY2F0OmF0dGFjaw==";
|
||||
static final String MARKSDB_URL = "http://127.0.0.1/love";
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
.withDatastore()
|
||||
.build();
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
@Rule public final MockitoJUnitRule mocks = MockitoJUnitRule.create();
|
||||
@Rule public final BouncyCastleProviderRule bouncy = new BouncyCastleProviderRule();
|
||||
@Rule public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final BouncyCastleProviderRule bouncy = new BouncyCastleProviderRule();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Mock
|
||||
URLFetchService fetchService;
|
||||
|
||||
@Captor
|
||||
ArgumentCaptor<HTTPRequest> httpRequest;
|
||||
|
||||
@Mock
|
||||
HTTPResponse httpResponse;
|
||||
@Mock URLFetchService fetchService;
|
||||
@Mock HTTPResponse httpResponse;
|
||||
@Captor ArgumentCaptor<HTTPRequest> httpRequest;
|
||||
|
||||
final FakeClock clock = new FakeClock();
|
||||
final Marksdb marksdb = new Marksdb();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue