mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 03:57:51 +02:00
Remove AppEngineExtnesion (#1905)
Most of its usage can be replaced by JpaIntegrationTestExtension. In places where specific GAE APIs are still needed, namely when pull queue or the User service is used, two simplifed extensions are used, which makes them much easier to identify when the APIs are no longer used.
This commit is contained in:
parent
ffdbd1e883
commit
2416a8a762
172 changed files with 814 additions and 1453 deletions
|
@ -1,98 +0,0 @@
|
||||||
<datastore-indexes autoGenerate="false">
|
|
||||||
<!-- For finding contact resources by registrar. -->
|
|
||||||
<datastore-index kind="Contact" ancestor="false" source="manual">
|
|
||||||
<property name="currentSponsorClientId" direction="asc"/>
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
<property name="searchName" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For finding domain resources by registrar. -->
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="currentSponsorClientId" direction="asc"/>
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For finding domain resources by TLD. -->
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="tld" direction="asc"/>
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For finding domain resources by registrar. -->
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="currentSponsorClientId" direction="asc"/>
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For finding the most recently created domain resources. -->
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="tld" direction="asc"/>
|
|
||||||
<property name="creationTime" direction="desc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For finding host resources by registrar. -->
|
|
||||||
<datastore-index kind="Host" ancestor="false" source="manual">
|
|
||||||
<property name="currentSponsorClientId" direction="asc"/>
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
<property name="fullyQualifiedHostName" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For determining the active domains linked to a given contact. -->
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="allContacts.contact" direction="asc"/>
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For determining the active domains linked to a given host. -->
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="nsHosts" direction="asc"/>
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For deleting expired not-previously-deleted domains. -->
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
<property name="autorenewEndTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For RDAP searches by linked nameserver. -->
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="nsHosts" direction="asc"/>
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For WHOIS IP address lookup -->
|
|
||||||
<datastore-index kind="Host" ancestor="false" source="manual">
|
|
||||||
<property name="inetAddresses" direction="asc"/>
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For Poll -->
|
|
||||||
<datastore-index kind="PollMessage" ancestor="false" source="manual">
|
|
||||||
<property name="clientId" direction="asc"/>
|
|
||||||
<property name="eventTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<datastore-index kind="PollMessage" ancestor="true" source="manual">
|
|
||||||
<property name="clientId" direction="asc"/>
|
|
||||||
<property name="eventTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For querying HistoryEntries. -->
|
|
||||||
<datastore-index kind="HistoryEntry" ancestor="true" source="manual">
|
|
||||||
<property name="modificationTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<datastore-index kind="HistoryEntry" ancestor="false" source="manual">
|
|
||||||
<property name="clientId" direction="asc"/>
|
|
||||||
<property name="modificationTime" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<!-- For RDAP. -->
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="currentSponsorClientId" direction="asc"/>
|
|
||||||
<property name="fullyQualifiedDomainName" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="currentSponsorClientId" direction="asc"/>
|
|
||||||
<property name="tld" direction="asc"/>
|
|
||||||
<property name="fullyQualifiedDomainName" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<datastore-index kind="Domain" ancestor="false" source="manual">
|
|
||||||
<property name="tld" direction="asc"/>
|
|
||||||
<property name="fullyQualifiedDomainName" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<datastore-index kind="Host" ancestor="false" source="manual">
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
<property name="fullyQualifiedHostName" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
<datastore-index kind="Contact" ancestor="false" source="manual">
|
|
||||||
<property name="deletionTime" direction="asc"/>
|
|
||||||
<property name="searchName" direction="asc"/>
|
|
||||||
</datastore-index>
|
|
||||||
</datastore-indexes>
|
|
|
@ -20,7 +20,7 @@ import java.math.BigInteger;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocates a {@link long} to use as a {@code @Id}, (part) of the primary SQL key for an entity.
|
* Allocates a {@code long} to use as a {@code @Id}, (part) of the primary SQL key for an entity.
|
||||||
*/
|
*/
|
||||||
public final class IdService {
|
public final class IdService {
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ import static google.registry.testing.TestLogHandlerUtils.assertLogMessage;
|
||||||
import com.google.cloud.tasks.v2.HttpMethod;
|
import com.google.cloud.tasks.v2.HttpMethod;
|
||||||
import com.google.common.collect.ImmutableSortedSet;
|
import com.google.common.collect.ImmutableSortedSet;
|
||||||
import google.registry.model.contact.Contact;
|
import google.registry.model.contact.Contact;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.CloudTasksHelper;
|
import google.registry.testing.CloudTasksHelper;
|
||||||
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
|
@ -47,8 +48,8 @@ import org.mockito.quality.Strictness;
|
||||||
public class AsyncTaskEnqueuerTest {
|
public class AsyncTaskEnqueuerTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private AsyncTaskEnqueuer asyncTaskEnqueuer;
|
private AsyncTaskEnqueuer asyncTaskEnqueuer;
|
||||||
private final CapturingLogHandler logHandler = new CapturingLogHandler();
|
private final CapturingLogHandler logHandler = new CapturingLogHandler();
|
||||||
|
|
|
@ -33,7 +33,8 @@ import google.registry.model.contact.Contact;
|
||||||
import google.registry.model.domain.token.AllocationToken;
|
import google.registry.model.domain.token.AllocationToken;
|
||||||
import google.registry.model.domain.token.AllocationToken.TokenType;
|
import google.registry.model.domain.token.AllocationToken.TokenType;
|
||||||
import google.registry.model.domain.token.PackagePromotion;
|
import google.registry.model.domain.token.PackagePromotion;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.ui.server.SendEmailUtils;
|
import google.registry.ui.server.SendEmailUtils;
|
||||||
|
@ -67,8 +68,8 @@ public class CheckPackagesComplianceActionTest {
|
||||||
private static final String SUPPORT_EMAIL = "registry@test.com";
|
private static final String SUPPORT_EMAIL = "registry@test.com";
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withClock(clock).build();
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
private CheckPackagesComplianceAction action;
|
private CheckPackagesComplianceAction action;
|
||||||
private AllocationToken token;
|
private AllocationToken token;
|
||||||
|
|
|
@ -36,12 +36,14 @@ import google.registry.model.domain.Domain;
|
||||||
import google.registry.model.domain.DomainHistory;
|
import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.persistence.transaction.QueryComposer.Comparator;
|
import google.registry.persistence.transaction.QueryComposer.Comparator;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeLockHandler;
|
import google.registry.testing.FakeLockHandler;
|
||||||
import google.registry.testing.FakeResponse;
|
import google.registry.testing.FakeResponse;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -54,8 +56,10 @@ class DeleteExpiredDomainsActionTest {
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("2016-06-13T20:21:22Z"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("2016-06-13T20:21:22Z"));
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withClock(clock).withTaskQueue().build();
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
|
@RegisterExtension final TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
private final FakeResponse response = new FakeResponse();
|
private final FakeResponse response = new FakeResponse();
|
||||||
private DeleteExpiredDomainsAction action;
|
private DeleteExpiredDomainsAction action;
|
||||||
|
|
|
@ -44,10 +44,12 @@ import google.registry.model.poll.PollMessage;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.Registry.TldType;
|
import google.registry.model.tld.Registry.TldType;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.SystemPropertyExtension;
|
import google.registry.testing.SystemPropertyExtension;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
|
@ -63,8 +65,10 @@ class DeleteProberDataActionTest {
|
||||||
private static final DateTime DELETION_TIME = DateTime.parse("2010-01-01T00:00:00.000Z");
|
private static final DateTime DELETION_TIME = DateTime.parse("2010-01-01T00:00:00.000Z");
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withLocalModules().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
|
@RegisterExtension TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final SystemPropertyExtension systemPropertyExtension = new SystemPropertyExtension();
|
final SystemPropertyExtension systemPropertyExtension = new SystemPropertyExtension();
|
||||||
|
|
|
@ -51,7 +51,8 @@ import google.registry.model.reporting.DomainTransactionRecord;
|
||||||
import google.registry.model.reporting.DomainTransactionRecord.TransactionReportField;
|
import google.registry.model.reporting.DomainTransactionRecord.TransactionReportField;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeResponse;
|
import google.registry.testing.FakeResponse;
|
||||||
|
@ -68,8 +69,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class ExpandRecurringBillingEventsActionTest {
|
public class ExpandRecurringBillingEventsActionTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withLocalModules().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private DateTime currentTestTime = DateTime.parse("1999-01-05T00:00:00Z");
|
private DateTime currentTestTime = DateTime.parse("1999-01-05T00:00:00Z");
|
||||||
private final FakeClock clock = new FakeClock(currentTestTime);
|
private final FakeClock clock = new FakeClock(currentTestTime);
|
||||||
|
|
|
@ -38,14 +38,14 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.model.domain.Domain;
|
import google.registry.model.domain.Domain;
|
||||||
import google.registry.model.domain.RegistryLock;
|
import google.registry.model.domain.RegistryLock;
|
||||||
import google.registry.model.host.Host;
|
import google.registry.model.host.Host;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.CloudTasksHelper;
|
import google.registry.testing.CloudTasksHelper;
|
||||||
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.DeterministicStringGenerator;
|
import google.registry.testing.DeterministicStringGenerator;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeResponse;
|
import google.registry.testing.FakeResponse;
|
||||||
import google.registry.testing.UserInfo;
|
|
||||||
import google.registry.tools.DomainLockUtils;
|
import google.registry.tools.DomainLockUtils;
|
||||||
import google.registry.util.EmailMessage;
|
import google.registry.util.EmailMessage;
|
||||||
import google.registry.util.SendEmailService;
|
import google.registry.util.SendEmailService;
|
||||||
|
@ -72,7 +72,7 @@ public class RelockDomainActionTest {
|
||||||
|
|
||||||
private final FakeResponse response = new FakeResponse();
|
private final FakeResponse response = new FakeResponse();
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("2015-05-18T12:34:56Z"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("2015-05-18T12:34:56Z"));
|
||||||
private CloudTasksHelper cloudTasksHelper = new CloudTasksHelper(clock);
|
private final CloudTasksHelper cloudTasksHelper = new CloudTasksHelper(clock);
|
||||||
private final DomainLockUtils domainLockUtils =
|
private final DomainLockUtils domainLockUtils =
|
||||||
new DomainLockUtils(
|
new DomainLockUtils(
|
||||||
new DeterministicStringGenerator(Alphabets.BASE_58),
|
new DeterministicStringGenerator(Alphabets.BASE_58),
|
||||||
|
@ -80,12 +80,8 @@ public class RelockDomainActionTest {
|
||||||
cloudTasksHelper.getTestCloudTasksUtils());
|
cloudTasksHelper.getTestCloudTasksUtils());
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngineExtension =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder()
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
.withCloudSql()
|
|
||||||
.withTaskQueue()
|
|
||||||
.withUserService(UserInfo.create(POC_ID))
|
|
||||||
.build();
|
|
||||||
|
|
||||||
private Domain domain;
|
private Domain domain;
|
||||||
private RegistryLock oldLock;
|
private RegistryLock oldLock;
|
||||||
|
|
|
@ -26,17 +26,12 @@ import com.google.api.services.dataflow.model.LaunchFlexTemplateRequest;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import google.registry.beam.BeamActionTestBase;
|
import google.registry.beam.BeamActionTestBase;
|
||||||
import google.registry.config.RegistryEnvironment;
|
import google.registry.config.RegistryEnvironment;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Unit tests for {@link ResaveAllEppResourcesPipelineAction}. */
|
/** Unit tests for {@link ResaveAllEppResourcesPipelineAction}. */
|
||||||
public class ResaveAllEppResourcesPipelineActionTest extends BeamActionTestBase {
|
public class ResaveAllEppResourcesPipelineActionTest extends BeamActionTestBase {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
|
||||||
|
|
||||||
private final FakeClock fakeClock = new FakeClock();
|
private final FakeClock fakeClock = new FakeClock();
|
||||||
|
|
||||||
private ResaveAllEppResourcesPipelineAction createAction(boolean isFast) {
|
private ResaveAllEppResourcesPipelineAction createAction(boolean isFast) {
|
||||||
|
|
|
@ -34,8 +34,9 @@ import google.registry.model.domain.Domain;
|
||||||
import google.registry.model.domain.GracePeriod;
|
import google.registry.model.domain.GracePeriod;
|
||||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.Response;
|
import google.registry.request.Response;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.CloudTasksHelper;
|
import google.registry.testing.CloudTasksHelper;
|
||||||
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
|
@ -55,8 +56,8 @@ import org.mockito.quality.Strictness;
|
||||||
public class ResaveEntityActionTest {
|
public class ResaveEntityActionTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Mock private Response response;
|
@Mock private Response response;
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("2016-02-11T10:00:00Z"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("2016-02-11T10:00:00Z"));
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
package google.registry.batch;
|
package google.registry.batch;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.testing.AppEngineExtension.makeRegistrar1;
|
import static google.registry.persistence.transaction.JpaTransactionManagerExtension.makeRegistrar1;
|
||||||
import static google.registry.testing.DatabaseHelper.loadByEntity;
|
import static google.registry.testing.DatabaseHelper.loadByEntity;
|
||||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||||
import static google.registry.testing.DatabaseHelper.persistSimpleResources;
|
import static google.registry.testing.DatabaseHelper.persistSimpleResources;
|
||||||
|
@ -36,7 +36,8 @@ import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarPoc;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.registrar.RegistrarPoc.Type;
|
import google.registry.model.registrar.RegistrarPoc.Type;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeResponse;
|
import google.registry.testing.FakeResponse;
|
||||||
import google.registry.util.SelfSignedCaCertificate;
|
import google.registry.util.SelfSignedCaCertificate;
|
||||||
|
@ -70,8 +71,8 @@ class SendExpiringCertificateNotificationEmailActionTest {
|
||||||
private static final String EXPIRATION_WARNING_EMAIL_SUBJECT_TEXT = "Expiration Warning Email";
|
private static final String EXPIRATION_WARNING_EMAIL_SUBJECT_TEXT = "Expiration Warning Email";
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("2021-05-24T20:21:22Z"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("2021-05-24T20:21:22Z"));
|
||||||
private final SendEmailService sendEmailService = mock(SendEmailService.class);
|
private final SendEmailService sendEmailService = mock(SendEmailService.class);
|
||||||
|
|
|
@ -34,7 +34,8 @@ import google.registry.model.contact.PostalInfo;
|
||||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||||
import google.registry.model.eppcommon.PresenceMarker;
|
import google.registry.model.eppcommon.PresenceMarker;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeResponse;
|
import google.registry.testing.FakeResponse;
|
||||||
|
@ -98,8 +99,8 @@ class WipeOutContactHistoryPiiActionTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("2021-08-26T20:21:22Z"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("2021-08-26T20:21:22Z"));
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
package google.registry.beam.common;
|
package google.registry.beam.common;
|
||||||
|
|
||||||
import static google.registry.testing.AppEngineExtension.makeRegistrar1;
|
import static google.registry.persistence.transaction.JpaTransactionManagerExtension.makeRegistrar1;
|
||||||
import static google.registry.testing.DatabaseHelper.insertInDb;
|
import static google.registry.testing.DatabaseHelper.insertInDb;
|
||||||
import static google.registry.testing.DatabaseHelper.newContact;
|
import static google.registry.testing.DatabaseHelper.newContact;
|
||||||
import static google.registry.testing.DatabaseHelper.newRegistry;
|
import static google.registry.testing.DatabaseHelper.newRegistry;
|
||||||
|
@ -42,7 +42,6 @@ import google.registry.model.transfer.ContactTransferData;
|
||||||
import google.registry.persistence.transaction.CriteriaQueryBuilder;
|
import google.registry.persistence.transaction.CriteriaQueryBuilder;
|
||||||
import google.registry.persistence.transaction.JpaTestExtensions;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.apache.beam.sdk.coders.StringUtf8Coder;
|
import org.apache.beam.sdk.coders.StringUtf8Coder;
|
||||||
import org.apache.beam.sdk.testing.PAssert;
|
import org.apache.beam.sdk.testing.PAssert;
|
||||||
|
@ -60,7 +59,7 @@ public class RegistryJpaReadTest {
|
||||||
private final FakeClock fakeClock = new FakeClock(START_TIME);
|
private final FakeClock fakeClock = new FakeClock(START_TIME);
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final transient JpaIntegrationTestExtension database =
|
final transient JpaIntegrationTestExtension jpa =
|
||||||
new JpaTestExtensions.Builder()
|
new JpaTestExtensions.Builder()
|
||||||
.withClock(fakeClock)
|
.withClock(fakeClock)
|
||||||
.withoutCannedData()
|
.withoutCannedData()
|
||||||
|
@ -74,7 +73,7 @@ public class RegistryJpaReadTest {
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
Registrar ofyRegistrar = AppEngineExtension.makeRegistrar2();
|
Registrar ofyRegistrar = JpaIntegrationTestExtension.makeRegistrar2();
|
||||||
insertInDb(ofyRegistrar);
|
insertInDb(ofyRegistrar);
|
||||||
|
|
||||||
ImmutableList.Builder<Contact> builder = new ImmutableList.Builder<>();
|
ImmutableList.Builder<Contact> builder = new ImmutableList.Builder<>();
|
||||||
|
|
|
@ -27,7 +27,7 @@ import google.registry.beam.TestPipelineExtension;
|
||||||
import google.registry.model.contact.Contact;
|
import google.registry.model.contact.Contact;
|
||||||
import google.registry.persistence.transaction.JpaTestExtensions;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTransactionManagerExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import org.apache.beam.sdk.Pipeline.PipelineExecutionException;
|
import org.apache.beam.sdk.Pipeline.PipelineExecutionException;
|
||||||
|
@ -43,7 +43,7 @@ class RegistryJpaWriteTest implements Serializable {
|
||||||
private final FakeClock fakeClock = new FakeClock(DateTime.parse("2000-01-01T00:00:00.0Z"));
|
private final FakeClock fakeClock = new FakeClock(DateTime.parse("2000-01-01T00:00:00.0Z"));
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final transient JpaIntegrationTestExtension database =
|
final transient JpaIntegrationTestExtension jpa =
|
||||||
new JpaTestExtensions.Builder().withClock(fakeClock).buildIntegrationTestExtension();
|
new JpaTestExtensions.Builder().withClock(fakeClock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
|
@ -52,7 +52,7 @@ class RegistryJpaWriteTest implements Serializable {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void writeToSql_twoWriters() {
|
void writeToSql_twoWriters() {
|
||||||
tm().transact(() -> tm().put(AppEngineExtension.makeRegistrar2()));
|
tm().transact(() -> tm().put(JpaTransactionManagerExtension.makeRegistrar2()));
|
||||||
ImmutableList.Builder<Contact> contactsBuilder = new ImmutableList.Builder<>();
|
ImmutableList.Builder<Contact> contactsBuilder = new ImmutableList.Builder<>();
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
contactsBuilder.add(newContact("contact_" + i));
|
contactsBuilder.add(newContact("contact_" + i));
|
||||||
|
@ -76,7 +76,7 @@ class RegistryJpaWriteTest implements Serializable {
|
||||||
// causing a race condition
|
// causing a race condition
|
||||||
tm().transact(
|
tm().transact(
|
||||||
() -> {
|
() -> {
|
||||||
tm().put(AppEngineExtension.makeRegistrar2());
|
tm().put(JpaTransactionManagerExtension.makeRegistrar2());
|
||||||
tm().put(newContact("contact"));
|
tm().put(newContact("contact"));
|
||||||
});
|
});
|
||||||
Contact contact = Iterables.getOnlyElement(loadAllOf(Contact.class));
|
Contact contact = Iterables.getOnlyElement(loadAllOf(Contact.class));
|
||||||
|
|
|
@ -22,13 +22,13 @@ import static google.registry.beam.rde.RdePipeline.encodePendingDeposits;
|
||||||
import static google.registry.model.common.Cursor.CursorType.RDE_STAGING;
|
import static google.registry.model.common.Cursor.CursorType.RDE_STAGING;
|
||||||
import static google.registry.model.rde.RdeMode.FULL;
|
import static google.registry.model.rde.RdeMode.FULL;
|
||||||
import static google.registry.model.rde.RdeMode.THIN;
|
import static google.registry.model.rde.RdeMode.THIN;
|
||||||
|
import static google.registry.persistence.transaction.JpaTransactionManagerExtension.makeRegistrar1;
|
||||||
|
import static google.registry.persistence.transaction.JpaTransactionManagerExtension.makeRegistrar2;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
import static google.registry.rde.RdeResourceType.CONTACT;
|
import static google.registry.rde.RdeResourceType.CONTACT;
|
||||||
import static google.registry.rde.RdeResourceType.DOMAIN;
|
import static google.registry.rde.RdeResourceType.DOMAIN;
|
||||||
import static google.registry.rde.RdeResourceType.HOST;
|
import static google.registry.rde.RdeResourceType.HOST;
|
||||||
import static google.registry.rde.RdeResourceType.REGISTRAR;
|
import static google.registry.rde.RdeResourceType.REGISTRAR;
|
||||||
import static google.registry.testing.AppEngineExtension.makeRegistrar1;
|
|
||||||
import static google.registry.testing.AppEngineExtension.makeRegistrar2;
|
|
||||||
import static google.registry.testing.DatabaseHelper.createTld;
|
import static google.registry.testing.DatabaseHelper.createTld;
|
||||||
import static google.registry.testing.DatabaseHelper.insertSimpleResources;
|
import static google.registry.testing.DatabaseHelper.insertSimpleResources;
|
||||||
import static google.registry.testing.DatabaseHelper.persistActiveContact;
|
import static google.registry.testing.DatabaseHelper.persistActiveContact;
|
||||||
|
|
|
@ -17,8 +17,8 @@ package google.registry.beam.spec11;
|
||||||
import static com.google.common.collect.ImmutableList.toImmutableList;
|
import static com.google.common.collect.ImmutableList.toImmutableList;
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.model.ImmutableObjectSubject.immutableObjectCorrespondence;
|
import static google.registry.model.ImmutableObjectSubject.immutableObjectCorrespondence;
|
||||||
|
import static google.registry.persistence.transaction.JpaTransactionManagerExtension.makeRegistrar1;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
import static google.registry.testing.AppEngineExtension.makeRegistrar1;
|
|
||||||
import static google.registry.testing.DatabaseHelper.createTld;
|
import static google.registry.testing.DatabaseHelper.createTld;
|
||||||
import static google.registry.testing.DatabaseHelper.persistActiveContact;
|
import static google.registry.testing.DatabaseHelper.persistActiveContact;
|
||||||
import static google.registry.testing.DatabaseHelper.persistNewRegistrar;
|
import static google.registry.testing.DatabaseHelper.persistNewRegistrar;
|
||||||
|
|
|
@ -27,7 +27,8 @@ import com.google.common.collect.ImmutableListMultimap;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.Registry.TldType;
|
import google.registry.model.tld.Registry.TldType;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.CloudTasksHelper;
|
import google.registry.testing.CloudTasksHelper;
|
||||||
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
|
@ -48,7 +49,8 @@ class TldFanoutActionTest {
|
||||||
private final CloudTasksHelper cloudTasksHelper = new CloudTasksHelper(new FakeClock());
|
private final CloudTasksHelper cloudTasksHelper = new CloudTasksHelper(new FakeClock());
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private static ImmutableListMultimap<String, String> getParamsMap(String... keysAndValues) {
|
private static ImmutableListMultimap<String, String> getParamsMap(String... keysAndValues) {
|
||||||
ImmutableListMultimap.Builder<String, String> params = new ImmutableListMultimap.Builder<>();
|
ImmutableListMultimap.Builder<String, String> params = new ImmutableListMultimap.Builder<>();
|
||||||
|
|
|
@ -24,11 +24,13 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.HttpException.NotFoundException;
|
import google.registry.request.HttpException.NotFoundException;
|
||||||
import google.registry.request.RequestModule;
|
import google.registry.request.RequestModule;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.CloudTasksHelper.CloudTasksHelperModule;
|
import google.registry.testing.CloudTasksHelper.CloudTasksHelperModule;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
@ -42,8 +44,10 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public final class DnsInjectionTest {
|
public final class DnsInjectionTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
|
@RegisterExtension final TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
private final HttpServletRequest req = mock(HttpServletRequest.class);
|
private final HttpServletRequest req = mock(HttpServletRequest.class);
|
||||||
private final HttpServletResponse rsp = mock(HttpServletResponse.class);
|
private final HttpServletResponse rsp = mock(HttpServletResponse.class);
|
||||||
|
|
|
@ -20,8 +20,10 @@ import static google.registry.testing.TaskQueueHelper.assertNoTasksEnqueued;
|
||||||
import static google.registry.testing.TaskQueueHelper.assertTasksEnqueued;
|
import static google.registry.testing.TaskQueueHelper.assertTasksEnqueued;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -32,8 +34,10 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class DnsQueueTest {
|
public class DnsQueueTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
|
@RegisterExtension final TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
private DnsQueue dnsQueue;
|
private DnsQueue dnsQueue;
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("2010-01-01T10:00:00Z"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("2010-01-01T10:00:00Z"));
|
||||||
|
|
|
@ -48,9 +48,10 @@ import google.registry.dns.DnsMetrics.PublishStatus;
|
||||||
import google.registry.dns.writer.DnsWriter;
|
import google.registry.dns.writer.DnsWriter;
|
||||||
import google.registry.model.domain.Domain;
|
import google.registry.model.domain.Domain;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.HttpException.ServiceUnavailableException;
|
import google.registry.request.HttpException.ServiceUnavailableException;
|
||||||
import google.registry.request.lock.LockHandler;
|
import google.registry.request.lock.LockHandler;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.CloudTasksHelper;
|
import google.registry.testing.CloudTasksHelper;
|
||||||
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
|
@ -73,8 +74,8 @@ import org.mockito.ArgumentCaptor;
|
||||||
public class PublishDnsUpdatesActionTest {
|
public class PublishDnsUpdatesActionTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("1971-01-01TZ"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("1971-01-01TZ"));
|
||||||
private final FakeResponse response = new FakeResponse();
|
private final FakeResponse response = new FakeResponse();
|
||||||
|
|
|
@ -32,7 +32,6 @@ import com.google.appengine.api.taskqueue.QueueFactory;
|
||||||
import com.google.appengine.api.taskqueue.TaskOptions;
|
import com.google.appengine.api.taskqueue.TaskOptions;
|
||||||
import com.google.cloud.tasks.v2.HttpMethod;
|
import com.google.cloud.tasks.v2.HttpMethod;
|
||||||
import com.google.cloud.tasks.v2.Task;
|
import com.google.cloud.tasks.v2.Task;
|
||||||
import com.google.common.base.Joiner;
|
|
||||||
import com.google.common.base.Splitter;
|
import com.google.common.base.Splitter;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
|
@ -42,10 +41,12 @@ import com.google.common.net.InternetDomainName;
|
||||||
import google.registry.dns.DnsConstants.TargetType;
|
import google.registry.dns.DnsConstants.TargetType;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.Registry.TldType;
|
import google.registry.model.tld.Registry.TldType;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.CloudTasksHelper;
|
import google.registry.testing.CloudTasksHelper;
|
||||||
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import google.registry.testing.TaskQueueHelper;
|
import google.registry.testing.TaskQueueHelper;
|
||||||
import google.registry.testing.UriParameters;
|
import google.registry.testing.UriParameters;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
@ -70,21 +71,10 @@ public class ReadDnsQueueActionTest {
|
||||||
private final CloudTasksHelper cloudTasksHelper = new CloudTasksHelper(clock);
|
private final CloudTasksHelper cloudTasksHelper = new CloudTasksHelper(clock);
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder()
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
.withCloudSql()
|
|
||||||
.withTaskQueue(
|
@RegisterExtension final TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
Joiner.on('\n')
|
|
||||||
.join(
|
|
||||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
|
|
||||||
"<queue-entries>",
|
|
||||||
" <queue>",
|
|
||||||
" <name>dns-pull</name>",
|
|
||||||
" <mode>pull</mode>",
|
|
||||||
" </queue>",
|
|
||||||
"</queue-entries>"))
|
|
||||||
.withClock(clock)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
|
|
|
@ -26,9 +26,10 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||||
|
|
||||||
import google.registry.dns.DnsConstants.TargetType;
|
import google.registry.dns.DnsConstants.TargetType;
|
||||||
import google.registry.model.domain.Domain;
|
import google.registry.model.domain.Domain;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.HttpException.BadRequestException;
|
import google.registry.request.HttpException.BadRequestException;
|
||||||
import google.registry.request.HttpException.NotFoundException;
|
import google.registry.request.HttpException.NotFoundException;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -38,8 +39,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class RefreshDnsActionTest {
|
public class RefreshDnsActionTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final DnsQueue dnsQueue = mock(DnsQueue.class);
|
private final DnsQueue dnsQueue = mock(DnsQueue.class);
|
||||||
private final FakeClock clock = new FakeClock();
|
private final FakeClock clock = new FakeClock();
|
||||||
|
|
|
@ -43,7 +43,8 @@ import google.registry.model.domain.secdns.DomainDsData;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.Host;
|
import google.registry.model.host.Host;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.util.Retrier;
|
import google.registry.util.Retrier;
|
||||||
import google.registry.util.SystemClock;
|
import google.registry.util.SystemClock;
|
||||||
|
@ -70,7 +71,8 @@ import org.mockito.quality.Strictness;
|
||||||
public class CloudDnsWriterTest {
|
public class CloudDnsWriterTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private static final Inet4Address IPv4 = (Inet4Address) InetAddresses.forString("127.0.0.1");
|
private static final Inet4Address IPv4 = (Inet4Address) InetAddresses.forString("127.0.0.1");
|
||||||
private static final Inet6Address IPv6 = (Inet6Address) InetAddresses.forString("::1");
|
private static final Inet6Address IPv6 = (Inet6Address) InetAddresses.forString("::1");
|
||||||
|
|
|
@ -39,7 +39,8 @@ import google.registry.model.domain.Domain;
|
||||||
import google.registry.model.domain.secdns.DomainDsData;
|
import google.registry.model.domain.secdns.DomainDsData;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.Host;
|
import google.registry.model.host.Host;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -72,8 +73,8 @@ import org.xbill.DNS.Update;
|
||||||
public class DnsUpdateWriterTest {
|
public class DnsUpdateWriterTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
public final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Mock private DnsMessageTransport mockResolver;
|
@Mock private DnsMessageTransport mockResolver;
|
||||||
@Captor private ArgumentCaptor<Update> updateCaptor;
|
@Captor private ArgumentCaptor<Update> updateCaptor;
|
||||||
|
|
|
@ -35,8 +35,9 @@ import com.google.common.net.MediaType;
|
||||||
import google.registry.gcs.GcsUtils;
|
import google.registry.gcs.GcsUtils;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.Registry.TldType;
|
import google.registry.model.tld.Registry.TldType;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.storage.drive.DriveConnection;
|
import google.registry.storage.drive.DriveConnection;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -54,8 +55,8 @@ class ExportDomainListsActionTest {
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("2020-02-02T02:02:02Z"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("2020-02-02T02:02:02Z"));
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withLocalModules().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
|
|
|
@ -39,9 +39,10 @@ import com.google.common.net.MediaType;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.label.PremiumList;
|
import google.registry.model.tld.label.PremiumList;
|
||||||
import google.registry.model.tld.label.PremiumListDao;
|
import google.registry.model.tld.label.PremiumListDao;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.Response;
|
import google.registry.request.Response;
|
||||||
import google.registry.storage.drive.DriveConnection;
|
import google.registry.storage.drive.DriveConnection;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -58,7 +59,8 @@ public class ExportPremiumTermsActionTest {
|
||||||
DISCLAIMER_WITH_NEWLINE + "0, 549.00\n" + "2048, 549.00\n";
|
DISCLAIMER_WITH_NEWLINE + "0, 549.00\n" + "2048, 549.00\n";
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final DriveConnection driveConnection = mock(DriveConnection.class);
|
private final DriveConnection driveConnection = mock(DriveConnection.class);
|
||||||
private final Response response = mock(Response.class);
|
private final Response response = mock(Response.class);
|
||||||
|
|
|
@ -34,9 +34,10 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.net.MediaType;
|
import com.google.common.net.MediaType;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.label.ReservedList;
|
import google.registry.model.tld.label.ReservedList;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.Response;
|
import google.registry.request.Response;
|
||||||
import google.registry.storage.drive.DriveConnection;
|
import google.registry.storage.drive.DriveConnection;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -46,7 +47,7 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class ExportReservedTermsActionTest {
|
public class ExportReservedTermsActionTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
JpaIntegrationTestExtension jpa = new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final DriveConnection driveConnection = mock(DriveConnection.class);
|
private final DriveConnection driveConnection = mock(DriveConnection.class);
|
||||||
private final Response response = mock(Response.class);
|
private final Response response = mock(Response.class);
|
||||||
|
|
|
@ -21,7 +21,8 @@ import static google.registry.testing.DatabaseHelper.persistResource;
|
||||||
|
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.label.ReservedList;
|
import google.registry.model.tld.label.ReservedList;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
|
@ -29,7 +30,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
class ExportUtilsTest {
|
class ExportUtilsTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void test_exportReservedTerms() {
|
void test_exportReservedTerms() {
|
||||||
|
|
|
@ -38,8 +38,9 @@ import google.registry.groups.DirectoryGroupsConnection;
|
||||||
import google.registry.groups.GroupsConnection.Role;
|
import google.registry.groups.GroupsConnection.Role;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarPoc;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.Response;
|
import google.registry.request.Response;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeSleeper;
|
import google.registry.testing.FakeSleeper;
|
||||||
import google.registry.util.Retrier;
|
import google.registry.util.Retrier;
|
||||||
|
@ -51,12 +52,13 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
* Unit tests for {@link SyncGroupMembersAction}.
|
* Unit tests for {@link SyncGroupMembersAction}.
|
||||||
*
|
*
|
||||||
* <p>Note that this relies on the registrars NewRegistrar and TheRegistrar created by default in
|
* <p>Note that this relies on the registrars NewRegistrar and TheRegistrar created by default in
|
||||||
* {@link AppEngineExtension}.
|
* {@link JpaIntegrationTestExtension}.
|
||||||
*/
|
*/
|
||||||
public class SyncGroupMembersActionTest {
|
public class SyncGroupMembersActionTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final DirectoryGroupsConnection connection = mock(DirectoryGroupsConnection.class);
|
private final DirectoryGroupsConnection connection = mock(DirectoryGroupsConnection.class);
|
||||||
private final Response response = mock(Response.class);
|
private final Response response = mock(Response.class);
|
||||||
|
|
|
@ -23,7 +23,6 @@ import static org.mockito.Mockito.verifyNoInteractions;
|
||||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.FakeLockHandler;
|
import google.registry.testing.FakeLockHandler;
|
||||||
import google.registry.testing.FakeResponse;
|
import google.registry.testing.FakeResponse;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@ -31,15 +30,10 @@ import javax.annotation.Nullable;
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Unit tests for {@link SyncRegistrarsSheetAction}. */
|
/** Unit tests for {@link SyncRegistrarsSheetAction}. */
|
||||||
public class SyncRegistrarsSheetActionTest {
|
public class SyncRegistrarsSheetActionTest {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
public final AppEngineExtension appEngine =
|
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
|
||||||
|
|
||||||
private final FakeResponse response = new FakeResponse();
|
private final FakeResponse response = new FakeResponse();
|
||||||
private final SyncRegistrarsSheet syncRegistrarsSheet = mock(SyncRegistrarsSheet.class);
|
private final SyncRegistrarsSheet syncRegistrarsSheet = mock(SyncRegistrarsSheet.class);
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,8 @@ import google.registry.model.common.Cursor;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.model.registrar.RegistrarPoc;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
@ -56,7 +57,8 @@ import org.mockito.junit.jupiter.MockitoExtension;
|
||||||
public class SyncRegistrarsSheetTest {
|
public class SyncRegistrarsSheetTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Captor private ArgumentCaptor<ImmutableList<ImmutableMap<String, String>>> rowsCaptor;
|
@Captor private ArgumentCaptor<ImmutableList<ImmutableMap<String, String>>> rowsCaptor;
|
||||||
@Mock private SheetSynchronizer sheetSynchronizer;
|
@Mock private SheetSynchronizer sheetSynchronizer;
|
||||||
|
@ -73,9 +75,8 @@ public class SyncRegistrarsSheetTest {
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
createTld("example");
|
createTld("example");
|
||||||
// Remove Registrar entities created by AppEngineExtension (and RegistrarContact's, for jpa).
|
// Remove Registrar entities created by JpaTransactionManagerExtension.
|
||||||
tm().transact(() -> tm().loadAllOf(RegistrarPoc.class))
|
tm().transact(() -> tm().loadAllOf(RegistrarPoc.class)).forEach(DatabaseHelper::deleteResource);
|
||||||
.forEach(DatabaseHelper::deleteResource);
|
|
||||||
Registrar.loadAll().forEach(DatabaseHelper::deleteResource);
|
Registrar.loadAll().forEach(DatabaseHelper::deleteResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,8 @@ import google.registry.monitoring.whitebox.CheckApiMetric;
|
||||||
import google.registry.monitoring.whitebox.CheckApiMetric.Availability;
|
import google.registry.monitoring.whitebox.CheckApiMetric.Availability;
|
||||||
import google.registry.monitoring.whitebox.CheckApiMetric.Status;
|
import google.registry.monitoring.whitebox.CheckApiMetric.Status;
|
||||||
import google.registry.monitoring.whitebox.CheckApiMetric.Tier;
|
import google.registry.monitoring.whitebox.CheckApiMetric.Tier;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeResponse;
|
import google.registry.testing.FakeResponse;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -55,7 +56,8 @@ class CheckApiActionTest {
|
||||||
private static final DateTime START_TIME = DateTime.parse("2000-01-01T00:00:00.0Z");
|
private static final DateTime START_TIME = DateTime.parse("2000-01-01T00:00:00.0Z");
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Mock private CheckApiMetrics checkApiMetrics;
|
@Mock private CheckApiMetrics checkApiMetrics;
|
||||||
@Captor private ArgumentCaptor<CheckApiMetric> metricCaptor;
|
@Captor private ArgumentCaptor<CheckApiMetric> metricCaptor;
|
||||||
|
|
|
@ -40,7 +40,8 @@ import google.registry.model.eppoutput.EppResponse;
|
||||||
import google.registry.model.eppoutput.Result;
|
import google.registry.model.eppoutput.Result;
|
||||||
import google.registry.model.eppoutput.Result.Code;
|
import google.registry.model.eppoutput.Result.Code;
|
||||||
import google.registry.monitoring.whitebox.EppMetric;
|
import google.registry.monitoring.whitebox.EppMetric;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.util.Clock;
|
import google.registry.util.Clock;
|
||||||
import google.registry.xml.ValidationMode;
|
import google.registry.xml.ValidationMode;
|
||||||
|
@ -67,7 +68,8 @@ import org.mockito.quality.Strictness;
|
||||||
class EppControllerTest {
|
class EppControllerTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
AppEngineExtension appEngineExtension = new AppEngineExtension.Builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Mock SessionMetadata sessionMetadata;
|
@Mock SessionMetadata sessionMetadata;
|
||||||
@Mock TransportCredentials transportCredentials;
|
@Mock TransportCredentials transportCredentials;
|
||||||
|
|
|
@ -20,7 +20,8 @@ import static google.registry.model.eppoutput.Result.Code.SUCCESS_WITH_NO_MESSAG
|
||||||
import static google.registry.testing.EppMetricSubject.assertThat;
|
import static google.registry.testing.EppMetricSubject.assertThat;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
|
@ -28,8 +29,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
class EppLifecycleContactTest extends EppTestCase {
|
class EppLifecycleContactTest extends EppTestCase {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withClock(clock).withTaskQueue().build();
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testContactLifecycle() throws Exception {
|
void testContactLifecycle() throws Exception {
|
||||||
|
|
|
@ -46,7 +46,9 @@ import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.reporting.HistoryEntry.Type;
|
import google.registry.model.reporting.HistoryEntry.Type;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.Registry.TldState;
|
import google.registry.model.tld.Registry.TldState;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -63,8 +65,10 @@ class EppLifecycleDomainTest extends EppTestCase {
|
||||||
"EXDATE", "2003-06-01T00:04:00Z");
|
"EXDATE", "2003-06-01T00:04:00Z");
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withClock(clock).withTaskQueue().build();
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
|
@RegisterExtension final TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
|
|
|
@ -25,7 +25,9 @@ import static google.registry.testing.HostSubject.assertAboutHosts;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import google.registry.model.domain.Domain;
|
import google.registry.model.domain.Domain;
|
||||||
import google.registry.model.host.Host;
|
import google.registry.model.host.Host;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
@ -34,8 +36,10 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
class EppLifecycleHostTest extends EppTestCase {
|
class EppLifecycleHostTest extends EppTestCase {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withClock(clock).withTaskQueue().build();
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
|
@RegisterExtension final TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testLifecycle() throws Exception {
|
void testLifecycle() throws Exception {
|
||||||
|
|
|
@ -18,7 +18,8 @@ import static google.registry.model.eppoutput.Result.Code.SUCCESS;
|
||||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS_AND_CLOSE;
|
import static google.registry.model.eppoutput.Result.Code.SUCCESS_AND_CLOSE;
|
||||||
import static google.registry.testing.EppMetricSubject.assertThat;
|
import static google.registry.testing.EppMetricSubject.assertThat;
|
||||||
|
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
|
@ -26,8 +27,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
class EppLifecycleLoginTest extends EppTestCase {
|
class EppLifecycleLoginTest extends EppTestCase {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testLoginAndLogout_recordsEppMetric() throws Exception {
|
void testLoginAndLogout_recordsEppMetric() throws Exception {
|
||||||
|
|
|
@ -18,17 +18,12 @@ import static org.joda.time.DateTimeZone.UTC;
|
||||||
import static org.joda.time.format.ISODateTimeFormat.dateTimeNoMillis;
|
import static org.joda.time.format.ISODateTimeFormat.dateTimeNoMillis;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Test flows without login. */
|
/** Test flows without login. */
|
||||||
class EppLoggedOutTest extends EppTestCase {
|
class EppLoggedOutTest extends EppTestCase {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testHello() throws Exception {
|
void testHello() throws Exception {
|
||||||
DateTime now = DateTime.now(UTC);
|
DateTime now = DateTime.now(UTC);
|
||||||
|
|
|
@ -24,7 +24,8 @@ import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.ImmutableSortedMap;
|
import com.google.common.collect.ImmutableSortedMap;
|
||||||
import google.registry.flows.certs.CertificateChecker;
|
import google.registry.flows.certs.CertificateChecker;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.CertificateSamples;
|
import google.registry.testing.CertificateSamples;
|
||||||
import google.registry.testing.SystemPropertyExtension;
|
import google.registry.testing.SystemPropertyExtension;
|
||||||
import google.registry.util.SelfSignedCaCertificate;
|
import google.registry.util.SelfSignedCaCertificate;
|
||||||
|
@ -44,7 +45,8 @@ import org.testcontainers.shaded.org.bouncycastle.util.io.pem.PemWriter;
|
||||||
class EppLoginTlsTest extends EppTestCase {
|
class EppLoginTlsTest extends EppTestCase {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
@Order(value = Integer.MAX_VALUE)
|
@Order(value = Integer.MAX_VALUE)
|
||||||
|
|
|
@ -31,10 +31,12 @@ import com.google.common.collect.Iterables;
|
||||||
import google.registry.flows.EppTestComponent.FakesAndMocksModule;
|
import google.registry.flows.EppTestComponent.FakesAndMocksModule;
|
||||||
import google.registry.model.domain.Domain;
|
import google.registry.model.domain.Domain;
|
||||||
import google.registry.monitoring.whitebox.EppMetric;
|
import google.registry.monitoring.whitebox.EppMetric;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.EppLoader;
|
import google.registry.testing.EppLoader;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeHttpSession;
|
import google.registry.testing.FakeHttpSession;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -46,8 +48,10 @@ class EppPointInTimeTest {
|
||||||
private final FakeClock clock = new FakeClock(DateTime.now(UTC));
|
private final FakeClock clock = new FakeClock(DateTime.now(UTC));
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withClock(clock).withTaskQueue().build();
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
|
@RegisterExtension final TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
private EppLoader eppLoader;
|
private EppLoader eppLoader;
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
package google.registry.flows;
|
package google.registry.flows;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
|
@ -23,7 +24,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
class EppXxeAttackTest extends EppTestCase {
|
class EppXxeAttackTest extends EppTestCase {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testRemoteXmlExternalEntity() throws Exception {
|
void testRemoteXmlExternalEntity() throws Exception {
|
||||||
|
|
|
@ -34,19 +34,14 @@ import google.registry.model.domain.superuser.DomainTransferRequestSuperuserExte
|
||||||
import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension;
|
import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension;
|
||||||
import google.registry.model.eppinput.EppInput;
|
import google.registry.model.eppinput.EppInput;
|
||||||
import google.registry.model.eppinput.EppInput.CommandExtension;
|
import google.registry.model.eppinput.EppInput.CommandExtension;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.util.JdkLoggerConfig;
|
import google.registry.util.JdkLoggerConfig;
|
||||||
import google.registry.util.TypeUtils;
|
import google.registry.util.TypeUtils;
|
||||||
import java.util.logging.LogRecord;
|
import java.util.logging.LogRecord;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Unit tests for {@link ExtensionManager}. */
|
/** Unit tests for {@link ExtensionManager}. */
|
||||||
class ExtensionManagerTest {
|
class ExtensionManagerTest {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testDuplicateExtensionsForbidden() {
|
void testDuplicateExtensionsForbidden() {
|
||||||
ExtensionManager manager =
|
ExtensionManager manager =
|
||||||
|
@ -245,7 +240,8 @@ class ExtensionManagerTest {
|
||||||
@Override
|
@Override
|
||||||
public ImmutableList<CommandExtension> getExtensions() {
|
public ImmutableList<CommandExtension> getExtensions() {
|
||||||
return suppliedExtensions;
|
return suppliedExtensions;
|
||||||
}};
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,8 @@ import google.registry.model.eppcommon.Trid;
|
||||||
import google.registry.model.eppoutput.EppOutput.ResponseOrGreeting;
|
import google.registry.model.eppoutput.EppOutput.ResponseOrGreeting;
|
||||||
import google.registry.model.eppoutput.EppResponse;
|
import google.registry.model.eppoutput.EppResponse;
|
||||||
import google.registry.monitoring.whitebox.EppMetric;
|
import google.registry.monitoring.whitebox.EppMetric;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeHttpSession;
|
import google.registry.testing.FakeHttpSession;
|
||||||
import google.registry.util.JdkLoggerConfig;
|
import google.registry.util.JdkLoggerConfig;
|
||||||
|
@ -51,8 +52,8 @@ import org.mockito.Mockito;
|
||||||
class FlowRunnerTest {
|
class FlowRunnerTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngineExtension =
|
final JpaIntegrationTestExtension jpa =
|
||||||
new AppEngineExtension.Builder().withCloudSql().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final FlowRunner flowRunner = new FlowRunner();
|
private final FlowRunner flowRunner = new FlowRunner();
|
||||||
private final EppMetric.Builder eppMetricBuilder = EppMetric.builderForRequest(new FakeClock());
|
private final EppMetric.Builder eppMetricBuilder = EppMetric.builderForRequest(new FakeClock());
|
||||||
|
|
|
@ -41,7 +41,8 @@ import google.registry.model.eppinput.EppInput;
|
||||||
import google.registry.model.eppoutput.EppOutput;
|
import google.registry.model.eppoutput.EppOutput;
|
||||||
import google.registry.model.reporting.HistoryEntryDao;
|
import google.registry.model.reporting.HistoryEntryDao;
|
||||||
import google.registry.monitoring.whitebox.EppMetric;
|
import google.registry.monitoring.whitebox.EppMetric;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.CloudTasksHelper;
|
import google.registry.testing.CloudTasksHelper;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.EppLoader;
|
import google.registry.testing.EppLoader;
|
||||||
|
@ -87,8 +88,8 @@ public abstract class FlowTestCase<F extends Flow> {
|
||||||
private EppMetric.Builder eppMetricBuilder;
|
private EppMetric.Builder eppMetricBuilder;
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withClock(clock).withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void beforeEachFlowTestCase() {
|
public void beforeEachFlowTestCase() {
|
||||||
|
|
|
@ -31,7 +31,8 @@ import google.registry.flows.TlsCredentials.MissingRegistrarCertificateException
|
||||||
import google.registry.flows.TlsCredentials.RegistrarCertificateNotConfiguredException;
|
import google.registry.flows.TlsCredentials.RegistrarCertificateNotConfiguredException;
|
||||||
import google.registry.flows.certs.CertificateChecker;
|
import google.registry.flows.certs.CertificateChecker;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.util.CidrAddressBlock;
|
import google.registry.util.CidrAddressBlock;
|
||||||
import google.registry.util.ProxyHttpHeaders;
|
import google.registry.util.ProxyHttpHeaders;
|
||||||
|
@ -45,9 +46,10 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
final class TlsCredentialsTest {
|
final class TlsCredentialsTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
protected final FakeClock clock = new FakeClock();
|
private final FakeClock clock = new FakeClock();
|
||||||
|
|
||||||
private final CertificateChecker certificateChecker =
|
private final CertificateChecker certificateChecker =
|
||||||
new CertificateChecker(
|
new CertificateChecker(
|
||||||
|
|
|
@ -25,7 +25,7 @@ import google.registry.model.EppResource;
|
||||||
import google.registry.model.contact.Contact;
|
import google.registry.model.contact.Contact;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTransactionManagerExtension;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -59,7 +59,10 @@ abstract class ContactTransferFlowTestCase<F extends Flow, R extends EppResource
|
||||||
// Registrar ClientZ is used in tests that need another registrar that definitely doesn't own
|
// Registrar ClientZ is used in tests that need another registrar that definitely doesn't own
|
||||||
// the resources in question.
|
// the resources in question.
|
||||||
persistResource(
|
persistResource(
|
||||||
AppEngineExtension.makeRegistrar1().asBuilder().setRegistrarId("ClientZ").build());
|
JpaTransactionManagerExtension.makeRegistrar1()
|
||||||
|
.asBuilder()
|
||||||
|
.setRegistrarId("ClientZ")
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds a contact that has a pending transfer on it from TheRegistrar to NewRegistrar. */
|
/** Adds a contact that has a pending transfer on it from TheRegistrar to NewRegistrar. */
|
||||||
|
|
|
@ -178,6 +178,7 @@ import google.registry.model.tld.Registry.TldType;
|
||||||
import google.registry.monitoring.whitebox.EppMetric;
|
import google.registry.monitoring.whitebox.EppMetric;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -188,10 +189,13 @@ import org.joda.time.DateTime;
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link DomainCreateFlow}. */
|
/** Unit tests for {@link DomainCreateFlow}. */
|
||||||
class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain> {
|
class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain> {
|
||||||
|
|
||||||
|
@RegisterExtension TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
private static final String CLAIMS_KEY = "2013041500/2/6/9/rJ1NrDO92vDsAzf7EQzgjX4R0000000001";
|
private static final String CLAIMS_KEY = "2013041500/2/6/9/rJ1NrDO92vDsAzf7EQzgjX4R0000000001";
|
||||||
|
|
||||||
private AllocationToken allocationToken;
|
private AllocationToken allocationToken;
|
||||||
|
|
|
@ -101,16 +101,20 @@ import google.registry.model.transfer.TransferResponse;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link DomainDeleteFlow}. */
|
/** Unit tests for {@link DomainDeleteFlow}. */
|
||||||
class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain> {
|
class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain> {
|
||||||
|
|
||||||
|
@RegisterExtension final TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
private Domain domain;
|
private Domain domain;
|
||||||
private DomainHistory earlierHistoryEntry;
|
private DomainHistory earlierHistoryEntry;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import google.registry.flows.domain.DomainFlowUtils.TldDoesNotExistException;
|
||||||
import google.registry.flows.domain.DomainFlowUtils.TrailingDashException;
|
import google.registry.flows.domain.DomainFlowUtils.TrailingDashException;
|
||||||
import google.registry.model.domain.Domain;
|
import google.registry.model.domain.Domain;
|
||||||
import google.registry.model.tld.Registry.TldType;
|
import google.registry.model.tld.Registry.TldType;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTransactionManagerExtension;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -51,7 +51,7 @@ class DomainFlowUtilsTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
|
||||||
void setup() {
|
void setup() {
|
||||||
setEppInput("domain_info.xml");
|
setEppInput("domain_info.xml");
|
||||||
createTld("tld");
|
createTld("tld");
|
||||||
persistResource(AppEngineExtension.makeRegistrar1().asBuilder().build());
|
persistResource(JpaTransactionManagerExtension.makeRegistrar1().asBuilder().build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -74,7 +74,7 @@ import google.registry.model.host.Host;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTransactionManagerExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.xml.ValidationMode;
|
import google.registry.xml.ValidationMode;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -115,7 +115,10 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
|
||||||
sessionMetadata.setRegistrarId("NewRegistrar");
|
sessionMetadata.setRegistrarId("NewRegistrar");
|
||||||
createTld("tld");
|
createTld("tld");
|
||||||
persistResource(
|
persistResource(
|
||||||
AppEngineExtension.makeRegistrar1().asBuilder().setRegistrarId("ClientZ").build());
|
JpaTransactionManagerExtension.makeRegistrar1()
|
||||||
|
.asBuilder()
|
||||||
|
.setRegistrarId("ClientZ")
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void persistTestEntities(String domainName, boolean inactive) {
|
private void persistTestEntities(String domainName, boolean inactive) {
|
||||||
|
|
|
@ -46,7 +46,8 @@ import google.registry.model.domain.DomainHistory;
|
||||||
import google.registry.model.domain.fee.Fee;
|
import google.registry.model.domain.fee.Fee;
|
||||||
import google.registry.model.eppinput.EppInput;
|
import google.registry.model.eppinput.EppInput;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeHttpSession;
|
import google.registry.testing.FakeHttpSession;
|
||||||
|
@ -65,7 +66,8 @@ public class DomainPricingLogicTest {
|
||||||
DomainPricingLogic domainPricingLogic;
|
DomainPricingLogic domainPricingLogic;
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Inject Clock clock = new FakeClock(DateTime.now(UTC));
|
@Inject Clock clock = new FakeClock(DateTime.now(UTC));
|
||||||
@Mock EppInput eppInput;
|
@Mock EppInput eppInput;
|
||||||
|
|
|
@ -75,16 +75,20 @@ import google.registry.model.reporting.DomainTransactionRecord.TransactionReport
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link DomainRestoreRequestFlow}. */
|
/** Unit tests for {@link DomainRestoreRequestFlow}. */
|
||||||
class DomainRestoreRequestFlowTest extends ResourceFlowTestCase<DomainRestoreRequestFlow, Domain> {
|
class DomainRestoreRequestFlowTest extends ResourceFlowTestCase<DomainRestoreRequestFlow, Domain> {
|
||||||
|
|
||||||
|
@RegisterExtension final TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
private static final ImmutableMap<String, String> FEE_06_MAP =
|
private static final ImmutableMap<String, String> FEE_06_MAP =
|
||||||
ImmutableMap.of("FEE_VERSION", "0.6", "FEE_NS", "fee", "CURRENCY", "USD");
|
ImmutableMap.of("FEE_VERSION", "0.6", "FEE_NS", "fee", "CURRENCY", "USD");
|
||||||
private static final ImmutableMap<String, String> FEE_11_MAP =
|
private static final ImmutableMap<String, String> FEE_11_MAP =
|
||||||
|
|
|
@ -44,7 +44,7 @@ import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.transfer.TransferData;
|
import google.registry.model.transfer.TransferData;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTransactionManagerExtension;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -86,7 +86,10 @@ abstract class DomainTransferFlowTestCase<F extends Flow, R extends EppResource>
|
||||||
// Registrar ClientZ is used in tests that need another registrar that definitely doesn't own
|
// Registrar ClientZ is used in tests that need another registrar that definitely doesn't own
|
||||||
// the resources in question.
|
// the resources in question.
|
||||||
persistResource(
|
persistResource(
|
||||||
AppEngineExtension.makeRegistrar1().asBuilder().setRegistrarId("ClientZ").build());
|
JpaTransactionManagerExtension.makeRegistrar1()
|
||||||
|
.asBuilder()
|
||||||
|
.setRegistrarId("ClientZ")
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
static Domain persistWithPendingTransfer(Domain domain) {
|
static Domain persistWithPendingTransfer(Domain domain) {
|
||||||
|
|
|
@ -106,15 +106,19 @@ import google.registry.model.poll.PollMessage;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link DomainUpdateFlow}. */
|
/** Unit tests for {@link DomainUpdateFlow}. */
|
||||||
class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain> {
|
class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain> {
|
||||||
|
|
||||||
|
@RegisterExtension final TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
private static final DomainDsData SOME_DSDATA =
|
private static final DomainDsData SOME_DSDATA =
|
||||||
DomainDsData.create(
|
DomainDsData.create(
|
||||||
1,
|
1,
|
||||||
|
|
|
@ -49,7 +49,8 @@ import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||||
import google.registry.model.domain.token.AllocationTokenExtension;
|
import google.registry.model.domain.token.AllocationTokenExtension;
|
||||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
@ -64,7 +65,8 @@ class AllocationTokenFlowUtilsTest {
|
||||||
new AllocationTokenFlowUtils(new AllocationTokenCustomLogic());
|
new AllocationTokenFlowUtils(new AllocationTokenCustomLogic());
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final AllocationTokenExtension allocationTokenExtension =
|
private final AllocationTokenExtension allocationTokenExtension =
|
||||||
mock(AllocationTokenExtension.class);
|
mock(AllocationTokenExtension.class);
|
||||||
|
|
|
@ -54,12 +54,16 @@ import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.Host;
|
import google.registry.model.host.Host;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link HostCreateFlow}. */
|
/** Unit tests for {@link HostCreateFlow}. */
|
||||||
class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Host> {
|
class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Host> {
|
||||||
|
|
||||||
|
@RegisterExtension TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
private void setEppHostCreateInput(String hostName, String hostAddrs) {
|
private void setEppHostCreateInput(String hostName, String hostAddrs) {
|
||||||
setEppInput(
|
setEppInput(
|
||||||
"host_create.xml",
|
"host_create.xml",
|
||||||
|
|
|
@ -48,13 +48,17 @@ import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.transfer.DomainTransferData;
|
import google.registry.model.transfer.DomainTransferData;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link HostDeleteFlow}. */
|
/** Unit tests for {@link HostDeleteFlow}. */
|
||||||
class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Host> {
|
class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Host> {
|
||||||
|
|
||||||
|
@RegisterExtension TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void initFlowTest() {
|
void initFlowTest() {
|
||||||
setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld"));
|
setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld"));
|
||||||
|
|
|
@ -25,7 +25,8 @@ import google.registry.flows.host.HostFlowUtils.HostNameNotPunyCodedException;
|
||||||
import google.registry.flows.host.HostFlowUtils.HostNameTooLongException;
|
import google.registry.flows.host.HostFlowUtils.HostNameTooLongException;
|
||||||
import google.registry.flows.host.HostFlowUtils.HostNameTooShallowException;
|
import google.registry.flows.host.HostFlowUtils.HostNameTooShallowException;
|
||||||
import google.registry.flows.host.HostFlowUtils.InvalidHostNameException;
|
import google.registry.flows.host.HostFlowUtils.InvalidHostNameException;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
|
@ -33,7 +34,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
class HostFlowUtilsTest {
|
class HostFlowUtilsTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void test_validExternalHostName_validates() throws Exception {
|
void test_validExternalHostName_validates() throws Exception {
|
||||||
|
|
|
@ -81,13 +81,17 @@ import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
import google.registry.testing.CloudTasksHelper.TaskMatcher;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
|
import google.registry.testing.TaskQueueExtension;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link HostUpdateFlow}. */
|
/** Unit tests for {@link HostUpdateFlow}. */
|
||||||
class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Host> {
|
class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Host> {
|
||||||
|
|
||||||
|
@RegisterExtension TaskQueueExtension taskQueue = new TaskQueueExtension();
|
||||||
|
|
||||||
private void setEppHostUpdateInput(
|
private void setEppHostUpdateInput(
|
||||||
String oldHostName, String newHostName, String ipOrStatusToAdd, String ipOrStatusToRem) {
|
String oldHostName, String newHostName, String ipOrStatusToAdd, String ipOrStatusToRem) {
|
||||||
setEppInput(
|
setEppInput(
|
||||||
|
|
|
@ -16,9 +16,13 @@ package google.registry.model;
|
||||||
|
|
||||||
import static org.joda.time.DateTimeZone.UTC;
|
import static org.joda.time.DateTimeZone.UTC;
|
||||||
|
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaEntityCoverageExtension;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
import org.junit.jupiter.api.Order;
|
||||||
|
import org.junit.jupiter.api.extension.ExtensionContext;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Base class of all unit tests for entities which are persisted to SQL. */
|
/** Base class of all unit tests for entities which are persisted to SQL. */
|
||||||
|
@ -36,18 +40,29 @@ public abstract class EntityTestCase {
|
||||||
|
|
||||||
protected FakeClock fakeClock = new FakeClock(DateTime.now(UTC));
|
protected FakeClock fakeClock = new FakeClock(DateTime.now(UTC));
|
||||||
|
|
||||||
@RegisterExtension public final AppEngineExtension appEngine;
|
@Order(Order.DEFAULT)
|
||||||
|
@RegisterExtension
|
||||||
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().withClock(fakeClock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
|
@Order(Order.DEFAULT + 1)
|
||||||
|
@RegisterExtension
|
||||||
|
final JpaEntityCoverageExtension coverage;
|
||||||
|
|
||||||
protected EntityTestCase() {
|
protected EntityTestCase() {
|
||||||
this(JpaEntityCoverageCheck.DISABLED);
|
this(JpaEntityCoverageCheck.DISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntityTestCase(JpaEntityCoverageCheck jpaEntityCoverageCheck) {
|
protected EntityTestCase(JpaEntityCoverageCheck jpaEntityCoverageCheck) {
|
||||||
appEngine =
|
coverage =
|
||||||
AppEngineExtension.builder()
|
jpaEntityCoverageCheck == JpaEntityCoverageCheck.ENABLED
|
||||||
.withCloudSql()
|
? new JpaEntityCoverageExtension()
|
||||||
.enableJpaEntityCoverageCheck(jpaEntityCoverageCheck == JpaEntityCoverageCheck.ENABLED)
|
: new JpaEntityCoverageExtension() {
|
||||||
.withClock(fakeClock)
|
@Override
|
||||||
.build();
|
public void beforeEach(ExtensionContext context) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterEach(ExtensionContext context) {}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,8 @@ import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||||
import static org.joda.time.DateTimeZone.UTC;
|
import static org.joda.time.DateTimeZone.UTC;
|
||||||
|
|
||||||
import google.registry.model.host.Host;
|
import google.registry.model.host.Host;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.joda.time.Duration;
|
import org.joda.time.Duration;
|
||||||
|
@ -37,8 +38,8 @@ class EppResourceUtilsTest {
|
||||||
private final FakeClock clock = new FakeClock(DateTime.now(UTC));
|
private final FakeClock clock = new FakeClock(DateTime.now(UTC));
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withClock(clock).withTaskQueue().build();
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
|
|
|
@ -26,7 +26,8 @@ import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaUnitTestExtension;
|
||||||
import google.registry.util.CidrAddressBlock;
|
import google.registry.util.CidrAddressBlock;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
|
@ -46,11 +47,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class ImmutableObjectTest {
|
public class ImmutableObjectTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaUnitTestExtension jpa =
|
||||||
AppEngineExtension.builder()
|
new JpaTestExtensions.Builder().withEntityClass(ValueObject.class).buildUnitTestExtension();
|
||||||
.withCloudSql()
|
|
||||||
.withJpaUnitTestEntities(ValueObject.class)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
/** Simple subclass of ImmutableObject. */
|
/** Simple subclass of ImmutableObject. */
|
||||||
public static class SimpleObject extends ImmutableObject {
|
public static class SimpleObject extends ImmutableObject {
|
||||||
|
|
|
@ -17,19 +17,14 @@ package google.registry.model;
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Unit tests for {@link ModelUtils}. */
|
/** Unit tests for {@link ModelUtils}. */
|
||||||
public class ModelUtilsTest {
|
public class ModelUtilsTest {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
public AppEngineExtension appEngineExtension = new AppEngineExtension.Builder().build();
|
|
||||||
|
|
||||||
/** Test class for reflection methods. */
|
/** Test class for reflection methods. */
|
||||||
public static class TestClass extends ImmutableObject implements Buildable {
|
public static class TestClass extends ImmutableObject implements Buildable {
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||||
import static com.google.common.truth.Truth8.assertThat;
|
import static com.google.common.truth.Truth8.assertThat;
|
||||||
import static google.registry.model.tld.Registry.TldState.GENERAL_AVAILABILITY;
|
import static google.registry.model.tld.Registry.TldState.GENERAL_AVAILABILITY;
|
||||||
import static google.registry.model.tld.Registry.TldState.START_DATE_SUNRISE;
|
import static google.registry.model.tld.Registry.TldState.START_DATE_SUNRISE;
|
||||||
import static google.registry.testing.AppEngineExtension.makeRegistrar1;
|
import static google.registry.persistence.transaction.JpaTransactionManagerExtension.makeRegistrar1;
|
||||||
import static google.registry.testing.CertificateSamples.SAMPLE_CERT;
|
import static google.registry.testing.CertificateSamples.SAMPLE_CERT;
|
||||||
import static google.registry.testing.CertificateSamples.SAMPLE_CERT_HASH;
|
import static google.registry.testing.CertificateSamples.SAMPLE_CERT_HASH;
|
||||||
import static google.registry.testing.DatabaseHelper.createTld;
|
import static google.registry.testing.DatabaseHelper.createTld;
|
||||||
|
@ -33,7 +33,8 @@ import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarPoc;
|
import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.Registry.TldState;
|
import google.registry.model.tld.Registry.TldState;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.util.CidrAddressBlock;
|
import google.registry.util.CidrAddressBlock;
|
||||||
import google.registry.util.SystemClock;
|
import google.registry.util.SystemClock;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
|
@ -47,7 +48,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public final class OteAccountBuilderTest {
|
public final class OteAccountBuilderTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testGetRegistrarToTldMap() {
|
void testGetRegistrarToTldMap() {
|
||||||
|
|
|
@ -18,7 +18,8 @@ import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.testing.DatabaseHelper.createTld;
|
import static google.registry.testing.DatabaseHelper.createTld;
|
||||||
|
|
||||||
import google.registry.model.OteStats.StatType;
|
import google.registry.model.OteStats.StatType;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
@ -26,7 +27,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public final class OteStatsTest {
|
public final class OteStatsTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
|
|
|
@ -28,18 +28,12 @@ import google.registry.model.eppoutput.EppOutput;
|
||||||
import google.registry.model.eppoutput.EppResponse;
|
import google.registry.model.eppoutput.EppResponse;
|
||||||
import google.registry.model.host.HostCommand;
|
import google.registry.model.host.HostCommand;
|
||||||
import google.registry.model.host.HostInfoData;
|
import google.registry.model.host.HostInfoData;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.EppLoader;
|
import google.registry.testing.EppLoader;
|
||||||
import google.registry.xml.ValidationMode;
|
import google.registry.xml.ValidationMode;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
public class StatusValueAdapterTest {
|
public class StatusValueAdapterTest {
|
||||||
|
|
||||||
// Needed to create Hosts.
|
|
||||||
@RegisterExtension
|
|
||||||
public AppEngineExtension appEngine = new AppEngineExtension.Builder().withCloudSql().build();
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testMarshalling() throws Exception {
|
void testMarshalling() throws Exception {
|
||||||
// Mangle the status value through marshalling by stuffing it in a host info response and then
|
// Mangle the status value through marshalling by stuffing it in a host info response and then
|
||||||
|
|
|
@ -25,17 +25,12 @@ import com.google.common.collect.ImmutableList;
|
||||||
import google.registry.model.contact.ContactCommand.Update;
|
import google.registry.model.contact.ContactCommand.Update;
|
||||||
import google.registry.model.contact.ContactCommand.Update.Change;
|
import google.registry.model.contact.ContactCommand.Update.Change;
|
||||||
import google.registry.model.eppinput.EppInput.ResourceCommandWrapper;
|
import google.registry.model.eppinput.EppInput.ResourceCommandWrapper;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.EppLoader;
|
import google.registry.testing.EppLoader;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Test xml roundtripping of commands. */
|
/** Test xml roundtripping of commands. */
|
||||||
public class ContactCommandTest {
|
public class ContactCommandTest {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
|
||||||
|
|
||||||
private void doXmlRoundtripTest(String inputFilename) throws Exception {
|
private void doXmlRoundtripTest(String inputFilename) throws Exception {
|
||||||
EppLoader eppLoader = new EppLoader(this, inputFilename);
|
EppLoader eppLoader = new EppLoader(this, inputFilename);
|
||||||
// JAXB can unmarshal a "name" or an "id" into the "targetId" field, but when marshaling it
|
// JAXB can unmarshal a "name" or an "id" into the "targetId" field, but when marshaling it
|
||||||
|
|
|
@ -47,7 +47,8 @@ import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.Host;
|
import google.registry.model.host.Host;
|
||||||
import google.registry.model.transfer.ContactTransferData;
|
import google.registry.model.transfer.ContactTransferData;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationWithCoverageExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.util.SerializeUtils;
|
import google.registry.util.SerializeUtils;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -63,12 +64,8 @@ public class DomainSqlTest {
|
||||||
protected FakeClock fakeClock = new FakeClock(DateTime.now(UTC));
|
protected FakeClock fakeClock = new FakeClock(DateTime.now(UTC));
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationWithCoverageExtension jpa =
|
||||||
AppEngineExtension.builder()
|
new JpaTestExtensions.Builder().withClock(fakeClock).buildIntegrationWithCoverageExtension();
|
||||||
.withCloudSql()
|
|
||||||
.enableJpaEntityCoverageCheck(true)
|
|
||||||
.withClock(fakeClock)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
private Domain domain;
|
private Domain domain;
|
||||||
private VKey<Contact> contactKey;
|
private VKey<Contact> contactKey;
|
||||||
|
|
|
@ -65,7 +65,8 @@ import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.transfer.DomainTransferData;
|
import google.registry.model.transfer.DomainTransferData;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationWithCoverageExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@ -82,12 +83,8 @@ public class DomainTest {
|
||||||
protected FakeClock fakeClock = new FakeClock(DateTime.now(UTC));
|
protected FakeClock fakeClock = new FakeClock(DateTime.now(UTC));
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationWithCoverageExtension jpa =
|
||||||
AppEngineExtension.builder()
|
new JpaTestExtensions.Builder().withClock(fakeClock).buildIntegrationWithCoverageExtension();
|
||||||
.withCloudSql()
|
|
||||||
.enableJpaEntityCoverageCheck(true)
|
|
||||||
.withClock(fakeClock)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
private Domain domain;
|
private Domain domain;
|
||||||
private VKey<BillingEvent.OneTime> oneTimeBillKey;
|
private VKey<BillingEvent.OneTime> oneTimeBillKey;
|
||||||
|
|
|
@ -24,7 +24,8 @@ import google.registry.model.billing.BillingEvent.Recurring;
|
||||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import org.joda.money.CurrencyUnit;
|
import org.joda.money.CurrencyUnit;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
@ -36,10 +37,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class GracePeriodTest {
|
public class GracePeriodTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder()
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
.withCloudSql() // Needed to be able to construct Keys.
|
|
||||||
.build();
|
|
||||||
|
|
||||||
private final DateTime now = DateTime.now(UTC);
|
private final DateTime now = DateTime.now(UTC);
|
||||||
private BillingEvent.OneTime onetime;
|
private BillingEvent.OneTime onetime;
|
||||||
|
|
|
@ -31,7 +31,8 @@ import google.registry.model.eppcommon.Trid;
|
||||||
import google.registry.model.poll.PollMessageExternalKeyConverter.PollMessageExternalKeyParseException;
|
import google.registry.model.poll.PollMessageExternalKeyConverter.PollMessageExternalKeyParseException;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
@ -43,7 +44,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class PollMessageExternalKeyConverterTest {
|
public class PollMessageExternalKeyConverterTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private HistoryEntry historyEntry;
|
private HistoryEntry historyEntry;
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("2007-07-07T01:01:01Z"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("2007-07-07T01:01:01Z"));
|
||||||
|
|
|
@ -20,7 +20,8 @@ import static org.joda.time.Duration.standardDays;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -30,7 +31,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class SignedMarkRevocationListTest {
|
public class SignedMarkRevocationListTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("2013-01-01T00:00:00Z"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("2013-01-01T00:00:00Z"));
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
import com.google.common.net.InternetDomainName;
|
import com.google.common.net.InternetDomainName;
|
||||||
import google.registry.model.tld.Registry.TldType;
|
import google.registry.model.tld.Registry.TldType;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
|
@ -31,7 +32,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
class RegistriesTest {
|
class RegistriesTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private void initTestTlds() {
|
private void initTestTlds() {
|
||||||
createTlds("foo", "a.b.c"); // Test a multipart tld.
|
createTlds("foo", "a.b.c"); // Test a multipart tld.
|
||||||
|
|
|
@ -21,11 +21,9 @@ import com.google.common.flogger.FluentLogger;
|
||||||
import com.google.common.io.Resources;
|
import com.google.common.io.Resources;
|
||||||
import com.google.common.reflect.ClassPath;
|
import com.google.common.reflect.ClassPath;
|
||||||
import com.google.common.reflect.ClassPath.ResourceInfo;
|
import com.google.common.reflect.ClassPath.ResourceInfo;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Presubmit tests for {@link PremiumList} configuration files. */
|
/** Presubmit tests for {@link PremiumList} configuration files. */
|
||||||
class GenrulePremiumListTest {
|
class GenrulePremiumListTest {
|
||||||
|
@ -33,9 +31,6 @@ class GenrulePremiumListTest {
|
||||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||||
private static final String LISTS_DIRECTORY = "google/registry/config/files/premium/";
|
private static final String LISTS_DIRECTORY = "google/registry/config/files/premium/";
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testParse_allPremiumLists() throws Exception {
|
void testParse_allPremiumLists() throws Exception {
|
||||||
ClassPath classpath = ClassPath.from(getClass().getClassLoader());
|
ClassPath classpath = ClassPath.from(getClass().getClassLoader());
|
||||||
|
|
|
@ -21,11 +21,9 @@ import com.google.common.flogger.FluentLogger;
|
||||||
import com.google.common.io.Resources;
|
import com.google.common.io.Resources;
|
||||||
import com.google.common.reflect.ClassPath;
|
import com.google.common.reflect.ClassPath;
|
||||||
import com.google.common.reflect.ClassPath.ResourceInfo;
|
import com.google.common.reflect.ClassPath.ResourceInfo;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Presubmit tests for {@link ReservedList} configuration files. */
|
/** Presubmit tests for {@link ReservedList} configuration files. */
|
||||||
class GenruleReservedListTest {
|
class GenruleReservedListTest {
|
||||||
|
@ -33,9 +31,6 @@ class GenruleReservedListTest {
|
||||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||||
private static final String LISTS_DIRECTORY = "google/registry/config/files/reserved/";
|
private static final String LISTS_DIRECTORY = "google/registry/config/files/reserved/";
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testParse_allReservedLists() throws Exception {
|
void testParse_allReservedLists() throws Exception {
|
||||||
ClassPath classpath = ClassPath.from(getClass().getClassLoader());
|
ClassPath classpath = ClassPath.from(getClass().getClassLoader());
|
||||||
|
|
|
@ -28,7 +28,8 @@ import com.google.common.base.Stopwatch;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.flogger.FluentLogger;
|
import com.google.common.flogger.FluentLogger;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationWithCoverageExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.TestCacheExtension;
|
import google.registry.testing.TestCacheExtension;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
@ -50,12 +51,8 @@ public class PremiumListDaoTest {
|
||||||
private final FakeClock fakeClock = new FakeClock();
|
private final FakeClock fakeClock = new FakeClock();
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine =
|
final JpaIntegrationWithCoverageExtension jpa =
|
||||||
AppEngineExtension.builder()
|
new JpaTestExtensions.Builder().withClock(fakeClock).buildIntegrationWithCoverageExtension();
|
||||||
.withCloudSql()
|
|
||||||
.enableJpaEntityCoverageCheck(true)
|
|
||||||
.withClock(fakeClock)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
// Set long persist times on caches so they can be tested (cache times default to 0 in tests).
|
// Set long persist times on caches so they can be tested (cache times default to 0 in tests).
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
|
|
|
@ -29,7 +29,8 @@ import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.hash.BloomFilter;
|
import com.google.common.hash.BloomFilter;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.label.PremiumList.PremiumEntry;
|
import google.registry.model.tld.label.PremiumList.PremiumEntry;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -40,7 +41,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class PremiumListTest {
|
public class PremiumListTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void before() {
|
void before() {
|
||||||
|
|
|
@ -20,17 +20,12 @@ import static org.joda.money.CurrencyUnit.USD;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Unit tests for {@link PremiumListUtils}. */
|
/** Unit tests for {@link PremiumListUtils}. */
|
||||||
class PremiumListUtilsTest {
|
class PremiumListUtilsTest {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void parseInputToPremiumList_works() {
|
void parseInputToPremiumList_works() {
|
||||||
PremiumList premiumList =
|
PremiumList premiumList =
|
||||||
|
|
|
@ -34,7 +34,8 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -47,8 +48,8 @@ class ReservedListTest {
|
||||||
private FakeClock clock = new FakeClock(DateTime.parse("2010-01-01T10:00:00Z"));
|
private FakeClock clock = new FakeClock(DateTime.parse("2010-01-01T10:00:00Z"));
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withClock(clock).withCloudSql().build();
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
|
|
|
@ -26,18 +26,13 @@ import google.registry.model.domain.Period;
|
||||||
import google.registry.model.eppcommon.Trid;
|
import google.registry.model.eppcommon.Trid;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Unit tests for {@link TransferData}. */
|
/** Unit tests for {@link TransferData}. */
|
||||||
public class TransferDataTest {
|
public class TransferDataTest {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
|
||||||
|
|
||||||
private final DateTime now = DateTime.now(UTC);
|
private final DateTime now = DateTime.now(UTC);
|
||||||
|
|
||||||
private VKey<BillingEvent.OneTime> transferBillingEventKey;
|
private VKey<BillingEvent.OneTime> transferBillingEventKey;
|
||||||
|
|
|
@ -18,19 +18,13 @@ import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Unit tests for {@link BackendServlet}. */
|
/** Unit tests for {@link BackendServlet}. */
|
||||||
class BackendServletTest {
|
class BackendServletTest {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
final AppEngineExtension appEngine =
|
|
||||||
AppEngineExtension.builder().withCloudSql().withLocalModules().build();
|
|
||||||
|
|
||||||
private final HttpServletRequest req = mock(HttpServletRequest.class);
|
private final HttpServletRequest req = mock(HttpServletRequest.class);
|
||||||
private final HttpServletResponse rsp = mock(HttpServletResponse.class);
|
private final HttpServletResponse rsp = mock(HttpServletResponse.class);
|
||||||
|
|
||||||
|
|
|
@ -18,19 +18,13 @@ import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Unit tests for {@link FrontendServlet}. */
|
/** Unit tests for {@link FrontendServlet}. */
|
||||||
class FrontendServletTest {
|
class FrontendServletTest {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
final AppEngineExtension appEngine =
|
|
||||||
AppEngineExtension.builder().withCloudSql().withLocalModules().build();
|
|
||||||
|
|
||||||
private final HttpServletRequest req = mock(HttpServletRequest.class);
|
private final HttpServletRequest req = mock(HttpServletRequest.class);
|
||||||
private final HttpServletResponse rsp = mock(HttpServletResponse.class);
|
private final HttpServletResponse rsp = mock(HttpServletResponse.class);
|
||||||
|
|
||||||
|
|
|
@ -18,19 +18,13 @@ import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** Unit tests for {@link PubApiServlet}. */
|
/** Unit tests for {@link PubApiServlet}. */
|
||||||
class PubApiServletTest {
|
class PubApiServletTest {
|
||||||
|
|
||||||
@RegisterExtension
|
|
||||||
final AppEngineExtension appEngine =
|
|
||||||
AppEngineExtension.builder().withCloudSql().withLocalModules().build();
|
|
||||||
|
|
||||||
private final HttpServletRequest req = mock(HttpServletRequest.class);
|
private final HttpServletRequest req = mock(HttpServletRequest.class);
|
||||||
private final HttpServletResponse rsp = mock(HttpServletResponse.class);
|
private final HttpServletResponse rsp = mock(HttpServletResponse.class);
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,8 @@ import static google.registry.testing.DatabaseHelper.createTld;
|
||||||
import static google.registry.testing.DatabaseHelper.createTlds;
|
import static google.registry.testing.DatabaseHelper.createTlds;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
@ -28,7 +29,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
class EppMetricTest {
|
class EppMetricTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void test_invalidTld_isRecordedAsInvalid() {
|
void test_invalidTld_isRecordedAsInvalid() {
|
||||||
|
|
|
@ -22,7 +22,8 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.net.InetAddresses;
|
import com.google.common.net.InetAddresses;
|
||||||
import google.registry.model.ImmutableObject;
|
import google.registry.model.ImmutableObject;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaUnitTestExtension;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
@ -35,11 +36,10 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class InetAddressSetConverterTest {
|
public class InetAddressSetConverterTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
public final JpaUnitTestExtension jpa =
|
||||||
AppEngineExtension.builder()
|
new JpaTestExtensions.Builder()
|
||||||
.withCloudSql()
|
.withEntityClass(InetAddressSetTestEntity.class)
|
||||||
.withJpaUnitTestEntities(InetAddressSetTestEntity.class)
|
.buildUnitTestExtension();
|
||||||
.build();
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void roundTripConversion_returnsSameAddresses() {
|
void roundTripConversion_returnsSameAddresses() {
|
||||||
|
|
|
@ -17,15 +17,11 @@ package google.registry.persistence.transaction;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
|
||||||
|
|
||||||
/** JUnit test for {@link DummyJpaTransactionManager} */
|
/** JUnit test for {@link DummyJpaTransactionManager} */
|
||||||
class DummyJpaTransactionManagerTest {
|
class DummyJpaTransactionManagerTest {
|
||||||
|
|
||||||
@RegisterExtension final AppEngineExtension appEngine = AppEngineExtension.builder().build();
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void throwsExceptionWhenAnyMethodIsInvoked() {
|
void throwsExceptionWhenAnyMethodIsInvoked() {
|
||||||
assertThrows(UnsupportedOperationException.class, () -> tm().transact(() -> null));
|
assertThrows(UnsupportedOperationException.class, () -> tm().transact(() -> null));
|
||||||
|
|
|
@ -54,6 +54,7 @@ import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
import java.util.TimeZone;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
@ -80,7 +81,8 @@ import org.testcontainers.containers.PostgreSQLContainer;
|
||||||
* itself, so that all SQL queries will be sent to the database instance created by {@link
|
* itself, so that all SQL queries will be sent to the database instance created by {@link
|
||||||
* PostgreSQLContainer} to achieve test purpose.
|
* PostgreSQLContainer} to achieve test purpose.
|
||||||
*/
|
*/
|
||||||
abstract class JpaTransactionManagerExtension implements BeforeEachCallback, AfterEachCallback {
|
public abstract class JpaTransactionManagerExtension
|
||||||
|
implements BeforeEachCallback, AfterEachCallback {
|
||||||
|
|
||||||
private static final String DB_CLEANUP_SQL_PATH =
|
private static final String DB_CLEANUP_SQL_PATH =
|
||||||
"google/registry/persistence/transaction/cleanup_database.sql";
|
"google/registry/persistence/transaction/cleanup_database.sql";
|
||||||
|
@ -113,9 +115,11 @@ abstract class JpaTransactionManagerExtension implements BeforeEachCallback, Aft
|
||||||
// to false.
|
// to false.
|
||||||
private boolean includeNomulusSchema = true;
|
private boolean includeNomulusSchema = true;
|
||||||
|
|
||||||
// Whether to prepolulate some registrars for ease of testing.
|
// Whether to pre-polulate some registrars for ease of testing.
|
||||||
private final boolean withCannedData;
|
private final boolean withCannedData;
|
||||||
|
|
||||||
|
private TimeZone originalDefaultTimeZone;
|
||||||
|
|
||||||
JpaTransactionManagerExtension(
|
JpaTransactionManagerExtension(
|
||||||
Clock clock,
|
Clock clock,
|
||||||
Optional<String> initScriptPath,
|
Optional<String> initScriptPath,
|
||||||
|
@ -206,6 +210,8 @@ abstract class JpaTransactionManagerExtension implements BeforeEachCallback, Aft
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeEach(ExtensionContext context) throws Exception {
|
public void beforeEach(ExtensionContext context) throws Exception {
|
||||||
|
originalDefaultTimeZone = TimeZone.getDefault();
|
||||||
|
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
|
||||||
if (entityHash == emfEntityHash) {
|
if (entityHash == emfEntityHash) {
|
||||||
checkState(emf != null, "Missing EntityManagerFactory.");
|
checkState(emf != null, "Missing EntityManagerFactory.");
|
||||||
resetTablesAndSequences();
|
resetTablesAndSequences();
|
||||||
|
@ -217,6 +223,16 @@ abstract class JpaTransactionManagerExtension implements BeforeEachCallback, Aft
|
||||||
TransactionManagerFactory.setJpaTm(Suppliers.ofInstance(txnManager));
|
TransactionManagerFactory.setJpaTm(Suppliers.ofInstance(txnManager));
|
||||||
TransactionManagerFactory.setReplicaJpaTm(
|
TransactionManagerFactory.setReplicaJpaTm(
|
||||||
Suppliers.ofInstance(new ReplicaSimulatingJpaTransactionManager(txnManager)));
|
Suppliers.ofInstance(new ReplicaSimulatingJpaTransactionManager(txnManager)));
|
||||||
|
// Reset SQL Sequence based id allocation so that ids are deterministic in tests.
|
||||||
|
TransactionManagerFactory.tm()
|
||||||
|
.transact(
|
||||||
|
() ->
|
||||||
|
TransactionManagerFactory.tm()
|
||||||
|
.getEntityManager()
|
||||||
|
.createNativeQuery(
|
||||||
|
"alter sequence if exists project_wide_unique_id_seq start 1 minvalue 1"
|
||||||
|
+ " restart with 1")
|
||||||
|
.executeUpdate());
|
||||||
if (withCannedData) {
|
if (withCannedData) {
|
||||||
loadInitialData();
|
loadInitialData();
|
||||||
}
|
}
|
||||||
|
@ -227,6 +243,7 @@ abstract class JpaTransactionManagerExtension implements BeforeEachCallback, Aft
|
||||||
TransactionManagerFactory.setJpaTm(Suppliers.ofInstance(cachedTm));
|
TransactionManagerFactory.setJpaTm(Suppliers.ofInstance(cachedTm));
|
||||||
TransactionManagerFactory.setReplicaJpaTm(Suppliers.ofInstance(cachedTm));
|
TransactionManagerFactory.setReplicaJpaTm(Suppliers.ofInstance(cachedTm));
|
||||||
cachedTm = null;
|
cachedTm = null;
|
||||||
|
TimeZone.setDefault(originalDefaultTimeZone);
|
||||||
}
|
}
|
||||||
|
|
||||||
public JdbcDatabaseContainer getDatabase() {
|
public JdbcDatabaseContainer getDatabase() {
|
||||||
|
|
|
@ -28,7 +28,8 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import com.google.common.collect.ImmutableSortedMap;
|
import com.google.common.collect.ImmutableSortedMap;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.model.tld.label.PremiumList;
|
import google.registry.model.tld.label.PremiumList;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.util.Clock;
|
import google.registry.util.Clock;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
|
@ -41,7 +42,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class PricingEngineProxyTest {
|
public class PricingEngineProxyTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private Clock clock;
|
private Clock clock;
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,12 @@ import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
import com.google.appengine.api.users.User;
|
import com.google.appengine.api.users.User;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.Actions;
|
import google.registry.request.Actions;
|
||||||
import google.registry.request.auth.AuthLevel;
|
import google.registry.request.auth.AuthLevel;
|
||||||
import google.registry.request.auth.AuthResult;
|
import google.registry.request.auth.AuthResult;
|
||||||
import google.registry.request.auth.UserAuthInfo;
|
import google.registry.request.auth.UserAuthInfo;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeResponse;
|
import google.registry.testing.FakeResponse;
|
||||||
import google.registry.util.Idn;
|
import google.registry.util.Idn;
|
||||||
|
@ -43,7 +44,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
abstract class RdapActionBaseTestCase<A extends RdapActionBase> {
|
abstract class RdapActionBaseTestCase<A extends RdapActionBase> {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
protected static final AuthResult AUTH_RESULT =
|
protected static final AuthResult AUTH_RESULT =
|
||||||
AuthResult.create(
|
AuthResult.create(
|
||||||
|
|
|
@ -42,12 +42,13 @@ import google.registry.model.registrar.RegistrarPoc;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.transfer.DomainTransferData;
|
import google.registry.model.transfer.DomainTransferData;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.rdap.RdapJsonFormatter.OutputDataType;
|
import google.registry.rdap.RdapJsonFormatter.OutputDataType;
|
||||||
import google.registry.rdap.RdapObjectClasses.BoilerplateType;
|
import google.registry.rdap.RdapObjectClasses.BoilerplateType;
|
||||||
import google.registry.rdap.RdapObjectClasses.RdapEntity;
|
import google.registry.rdap.RdapObjectClasses.RdapEntity;
|
||||||
import google.registry.rdap.RdapObjectClasses.ReplyPayloadBase;
|
import google.registry.rdap.RdapObjectClasses.ReplyPayloadBase;
|
||||||
import google.registry.rdap.RdapObjectClasses.TopLevelReplyObject;
|
import google.registry.rdap.RdapObjectClasses.TopLevelReplyObject;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FullFieldsTestEntityHelper;
|
import google.registry.testing.FullFieldsTestEntityHelper;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
@ -59,7 +60,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
class RdapJsonFormatterTest {
|
class RdapJsonFormatterTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("1999-01-01T00:00:00Z"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("1999-01-01T00:00:00Z"));
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
package google.registry.rdap;
|
package google.registry.rdap;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static com.google.common.truth.Truth8.assertThat;
|
|
||||||
import static google.registry.testing.DatabaseHelper.createTld;
|
import static google.registry.testing.DatabaseHelper.createTld;
|
||||||
import static google.registry.testing.DatabaseHelper.loadRegistrar;
|
import static google.registry.testing.DatabaseHelper.loadRegistrar;
|
||||||
import static google.registry.testing.DatabaseHelper.persistSimpleResource;
|
import static google.registry.testing.DatabaseHelper.persistSimpleResource;
|
||||||
|
@ -31,7 +30,8 @@ import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.model.registrar.Registrar;
|
import google.registry.model.registrar.Registrar;
|
||||||
import google.registry.model.registrar.RegistrarAddress;
|
import google.registry.model.registrar.RegistrarAddress;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
@ -58,8 +58,8 @@ public final class UpdateRegistrarRdapBaseUrlsActionTest {
|
||||||
+ " Registrar,Reserved,\n";
|
+ " Registrar,Reserved,\n";
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public AppEngineExtension appEngineExtension =
|
public JpaIntegrationTestExtension jpa =
|
||||||
new AppEngineExtension.Builder().withCloudSql().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private static class TestHttpTransport extends MockHttpTransport {
|
private static class TestHttpTransport extends MockHttpTransport {
|
||||||
private MockLowLevelHttpRequest requestSent;
|
private MockLowLevelHttpRequest requestSent;
|
||||||
|
|
|
@ -37,8 +37,9 @@ import google.registry.model.common.Cursor;
|
||||||
import google.registry.model.rde.RdeMode;
|
import google.registry.model.rde.RdeMode;
|
||||||
import google.registry.model.rde.RdeRevision;
|
import google.registry.model.rde.RdeRevision;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.HttpException.NoContentException;
|
import google.registry.request.HttpException.NoContentException;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.BouncyCastleProviderExtension;
|
import google.registry.testing.BouncyCastleProviderExtension;
|
||||||
import google.registry.testing.FakeKeyringModule;
|
import google.registry.testing.FakeKeyringModule;
|
||||||
import google.registry.testing.GpgSystemCommandExtension;
|
import google.registry.testing.GpgSystemCommandExtension;
|
||||||
|
@ -73,7 +74,8 @@ public class BrdaCopyActionTest {
|
||||||
public final BouncyCastleProviderExtension bouncy = new BouncyCastleProviderExtension();
|
public final BouncyCastleProviderExtension bouncy = new BouncyCastleProviderExtension();
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final GpgSystemCommandExtension gpg =
|
public final GpgSystemCommandExtension gpg =
|
||||||
|
|
|
@ -33,7 +33,8 @@ import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.eppcommon.Trid;
|
import google.registry.model.eppcommon.Trid;
|
||||||
import google.registry.model.transfer.ContactTransferData;
|
import google.registry.model.transfer.ContactTransferData;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.xjc.contact.XjcContactPostalInfoEnumType;
|
import google.registry.xjc.contact.XjcContactPostalInfoEnumType;
|
||||||
import google.registry.xjc.contact.XjcContactPostalInfoType;
|
import google.registry.xjc.contact.XjcContactPostalInfoType;
|
||||||
import google.registry.xjc.contact.XjcContactStatusType;
|
import google.registry.xjc.contact.XjcContactStatusType;
|
||||||
|
@ -60,7 +61,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class ContactToXjcConverterTest {
|
public class ContactToXjcConverterTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
|
|
|
@ -54,7 +54,8 @@ import google.registry.model.rde.RdeMode;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.transfer.DomainTransferData;
|
import google.registry.model.transfer.DomainTransferData;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.util.Idn;
|
import google.registry.util.Idn;
|
||||||
|
@ -84,7 +85,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class DomainToXjcConverterTest {
|
public class DomainToXjcConverterTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final DateTime now = DateTime.parse("2014-01-01T00:00:00Z");
|
private final DateTime now = DateTime.parse("2014-01-01T00:00:00Z");
|
||||||
private final FakeClock clock = new FakeClock(now);
|
private final FakeClock clock = new FakeClock(now);
|
||||||
|
|
|
@ -27,10 +27,11 @@ import static org.mockito.Mockito.verify;
|
||||||
import google.registry.model.common.Cursor;
|
import google.registry.model.common.Cursor;
|
||||||
import google.registry.model.common.Cursor.CursorType;
|
import google.registry.model.common.Cursor.CursorType;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.rde.EscrowTaskRunner.EscrowTask;
|
import google.registry.rde.EscrowTaskRunner.EscrowTask;
|
||||||
import google.registry.request.HttpException.NoContentException;
|
import google.registry.request.HttpException.NoContentException;
|
||||||
import google.registry.request.HttpException.ServiceUnavailableException;
|
import google.registry.request.HttpException.ServiceUnavailableException;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeLockHandler;
|
import google.registry.testing.FakeLockHandler;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
@ -44,8 +45,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class EscrowTaskRunnerTest {
|
public class EscrowTaskRunnerTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withCloudSql().withTaskQueue().build();
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final EscrowTask task = mock(EscrowTask.class);
|
private final EscrowTask task = mock(EscrowTask.class);
|
||||||
private final FakeClock clock = new FakeClock(DateTime.parse("2000-01-01TZ"));
|
private final FakeClock clock = new FakeClock(DateTime.parse("2000-01-01TZ"));
|
||||||
|
|
|
@ -25,7 +25,8 @@ import com.google.common.net.InetAddresses;
|
||||||
import google.registry.model.domain.Domain;
|
import google.registry.model.domain.Domain;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.Host;
|
import google.registry.model.host.Host;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.DatabaseHelper;
|
import google.registry.testing.DatabaseHelper;
|
||||||
import google.registry.xjc.host.XjcHostStatusType;
|
import google.registry.xjc.host.XjcHostStatusType;
|
||||||
import google.registry.xjc.host.XjcHostStatusValueType;
|
import google.registry.xjc.host.XjcHostStatusValueType;
|
||||||
|
@ -46,7 +47,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class HostToXjcConverterTest {
|
public class HostToXjcConverterTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void beforeEach() {
|
void beforeEach() {
|
||||||
|
|
|
@ -32,7 +32,8 @@ import com.google.common.truth.Truth8;
|
||||||
import google.registry.model.common.Cursor;
|
import google.registry.model.common.Cursor;
|
||||||
import google.registry.model.common.Cursor.CursorType;
|
import google.registry.model.common.Cursor.CursorType;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -43,7 +44,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
public class PendingDepositCheckerTest {
|
public class PendingDepositCheckerTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final FakeClock clock = new FakeClock();
|
private final FakeClock clock = new FakeClock();
|
||||||
private final PendingDepositChecker checker = new PendingDepositChecker();
|
private final PendingDepositChecker checker = new PendingDepositChecker();
|
||||||
|
|
|
@ -18,7 +18,8 @@ import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.testing.DatabaseHelper.loadRegistrar;
|
import static google.registry.testing.DatabaseHelper.loadRegistrar;
|
||||||
import static google.registry.xml.ValidationMode.STRICT;
|
import static google.registry.xml.ValidationMode.STRICT;
|
||||||
|
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.xml.XmlTestUtils;
|
import google.registry.xml.XmlTestUtils;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
@ -30,7 +31,8 @@ public class RdeMarshallerTest {
|
||||||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testMarshalRegistrar_validData_producesXmlFragment() throws Exception {
|
void testMarshalRegistrar_validData_producesXmlFragment() throws Exception {
|
||||||
|
|
|
@ -48,9 +48,10 @@ import google.registry.gcs.GcsUtils;
|
||||||
import google.registry.model.common.Cursor;
|
import google.registry.model.common.Cursor;
|
||||||
import google.registry.model.rde.RdeRevision;
|
import google.registry.model.rde.RdeRevision;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.HttpException.InternalServerErrorException;
|
import google.registry.request.HttpException.InternalServerErrorException;
|
||||||
import google.registry.request.HttpException.NoContentException;
|
import google.registry.request.HttpException.NoContentException;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.BouncyCastleProviderExtension;
|
import google.registry.testing.BouncyCastleProviderExtension;
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import google.registry.testing.FakeKeyringModule;
|
import google.registry.testing.FakeKeyringModule;
|
||||||
|
@ -82,7 +83,8 @@ public class RdeReportActionTest {
|
||||||
public final BouncyCastleProviderExtension bouncy = new BouncyCastleProviderExtension();
|
public final BouncyCastleProviderExtension bouncy = new BouncyCastleProviderExtension();
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension appEngine = AppEngineExtension.builder().withCloudSql().build();
|
final JpaIntegrationTestExtension jpa =
|
||||||
|
new JpaTestExtensions.Builder().buildIntegrationTestExtension();
|
||||||
|
|
||||||
private final FakeResponse response = new FakeResponse();
|
private final FakeResponse response = new FakeResponse();
|
||||||
private final EscrowTaskRunner runner = mock(EscrowTaskRunner.class);
|
private final EscrowTaskRunner runner = mock(EscrowTaskRunner.class);
|
||||||
|
|
|
@ -30,8 +30,9 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.beam.BeamActionTestBase;
|
import google.registry.beam.BeamActionTestBase;
|
||||||
import google.registry.gcs.GcsUtils;
|
import google.registry.gcs.GcsUtils;
|
||||||
import google.registry.model.tld.Registry;
|
import google.registry.model.tld.Registry;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions;
|
||||||
|
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
|
||||||
import google.registry.request.HttpException.BadRequestException;
|
import google.registry.request.HttpException.BadRequestException;
|
||||||
import google.registry.testing.AppEngineExtension;
|
|
||||||
import google.registry.testing.FakeClock;
|
import google.registry.testing.FakeClock;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@ -50,8 +51,8 @@ public class RdeStagingActionTest extends BeamActionTestBase {
|
||||||
private final RdeStagingAction action = new RdeStagingAction();
|
private final RdeStagingAction action = new RdeStagingAction();
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public final AppEngineExtension extension =
|
final JpaIntegrationTestExtension jpa =
|
||||||
AppEngineExtension.builder().withClock(clock).withCloudSql().build();
|
new JpaTestExtensions.Builder().withClock(clock).buildIntegrationTestExtension();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
@Override
|
@Override
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue