mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Get rid of ReferenceUnions entirely
This is the third and final phase in the migration away from ReferenceUnions. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=138778148
This commit is contained in:
parent
8d97fa5858
commit
780a5add78
14 changed files with 5 additions and 148 deletions
|
@ -19,7 +19,6 @@ import static com.google.common.collect.Maps.newHashMap;
|
|||
import static com.google.common.collect.Sets.newHashSet;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.ImmutableObject.cloneEmptyToNull;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveContact;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
|
||||
|
@ -31,7 +30,6 @@ import com.googlecode.objectify.Key;
|
|||
import com.googlecode.objectify.ObjectifyService;
|
||||
import com.googlecode.objectify.annotation.Entity;
|
||||
import com.googlecode.objectify.annotation.Id;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.util.CidrAddressBlock;
|
||||
import java.util.ArrayDeque;
|
||||
|
@ -255,6 +253,7 @@ public class ImmutableObjectTest {
|
|||
|
||||
/** Subclass of ImmutableObject with keys to other objects. */
|
||||
public static class RootObject extends ImmutableObject {
|
||||
|
||||
Key<ValueObject> hydrateMe;
|
||||
|
||||
@DoNotHydrate
|
||||
|
@ -263,8 +262,6 @@ public class ImmutableObjectTest {
|
|||
Map<String, Key<ValueObject>> map;
|
||||
|
||||
Set<Key<ValueObject>> set;
|
||||
|
||||
ReferenceUnion<?> referenceUnion;
|
||||
}
|
||||
|
||||
/** Simple subclass of ImmutableObject. */
|
||||
|
@ -308,11 +305,4 @@ public class ImmutableObjectTest {
|
|||
root.set = ImmutableSet.of(Key.create(persistResource(ValueObject.create(1, "foo"))));
|
||||
assertThat(root.toHydratedString()).contains("foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToHydratedString_expandsReferenceUnions() {
|
||||
RootObject root = new RootObject();
|
||||
root.referenceUnion = ReferenceUnion.create(Key.create(persistActiveContact("foo")));
|
||||
assertThat(root.toHydratedString()).contains("foo");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue