mirror of
https://github.com/google/nomulus.git
synced 2025-07-08 20:23:24 +02:00
Scope down TransferData to only ContactResource and DomainResource
HostResource and DomainApplication are not transferable, (or at least, not directly in the case of hosts) and have no need for the TransferData field. In a flat-flow world, we can push it down to where it's actually used. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=139201423
This commit is contained in:
parent
0234795240
commit
84009eaccb
24 changed files with 309 additions and 240 deletions
|
@ -149,14 +149,6 @@ public class HostResourceTest extends EntityTestCase {
|
|||
.isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyTransferDataBecomesNull() throws Exception {
|
||||
HostResource withNull = new HostResource.Builder().setTransferData(null).build();
|
||||
HostResource withEmpty = withNull.asBuilder().setTransferData(TransferData.EMPTY).build();
|
||||
assertThat(withNull).isEqualTo(withEmpty);
|
||||
assertThat(withEmpty.hasTransferData()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImplicitStatusValues() {
|
||||
// OK is implicit if there's no other statuses.
|
||||
|
@ -205,7 +197,6 @@ public class HostResourceTest extends EntityTestCase {
|
|||
hostResource.asBuilder()
|
||||
.setLastSuperordinateChange(superordinateChangeTime)
|
||||
.setLastTransferTime(hostTransferTime)
|
||||
.setTransferData(null)
|
||||
.build());
|
||||
return hostResource.cloneProjectedAtTime(clock.nowUtc()).getLastTransferTime();
|
||||
}
|
||||
|
@ -279,8 +270,6 @@ public class HostResourceTest extends EntityTestCase {
|
|||
.build())
|
||||
.build());
|
||||
HostResource afterTransfer = hostResource.cloneProjectedAtTime(clock.nowUtc().plusDays(1));
|
||||
assertThat(afterTransfer.getTransferData().getTransferStatus())
|
||||
.isEqualTo(TransferStatus.SERVER_APPROVED);
|
||||
assertThat(afterTransfer.getCurrentSponsorClientId()).isEqualTo("winner");
|
||||
assertThat(afterTransfer.getLastTransferTime()).isEqualTo(clock.nowUtc().plusDays(1));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue