Consolidate generic success response XMLs in unit tests

EPP reuses the same generic "Command completed successfully" response with
result code 1000 for many different operations. There's no need to have separate
XML files for all of these different operations given that the response is the
same.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202010442
This commit is contained in:
mcilwain 2018-06-25 13:37:40 -07:00 committed by Ben McIlwain
parent ed910455b0
commit a4ebdc7622
25 changed files with 76 additions and 182 deletions

View file

@ -55,7 +55,7 @@ public class ContactUpdateFlowTest
persistActiveContact(getUniqueIdFromCommand());
clock.advanceOneMilli();
assertTransactionalFlow(true);
runFlowAssertResponse(loadFile("contact_update_response.xml"));
runFlowAssertResponse(loadFile("generic_success_response.xml"));
// Check that the contact was updated. This value came from the xml.
assertAboutContacts().that(reloadResourceByForeignKey())
.hasAuthInfoPwd("2fooBAR").and()
@ -67,7 +67,7 @@ public class ContactUpdateFlowTest
@Test
public void testDryRun() throws Exception {
persistActiveContact(getUniqueIdFromCommand());
dryRunFlowAssertResponse(loadFile("contact_update_response.xml"));
dryRunFlowAssertResponse(loadFile("generic_success_response.xml"));
}
@Test
@ -98,7 +98,7 @@ public class ContactUpdateFlowTest
.hasNonNullLocalizedPostalInfo().and()
.hasNullInternationalizedPostalInfo();
runFlowAssertResponse(loadFile("contact_update_response.xml"));
runFlowAssertResponse(loadFile("generic_success_response.xml"));
assertAboutContacts().that(reloadResourceByForeignKey())
.hasNullLocalizedPostalInfo().and()
.hasInternationalizedPostalInfo(new PostalInfo.Builder()
@ -137,7 +137,7 @@ public class ContactUpdateFlowTest
.hasNonNullInternationalizedPostalInfo().and()
.hasNullLocalizedPostalInfo();
runFlowAssertResponse(loadFile("contact_update_response.xml"));
runFlowAssertResponse(loadFile("generic_success_response.xml"));
assertAboutContacts().that(reloadResourceByForeignKey())
.hasNullInternationalizedPostalInfo().and()
.hasLocalizedPostalInfo(new PostalInfo.Builder()
@ -172,7 +172,7 @@ public class ContactUpdateFlowTest
.build());
clock.advanceOneMilli();
// The test xml updates the address of the postal info and should leave the name untouched.
runFlowAssertResponse(loadFile("contact_update_response.xml"));
runFlowAssertResponse(loadFile("generic_success_response.xml"));
assertAboutContacts().that(reloadResourceByForeignKey()).hasLocalizedPostalInfo(
new PostalInfo.Builder()
.setType(Type.LOCALIZED)
@ -224,7 +224,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(loadFile("contact_update_response.xml"));
runFlowAssertResponse(loadFile("generic_success_response.xml"));
assertAboutContacts().that(reloadResourceByForeignKey())
.hasLocalizedPostalInfo(
new PostalInfo.Builder()
@ -286,7 +286,7 @@ public class ContactUpdateFlowTest
persistActiveContact(getUniqueIdFromCommand());
clock.advanceOneMilli();
runFlowAssertResponse(
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("contact_update_response.xml"));
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("generic_success_response.xml"));
}
@Test
@ -303,7 +303,7 @@ public class ContactUpdateFlowTest
persistActiveContact(getUniqueIdFromCommand());
clock.advanceOneMilli();
runFlowAssertResponse(
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("contact_update_response.xml"));
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("generic_success_response.xml"));
}
@Test
@ -330,7 +330,7 @@ public class ContactUpdateFlowTest
.build());
clock.advanceOneMilli();
runFlowAssertResponse(
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("contact_update_response.xml"));
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("generic_success_response.xml"));
assertAboutContacts()
.that(reloadResourceByForeignKey())
.hasStatusValue(StatusValue.CLIENT_UPDATE_PROHIBITED)