mirror of
https://github.com/google/nomulus.git
synced 2025-05-16 01:17:14 +02:00
Rename all testdata loading files to conform to a single naming scheme
The scheme is: - loadBytes: returns a ByteSource of the data - loadFile: returns a string using UTF8 encoding, optionally applying substitutions ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177606406
This commit is contained in:
parent
ebfa27b3ad
commit
b8970bfe1b
94 changed files with 428 additions and 449 deletions
|
@ -127,7 +127,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
public void testDryRun() throws Exception {
|
||||
createTld("tld");
|
||||
persistActiveSubordinateHost(oldHostName(), persistActiveDomain("example.tld"));
|
||||
dryRunFlowAssertResponse(readFile("host_update_response.xml"));
|
||||
dryRunFlowAssertResponse(loadFile("host_update_response.xml"));
|
||||
}
|
||||
|
||||
private HostResource doSuccessfulTest() throws Exception {
|
||||
|
@ -144,7 +144,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
runFlowAssertResponse(
|
||||
CommitMode.LIVE,
|
||||
isSuperuser ? UserPrivileges.SUPERUSER : UserPrivileges.NORMAL,
|
||||
readFile("host_update_response.xml"));
|
||||
loadFile("host_update_response.xml"));
|
||||
// The example xml does a host rename, so reloading the host (which uses the original host name)
|
||||
// should now return null.
|
||||
assertThat(reloadResourceByForeignKey()).isNull();
|
||||
|
@ -204,7 +204,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
DomainResource domain = persistActiveDomain("example.tld");
|
||||
HostResource oldHost = persistActiveSubordinateHost(oldHostName(), domain);
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile("host_update_response.xml"));
|
||||
runFlowAssertResponse(loadFile("host_update_response.xml"));
|
||||
// The example xml doesn't do a host rename, so reloading the host should work.
|
||||
assertAboutHosts().that(reloadResourceByForeignKey())
|
||||
.hasLastSuperordinateChange(oldHost.getLastSuperordinateChange()).and()
|
||||
|
@ -225,7 +225,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
DomainResource domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
HostResource oldHost = persistActiveSubordinateHost(oldHostName(), domain);
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile("host_update_response.xml"));
|
||||
runFlowAssertResponse(loadFile("host_update_response.xml"));
|
||||
// The example xml doesn't do a host rename, so reloading the host should work.
|
||||
assertAboutHosts().that(reloadResourceByForeignKey())
|
||||
.hasLastSuperordinateChange(oldHost.getLastSuperordinateChange()).and()
|
||||
|
@ -439,7 +439,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
runFlowAssertResponse(
|
||||
CommitMode.LIVE,
|
||||
UserPrivileges.SUPERUSER,
|
||||
readFile("host_update_response.xml"));
|
||||
loadFile("host_update_response.xml"));
|
||||
assertAboutHosts().that(reloadResourceByForeignKey())
|
||||
.hasPersistedCurrentSponsorClientId("TheRegistrar").and()
|
||||
.hasLastTransferTime(null).and()
|
||||
|
@ -1013,7 +1013,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
runFlowAssertResponse(
|
||||
CommitMode.LIVE,
|
||||
UserPrivileges.SUPERUSER,
|
||||
readFile("host_update_response.xml"));
|
||||
loadFile("host_update_response.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1031,7 +1031,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.DRY_RUN, UserPrivileges.SUPERUSER, readFile("host_update_response.xml"));
|
||||
CommitMode.DRY_RUN, UserPrivileges.SUPERUSER, loadFile("host_update_response.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1050,7 +1050,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
.build());
|
||||
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile("host_update_response.xml"));
|
||||
runFlowAssertResponse(loadFile("host_update_response.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1086,7 +1086,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
.build());
|
||||
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile("host_update_response.xml"));
|
||||
runFlowAssertResponse(loadFile("host_update_response.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1170,7 +1170,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
.build());
|
||||
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile("host_update_response.xml"));
|
||||
runFlowAssertResponse(loadFile("host_update_response.xml"));
|
||||
}
|
||||
|
||||
private void doFailingHostNameTest(
|
||||
|
@ -1242,7 +1242,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
clock.advanceOneMilli();
|
||||
setEppInput("host_update_metadata.xml");
|
||||
eppRequestSource = EppRequestSource.TOOL;
|
||||
runFlowAssertResponse(readFile("host_update_response.xml"));
|
||||
runFlowAssertResponse(loadFile("host_update_response.xml"));
|
||||
assertAboutHistoryEntries()
|
||||
.that(getOnlyHistoryEntryOfType(
|
||||
reloadResourceByForeignKey(), HistoryEntry.Type.HOST_UPDATE))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue