mirror of
https://github.com/google/nomulus
synced 2026-09-28 18:55:37 +00:00
Make LINKED into a virtual status value
* Remove LINKED when loading an EppResource * Enforce that you can't add it to a resource * Ignore LINKED on xjc import of contacts and hosts After running ResaveAllEppResourcesAction we will no longer have persisted LINKED statuses in datastore. In the process of writing this I discovered that RDAP treats LINKED like any other status value and returns the persisted value rather than the derived one. Since this is an existing bug and is orthogonal to the changes in this CL, I am addressing it in a separate CL. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=145585227
This commit is contained in:
@@ -172,37 +172,21 @@ public class ContactResourceTest extends EntityTestCase {
|
||||
@Test
|
||||
public void testImplicitStatusValues() {
|
||||
// OK is implicit if there's no other statuses.
|
||||
StatusValue[] statuses = {StatusValue.OK};
|
||||
assertAboutContacts()
|
||||
.that(new ContactResource.Builder().build())
|
||||
.hasExactlyStatusValues(statuses);
|
||||
StatusValue[] statuses1 = {StatusValue.OK, StatusValue.LINKED};
|
||||
// OK is also implicit if the only other status is LINKED.
|
||||
assertAboutContacts()
|
||||
.that(new ContactResource.Builder()
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.LINKED))
|
||||
.build())
|
||||
.hasExactlyStatusValues(statuses1);
|
||||
StatusValue[] statuses2 = {StatusValue.CLIENT_HOLD};
|
||||
.hasExactlyStatusValues(StatusValue.OK);
|
||||
// If there are other status values, OK should be suppressed.
|
||||
assertAboutContacts()
|
||||
.that(new ContactResource.Builder()
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.CLIENT_HOLD))
|
||||
.build())
|
||||
.hasExactlyStatusValues(statuses2);
|
||||
StatusValue[] statuses3 = {StatusValue.LINKED, StatusValue.CLIENT_HOLD};
|
||||
assertAboutContacts()
|
||||
.that(new ContactResource.Builder()
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.LINKED, StatusValue.CLIENT_HOLD))
|
||||
.build())
|
||||
.hasExactlyStatusValues(statuses3);
|
||||
StatusValue[] statuses4 = {StatusValue.CLIENT_HOLD};
|
||||
.hasExactlyStatusValues(StatusValue.CLIENT_HOLD);
|
||||
// When OK is suppressed, it should be removed even if it was originally there.
|
||||
assertAboutContacts()
|
||||
.that(new ContactResource.Builder()
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.OK, StatusValue.CLIENT_HOLD))
|
||||
.build())
|
||||
.hasExactlyStatusValues(statuses4);
|
||||
.hasExactlyStatusValues(StatusValue.CLIENT_HOLD);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user