mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 08:57:12 +02:00
Consolidate some domain creation / deletion EPPs in testdata
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=183847223
This commit is contained in:
parent
169fd62da7
commit
4b23523d74
32 changed files with 266 additions and 316 deletions
|
@ -73,7 +73,7 @@ public class EppTestCase extends ShardableTestCase {
|
|||
}
|
||||
|
||||
String assertCommandAndResponse(String inputFilename, String outputFilename) throws Exception {
|
||||
return assertCommandAndResponse(inputFilename, outputFilename, DateTime.now(UTC));
|
||||
return assertCommandAndResponse(inputFilename, null, outputFilename, null);
|
||||
}
|
||||
|
||||
String assertCommandAndResponse(String inputFilename, String outputFilename, DateTime now)
|
||||
|
@ -81,23 +81,36 @@ public class EppTestCase extends ShardableTestCase {
|
|||
return assertCommandAndResponse(inputFilename, null, outputFilename, null, now);
|
||||
}
|
||||
|
||||
String assertCommandAndResponse(
|
||||
String inputFilename,
|
||||
Map<String, String> inputSubstitutions,
|
||||
String outputFilename,
|
||||
Map<String, String> outputSubstitutions)
|
||||
throws Exception {
|
||||
return assertCommandAndResponse(
|
||||
inputFilename, inputSubstitutions, outputFilename, outputSubstitutions, DateTime.now(UTC));
|
||||
}
|
||||
|
||||
String assertCommandAndResponse(
|
||||
String inputFilename,
|
||||
Map<String, String> inputSubstitutions,
|
||||
String outputFilename,
|
||||
Map<String, String> outputSubstitutions,
|
||||
DateTime now) throws Exception {
|
||||
DateTime now)
|
||||
throws Exception {
|
||||
clock.setTo(now);
|
||||
String input = loadFile(getClass(), inputFilename, inputSubstitutions);
|
||||
String expectedOutput = loadFile(getClass(), outputFilename, outputSubstitutions);
|
||||
if (sessionMetadata == null) {
|
||||
sessionMetadata = new HttpSessionMetadata(new FakeHttpSession()) {
|
||||
@Override
|
||||
public void invalidate() {
|
||||
// When a session is invalidated, reset the sessionMetadata field.
|
||||
super.invalidate();
|
||||
EppTestCase.this.sessionMetadata = null;
|
||||
}};
|
||||
sessionMetadata =
|
||||
new HttpSessionMetadata(new FakeHttpSession()) {
|
||||
@Override
|
||||
public void invalidate() {
|
||||
// When a session is invalidated, reset the sessionMetadata field.
|
||||
super.invalidate();
|
||||
EppTestCase.this.sessionMetadata = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
String actualOutput = executeXmlCommand(input);
|
||||
assertXmlEqualsWithMessage(
|
||||
|
@ -106,7 +119,7 @@ public class EppTestCase extends ShardableTestCase {
|
|||
"Running " + inputFilename + " => " + outputFilename,
|
||||
"epp.response.resData.infData.roid",
|
||||
"epp.response.trID.svTRID");
|
||||
ofy().clearSessionCache(); // Clear the cache like OfyFilter would.
|
||||
ofy().clearSessionCache(); // Clear the cache like OfyFilter would.
|
||||
return actualOutput;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue