Remove EppResource.SharedFields following successful data migration

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117412736
This commit is contained in:
mcilwain 2016-03-16 20:29:38 -07:00 committed by Justine Tunney
parent 401df6c34a
commit 99a50f7972
8 changed files with 6 additions and 222 deletions

View file

@ -24,8 +24,6 @@ import static com.google.domain.registry.testing.DatastoreHelper.persistResource
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.domain.registry.model.EntityTestCase;
import com.google.domain.registry.model.EppResource;
import com.google.domain.registry.model.EppResource.SharedFields;
import com.google.domain.registry.model.billing.BillingEvent;
import com.google.domain.registry.model.contact.Disclose.PostalInfoChoice;
import com.google.domain.registry.model.contact.PostalInfo.Type;
@ -44,8 +42,6 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.lang.reflect.Field;
/** Unit tests for {@link ContactResource}. */
public class ContactResourceTest extends EntityTestCase {
@ -134,9 +130,7 @@ public class ContactResourceTest extends EntityTestCase {
verifyIndexing(
contactResource,
"deletionTime",
"currentSponsorClientId",
"sharedFields.deletionTime",
"sharedFields.currentSponsorClientId");
"currentSponsorClientId");
}
@Test
@ -173,12 +167,7 @@ public class ContactResourceTest extends EntityTestCase {
ContactResource withNull = new ContactResource.Builder().setTransferData(null).build();
ContactResource withEmpty = withNull.asBuilder().setTransferData(TransferData.EMPTY).build();
assertThat(withNull).isEqualTo(withEmpty);
// We don't have package access to SharedFields so we need to use reflection to check for null.
Field sharedFieldsField = EppResource.class.getDeclaredField("sharedFields");
sharedFieldsField.setAccessible(true);
Field transferDataField = SharedFields.class.getDeclaredField("transferData");
transferDataField.setAccessible(true);
assertThat(transferDataField.get(sharedFieldsField.get(withEmpty))).isNull();
assertThat(withEmpty.hasTransferData()).isFalse();
}
@Test

View file

@ -28,8 +28,6 @@ import static org.joda.money.CurrencyUnit.USD;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.domain.registry.model.EntityTestCase;
import com.google.domain.registry.model.EppResource;
import com.google.domain.registry.model.EppResource.SharedFields;
import com.google.domain.registry.model.billing.BillingEvent;
import com.google.domain.registry.model.domain.launch.ApplicationStatus;
import com.google.domain.registry.model.domain.launch.LaunchNotice;
@ -52,8 +50,6 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.lang.reflect.Field;
/** Unit tests for {@link DomainApplication}. */
public class DomainApplicationTest extends EntityTestCase {
@ -131,8 +127,6 @@ public class DomainApplicationTest extends EntityTestCase {
"nameservers.linked",
"deletionTime",
"currentSponsorClientId",
"sharedFields.deletionTime",
"sharedFields.currentSponsorClientId",
"tld");
}
@ -186,11 +180,6 @@ public class DomainApplicationTest extends EntityTestCase {
DomainApplication withNull = emptyBuilder().setTransferData(null).build();
DomainApplication withEmpty = withNull.asBuilder().setTransferData(TransferData.EMPTY).build();
assertThat(withNull).isEqualTo(withEmpty);
// We don't have package access to SharedFields so we need to use reflection to check for null.
Field sharedFieldsField = EppResource.class.getDeclaredField("sharedFields");
sharedFieldsField.setAccessible(true);
Field transferDataField = SharedFields.class.getDeclaredField("transferData");
transferDataField.setAccessible(true);
assertThat(transferDataField.get(sharedFieldsField.get(withEmpty))).isNull();
assertThat(withEmpty.hasTransferData()).isFalse();
}
}

View file

@ -31,8 +31,6 @@ import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Ordering;
import com.google.domain.registry.model.EntityTestCase;
import com.google.domain.registry.model.EppResource;
import com.google.domain.registry.model.EppResource.SharedFields;
import com.google.domain.registry.model.billing.BillingEvent;
import com.google.domain.registry.model.billing.BillingEvent.Reason;
import com.google.domain.registry.model.contact.ContactResource;
@ -60,7 +58,6 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.lang.reflect.Field;
import java.util.List;
/** Unit tests for {@link DomainResource}. */
@ -165,8 +162,6 @@ public class DomainResourceTest extends EntityTestCase {
"nameservers.linked",
"currentSponsorClientId",
"deletionTime",
"sharedFields.currentSponsorClientId",
"sharedFields.deletionTime",
"tld");
}
@ -221,12 +216,7 @@ public class DomainResourceTest extends EntityTestCase {
newDomainResource("example.com").asBuilder().setTransferData(null).build();
DomainResource withEmpty = withNull.asBuilder().setTransferData(TransferData.EMPTY).build();
assertThat(withNull).isEqualTo(withEmpty);
// We don't have package access to SharedFields so we need to use reflection to check for null.
Field sharedFieldsField = EppResource.class.getDeclaredField("sharedFields");
sharedFieldsField.setAccessible(true);
Field transferDataField = SharedFields.class.getDeclaredField("transferData");
transferDataField.setAccessible(true);
assertThat(transferDataField.get(sharedFieldsField.get(withEmpty))).isNull();
assertThat(withEmpty.hasTransferData()).isFalse();
}
@Test

