Add allowedEppActions to AllocationToken Java classes (#1958)

* Add allowedEppActions field to AllocationToken Java class and converter

* Add getter and setter
This commit is contained in:
sarahcaseybot
2023-03-16 15:45:34 -04:00
committed by GitHub
parent a44aa1378f
commit 178a2323d9
5 changed files with 52 additions and 0 deletions
@@ -37,6 +37,7 @@ import google.registry.model.Buildable;
import google.registry.model.EntityTestCase;
import google.registry.model.billing.BillingEvent.RenewalPriceBehavior;
import google.registry.model.domain.Domain;
import google.registry.model.domain.fee.FeeQueryCommandExtensionItem.CommandName;
import google.registry.model.domain.token.AllocationToken.RegistrationBehavior;
import google.registry.model.domain.token.AllocationToken.TokenStatus;
import google.registry.model.domain.token.AllocationToken.TokenType;
@@ -77,6 +78,7 @@ public class AllocationTokenTest extends EntityTestCase {
.put(DateTime.now(UTC), TokenStatus.VALID)
.put(DateTime.now(UTC).plusWeeks(8), TokenStatus.ENDED)
.build())
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE, CommandName.RENEW))
.build());
assertThat(loadByEntity(unlimitedUseToken)).isEqualTo(unlimitedUseToken);
@@ -113,6 +115,7 @@ public class AllocationTokenTest extends EntityTestCase {
.put(DateTime.now(UTC), TokenStatus.VALID)
.put(DateTime.now(UTC).plusWeeks(8), TokenStatus.ENDED)
.build())
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE, CommandName.RENEW))
.build());
AllocationToken persisted = loadByEntity(unlimitedUseToken);
assertThat(SerializeUtils.serializeDeserialize(persisted)).isEqualTo(persisted);