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:
guyben 2017-12-01 10:16:22 -08:00 committed by jianglai
parent ebfa27b3ad
commit b8970bfe1b
94 changed files with 428 additions and 449 deletions

View file

@ -51,7 +51,7 @@ public class ContactUpdateFlowTest
persistActiveContact(getUniqueIdFromCommand());
clock.advanceOneMilli();
assertTransactionalFlow(true);
runFlowAssertResponse(readFile("contact_update_response.xml"));
runFlowAssertResponse(loadFile("contact_update_response.xml"));
// Check that the contact was updated. This value came from the xml.
assertAboutContacts().that(reloadResourceByForeignKey())
.hasAuthInfoPwd("2fooBAR").and()
@ -63,7 +63,7 @@ public class ContactUpdateFlowTest
@Test
public void testDryRun() throws Exception {
persistActiveContact(getUniqueIdFromCommand());
dryRunFlowAssertResponse(readFile("contact_update_response.xml"));
dryRunFlowAssertResponse(loadFile("contact_update_response.xml"));
}
@Test
@ -94,7 +94,7 @@ public class ContactUpdateFlowTest
.hasNonNullLocalizedPostalInfo().and()
.hasNullInternationalizedPostalInfo();
runFlowAssertResponse(readFile("contact_update_response.xml"));
runFlowAssertResponse(loadFile("contact_update_response.xml"));
assertAboutContacts().that(reloadResourceByForeignKey())
.hasNullLocalizedPostalInfo().and()
.hasInternationalizedPostalInfo(new PostalInfo.Builder()
@ -133,7 +133,7 @@ public class ContactUpdateFlowTest
.hasNonNullInternationalizedPostalInfo().and()
.hasNullLocalizedPostalInfo();
runFlowAssertResponse(readFile("contact_update_response.xml"));
runFlowAssertResponse(loadFile("contact_update_response.xml"));
assertAboutContacts().that(reloadResourceByForeignKey())
.hasNullInternationalizedPostalInfo().and()
.hasLocalizedPostalInfo(new PostalInfo.Builder()
@ -168,7 +168,7 @@ public class ContactUpdateFlowTest
.build());
clock.advanceOneMilli();
// The test xml updates the address of the postal info and should leave the name untouched.
runFlowAssertResponse(readFile("contact_update_response.xml"));
runFlowAssertResponse(loadFile("contact_update_response.xml"));
assertAboutContacts().that(reloadResourceByForeignKey()).hasLocalizedPostalInfo(
new PostalInfo.Builder()
.setType(Type.LOCALIZED)
@ -220,7 +220,7 @@ public class ContactUpdateFlowTest
// internationalized postal info to the same value it previously had, which causes it to be
// preserved. If the xml had not mentioned the internationalized one at all it would have been
// deleted.
runFlowAssertResponse(readFile("contact_update_response.xml"));
runFlowAssertResponse(loadFile("contact_update_response.xml"));
assertAboutContacts().that(reloadResourceByForeignKey())
.hasLocalizedPostalInfo(
new PostalInfo.Builder()
@ -284,7 +284,7 @@ public class ContactUpdateFlowTest
runFlowAssertResponse(
CommitMode.LIVE,
UserPrivileges.SUPERUSER,
readFile("contact_update_response.xml"));
loadFile("contact_update_response.xml"));
}
@Test
@ -301,7 +301,7 @@ public class ContactUpdateFlowTest
persistActiveContact(getUniqueIdFromCommand());
clock.advanceOneMilli();
runFlowAssertResponse(
CommitMode.LIVE, UserPrivileges.SUPERUSER, readFile("contact_update_response.xml"));
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("contact_update_response.xml"));
}
@Test
@ -327,7 +327,7 @@ public class ContactUpdateFlowTest
runFlowAssertResponse(
CommitMode.LIVE,
UserPrivileges.SUPERUSER,
readFile("contact_update_response.xml"));
loadFile("contact_update_response.xml"));
assertAboutContacts().that(reloadResourceByForeignKey())
.hasStatusValue(StatusValue.CLIENT_UPDATE_PROHIBITED).and()
.hasStatusValue(StatusValue.SERVER_DELETE_PROHIBITED);