View file

@ -24,8 +24,6 @@ import static com.google.domain.registry.testing.HostResourceSubject.assertAbout
import com.google.common.collect.ImmutableSet;
import com.google.domain.registry.model.EntityTestCase;
import com.google.domain.registry.model.EppResource;
import com.google.domain.registry.model.EppResource.SharedFields;
import com.google.domain.registry.model.billing.BillingEvent;
import com.google.domain.registry.model.domain.DomainResource;
import com.google.domain.registry.model.eppcommon.StatusValue;
@ -45,7 +43,6 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.lang.reflect.Field;
import java.net.InetAddress;
import javax.annotation.Nullable;
@ -108,12 +105,10 @@ public class HostResourceTest extends EntityTestCase {
verifyIndexing(
persistResource(hostResource.cloneProjectedAtTime(clock.nowUtc())),
"deletionTime",
"sharedFields.deletionTime",
"fullyQualifiedHostName",
"inetAddresses",
"superordinateDomain",
"currentSponsorClientId",
"sharedFields.currentSponsorClientId");
"currentSponsorClientId");
}
@Test
@ -158,12 +153,7 @@ public class HostResourceTest extends EntityTestCase {
HostResource withNull = new HostResource.Builder().setTransferData(null).build();
HostResource withEmpty = withNull.asBuilder().setTransferData(TransferData.EMPTY).build();
assertThat(withNull).isEqualTo(withEmpty);
// We don't have package access to SharedFields so we need to use reflection to check for null.
Field sharedFieldsField = EppResource.class.getDeclaredField("sharedFields");
sharedFieldsField.setAccessible(true);
Field transferDataField = SharedFields.class.getDeclaredField("transferData");
transferDataField.setAccessible(true);
assertThat(transferDataField.get(sharedFieldsField.get(withEmpty))).isNull();
assertThat(withEmpty.hasTransferData()).isFalse();
}
@Test

View file

