mirror of
https://github.com/google/nomulus
synced 2026-09-08 17:17:02 +00:00
Remove ofy support from AllocationToken (#1770)
This commit is contained in:
@@ -1352,7 +1352,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||
|
||||
private void assertAllocationTokenWasRedeemed(String token) throws Exception {
|
||||
AllocationToken reloadedToken =
|
||||
tm().transact(() -> tm().loadByKey(VKey.create(AllocationToken.class, token)));
|
||||
tm().transact(() -> tm().loadByKey(VKey.createSql(AllocationToken.class, token)));
|
||||
assertThat(reloadedToken.isRedeemed()).isTrue();
|
||||
assertThat(reloadedToken.getRedemptionHistoryEntry())
|
||||
.hasValue(
|
||||
@@ -1362,7 +1362,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||
|
||||
private void assertAllocationTokenWasNotRedeemed(String token) {
|
||||
AllocationToken reloadedToken =
|
||||
tm().transact(() -> tm().loadByKey(VKey.create(AllocationToken.class, token)));
|
||||
tm().transact(() -> tm().loadByKey(VKey.createSql(AllocationToken.class, token)));
|
||||
assertThat(reloadedToken.isRedeemed()).isFalse();
|
||||
}
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, Domain>
|
||||
@Test
|
||||
private void assertAllocationTokenWasNotRedeemed(String token) {
|
||||
AllocationToken reloadedToken =
|
||||
tm().transact(() -> tm().loadByKey(VKey.create(AllocationToken.class, token)));
|
||||
tm().transact(() -> tm().loadByKey(VKey.createSql(AllocationToken.class, token)));
|
||||
assertThat(reloadedToken.isRedeemed()).isFalse();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import google.registry.model.contact.Contact;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.host.Host;
|
||||
import google.registry.model.index.EppResourceIndex;
|
||||
import google.registry.model.index.EppResourceIndexBucket;
|
||||
@@ -49,7 +48,6 @@ public class ClassPathManagerTest {
|
||||
*/
|
||||
assertThat(ClassPathManager.getClass("ForeignKeyContactIndex"))
|
||||
.isEqualTo(ForeignKeyContactIndex.class);
|
||||
assertThat(ClassPathManager.getClass("AllocationToken")).isEqualTo(AllocationToken.class);
|
||||
assertThat(ClassPathManager.getClass("Host")).isEqualTo(Host.class);
|
||||
assertThat(ClassPathManager.getClass("Registrar")).isEqualTo(Registrar.class);
|
||||
assertThat(ClassPathManager.getClass("Contact")).isEqualTo(Contact.class);
|
||||
@@ -100,7 +98,6 @@ public class ClassPathManagerTest {
|
||||
*/
|
||||
assertThat(ClassPathManager.getClassName(ForeignKeyContactIndex.class))
|
||||
.isEqualTo("ForeignKeyContactIndex");
|
||||
assertThat(ClassPathManager.getClassName(AllocationToken.class)).isEqualTo("AllocationToken");
|
||||
assertThat(ClassPathManager.getClassName(Host.class)).isEqualTo("Host");
|
||||
assertThat(ClassPathManager.getClassName(Registrar.class)).isEqualTo("Registrar");
|
||||
assertThat(ClassPathManager.getClassName(Contact.class)).isEqualTo("Contact");
|
||||
|
||||
@@ -222,8 +222,7 @@ public class AllocationTokenTest extends EntityTestCase {
|
||||
.setToken("abc123")
|
||||
.setTokenType(TokenType.PACKAGE)
|
||||
.setRenewalPriceBehavior(RenewalPriceBehavior.DEFAULT);
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(IllegalArgumentException.class, () -> builder.build());
|
||||
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Package tokens must have renewalPriceBehavior set to SPECIFIED");
|
||||
@@ -280,7 +279,7 @@ public class AllocationTokenTest extends EntityTestCase {
|
||||
|
||||
@Test
|
||||
void testBuild_onlyOneClientInPackage() {
|
||||
Buildable.Builder builder =
|
||||
Buildable.Builder<AllocationToken> builder =
|
||||
new AllocationToken.Builder()
|
||||
.setToken("foobar")
|
||||
.setTokenType(PACKAGE)
|
||||
@@ -531,7 +530,7 @@ public class AllocationTokenTest extends EntityTestCase {
|
||||
}
|
||||
|
||||
private void assertTerminal(TokenStatus status) {
|
||||
// The "terminal" message is slightly different so it must be tested separately
|
||||
// The "terminal" message is slightly different, so it must be tested separately
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
|
||||
@@ -89,7 +89,6 @@ class google.registry.model.domain.Domain {
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> billingContact;
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> registrantContact;
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> techContact;
|
||||
google.registry.persistence.VKey<google.registry.model.domain.token.AllocationToken> currentPackageToken;
|
||||
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$Autorenew> autorenewPollMessage;
|
||||
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$OneTime> deletePollMessage;
|
||||
java.lang.String creationClientId;
|
||||
@@ -122,7 +121,6 @@ class google.registry.model.domain.DomainBase {
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> billingContact;
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> registrantContact;
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> techContact;
|
||||
google.registry.persistence.VKey<google.registry.model.domain.token.AllocationToken> currentPackageToken;
|
||||
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$Autorenew> autorenewPollMessage;
|
||||
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$OneTime> deletePollMessage;
|
||||
java.lang.String creationClientId;
|
||||
@@ -216,35 +214,6 @@ class google.registry.model.domain.secdns.DomainDsDataHistory {
|
||||
java.lang.Long domainHistoryRevisionId;
|
||||
java.lang.Long dsDataHistoryRevisionId;
|
||||
}
|
||||
class google.registry.model.domain.token.AllocationToken {
|
||||
@Id java.lang.String token;
|
||||
boolean discountPremiums;
|
||||
double discountFraction;
|
||||
google.registry.model.common.TimedTransitionProperty<google.registry.model.domain.token.AllocationToken$TokenStatus> tokenStatusTransitions;
|
||||
google.registry.model.domain.token.AllocationToken$RegistrationBehavior registrationBehavior;
|
||||
google.registry.model.domain.token.AllocationToken$TokenType tokenType;
|
||||
google.registry.persistence.DomainHistoryVKey redemptionHistoryEntry;
|
||||
int discountYears;
|
||||
java.lang.String domainName;
|
||||
java.util.Set<java.lang.String> allowedClientIds;
|
||||
java.util.Set<java.lang.String> allowedTlds;
|
||||
}
|
||||
enum google.registry.model.domain.token.AllocationToken$RegistrationBehavior {
|
||||
ANCHOR_TENANT;
|
||||
BYPASS_TLD_STATE;
|
||||
DEFAULT;
|
||||
}
|
||||
enum google.registry.model.domain.token.AllocationToken$TokenStatus {
|
||||
CANCELLED;
|
||||
ENDED;
|
||||
NOT_STARTED;
|
||||
VALID;
|
||||
}
|
||||
enum google.registry.model.domain.token.AllocationToken$TokenType {
|
||||
PACKAGE;
|
||||
SINGLE_USE;
|
||||
UNLIMITED_USE;
|
||||
}
|
||||
class google.registry.model.eppcommon.AuthInfo$PasswordAuth {
|
||||
java.lang.String repoId;
|
||||
java.lang.String value;
|
||||
@@ -509,7 +478,3 @@ enum google.registry.model.transfer.TransferStatus {
|
||||
SERVER_APPROVED;
|
||||
SERVER_CANCELLED;
|
||||
}
|
||||
class google.registry.persistence.DomainHistoryVKey {
|
||||
java.lang.Long historyRevisionId;
|
||||
java.lang.String repoId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user