@ -5,17 +5,6 @@ enum com.google.common.collect.BoundType {
class com.google.domain.registry.model.CreateAutoTimestamp {
org.joda.time.DateTime timestamp;
}
class com.google.domain.registry.model.EppResource$SharedFields {
com.google.domain.registry.model.CreateAutoTimestamp creationTime;
com.google.domain.registry.model.transfer.TransferData transferData;
java.lang.String creationRegistryClientId;
java.lang.String currentSponsorClientId;
java.lang.String lastUpdateRegistryClientId;
java.util.Set<com.google.domain.registry.model.eppcommon.StatusValue$LegacyStatusValue> statusValues;
org.joda.time.DateTime deletionTime;
org.joda.time.DateTime lastTransferTime;
org.joda.time.DateTime lastUpdateTime;
}
class com.google.domain.registry.model.UpdateAutoTimestamp {
org.joda.time.DateTime timestamp;
}
@ -146,7 +135,6 @@ class com.google.domain.registry.model.contact.ContactResource {
@Id java.lang.String repoId;
com.google.common.collect.ImmutableSortedMap<org.joda.time.DateTime, com.googlecode.objectify.Ref<com.google.domain.registry.model.ofy.CommitLogManifest>> revisions;
com.google.domain.registry.model.CreateAutoTimestamp creationTime;
com.google.domain.registry.model.EppResource$SharedFields sharedFields;
com.google.domain.registry.model.UpdateAutoTimestamp updateTimestamp;
com.google.domain.registry.model.contact.ContactAuthInfo authInfo;
com.google.domain.registry.model.contact.ContactPhoneNumber fax;
@ -201,7 +189,6 @@ class com.google.domain.registry.model.domain.DomainApplication {
@Id java.lang.String repoId;
com.google.common.collect.ImmutableSortedMap<org.joda.time.DateTime, com.googlecode.objectify.Ref<com.google.domain.registry.model.ofy.CommitLogManifest>> revisions;
com.google.domain.registry.model.CreateAutoTimestamp creationTime;
com.google.domain.registry.model.EppResource$SharedFields sharedFields;
com.google.domain.registry.model.UpdateAutoTimestamp updateTimestamp;
com.google.domain.registry.model.domain.DomainAuthInfo authInfo;
com.google.domain.registry.model.domain.launch.ApplicationStatus applicationStatus;
@ -232,7 +219,6 @@ class com.google.domain.registry.model.domain.DomainBase {
@Id java.lang.String repoId;
com.google.common.collect.ImmutableSortedMap<org.joda.time.DateTime, com.googlecode.objectify.Ref<com.google.domain.registry.model.ofy.CommitLogManifest>> revisions;
com.google.domain.registry.model.CreateAutoTimestamp creationTime;
com.google.domain.registry.model.EppResource$SharedFields sharedFields;
com.google.domain.registry.model.UpdateAutoTimestamp updateTimestamp;
com.google.domain.registry.model.domain.DomainAuthInfo authInfo;
com.google.domain.registry.model.domain.launch.LaunchNotice launchNotice;
@ -255,7 +241,6 @@ class com.google.domain.registry.model.domain.DomainResource {
@Id java.lang.String repoId;
com.google.common.collect.ImmutableSortedMap<org.joda.time.DateTime, com.googlecode.objectify.Ref<com.google.domain.registry.model.ofy.CommitLogManifest>> revisions;
com.google.domain.registry.model.CreateAutoTimestamp creationTime;
com.google.domain.registry.model.EppResource$SharedFields sharedFields;
com.google.domain.registry.model.UpdateAutoTimestamp updateTimestamp;
com.google.domain.registry.model.domain.DomainAuthInfo authInfo;
com.google.domain.registry.model.domain.launch.LaunchNotice launchNotice;
@ -370,9 +355,6 @@ enum com.google.domain.registry.model.eppcommon.StatusValue {
SERVER_TRANSFER_PROHIBITED;
SERVER_UPDATE_PROHIBITED;
}
class com.google.domain.registry.model.eppcommon.StatusValue$LegacyStatusValue {
java.lang.String xmlStatusValue;
}
class com.google.domain.registry.model.eppcommon.Trid {
java.lang.String clientTransactionId;
java.lang.String serverTransactionId;
@ -387,7 +369,6 @@ class com.google.domain.registry.model.host.HostResource {
@Id java.lang.String repoId;
com.google.common.collect.ImmutableSortedMap<org.joda.time.DateTime, com.googlecode.objectify.Ref<com.google.domain.registry.model.ofy.CommitLogManifest>> revisions;
com.google.domain.registry.model.CreateAutoTimestamp creationTime;
com.google.domain.registry.model.EppResource$SharedFields sharedFields;
com.google.domain.registry.model.UpdateAutoTimestamp updateTimestamp;
com.google.domain.registry.model.transfer.TransferData transferData;
com.googlecode.objectify.Ref<com.google.domain.registry.model.domain.DomainResource> superordinateDomain;

View file

@ -108,11 +108,9 @@ public class MutatingCommandTest {
String changes = command.prompt();
assertThat(changes).isEqualTo(
"Update HostResource@2-ROID\n"
+ "sharedFields.lastUpdateTime -> [null, 2014-09-09T09:09:09.000Z]\n"
+ "lastEppUpdateTime -> [null, 2014-09-09T09:09:09.000Z]\n"
+ "\n"
+ "Update HostResource@3-ROID\n"
+ "sharedFields.currentSponsorClientId -> [TheRegistrar, Registrar2]\n"
+ "currentSponsorClientId -> [TheRegistrar, Registrar2]\n"
+ "\n"
+ "Update Registrar@Registrar1\n"
@ -240,7 +238,6 @@ public class MutatingCommandTest {
+ host1 + "\n"
+ "\n"
+ "Update HostResource@3-ROID\n"
+ "sharedFields.currentSponsorClientId -> [TheRegistrar, Registrar2]\n"
+ "currentSponsorClientId -> [TheRegistrar, Registrar2]\n"
+ "\n"
+ "Delete Registrar@Registrar1\n"
@ -281,7 +278,6 @@ public class MutatingCommandTest {
+ host1 + "\n"
+ "\n"
+ "Update HostResource@3-ROID\n"
+ "sharedFields.currentSponsorClientId -> [TheRegistrar, Registrar2]\n"
+ "currentSponsorClientId -> [TheRegistrar, Registrar2]\n"
+ "\n"
+ "Delete Registrar@Registrar1\n"