mirror of
https://github.com/google/nomulus.git
synced 2025-07-02 17:23:32 +02:00
Refactor assertCommandAndResponse to be "fluent"
This is in preparation for automatic EPP consolidation. The assertion will now look like: assertThatCommand("file.xml"[, substitution]) .atTime(time) .hasResponse("file2.xml"[, substitution]); Also, added convenience functions for often reused commands (login and logout) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=190617505
This commit is contained in:
parent
c1ca88ac9e
commit
422ec9b97a
15 changed files with 892 additions and 1054 deletions
|
@ -37,25 +37,19 @@ public class EppLoggedOutTest extends EppTestCase {
|
|||
@Test
|
||||
public void testHello() throws Exception {
|
||||
DateTime now = DateTime.now(UTC);
|
||||
assertCommandAndResponse(
|
||||
"hello.xml",
|
||||
null,
|
||||
"greeting.xml",
|
||||
ImmutableMap.of("DATE", now.toString(dateTimeNoMillis())),
|
||||
now);
|
||||
assertThatCommand("hello.xml", null)
|
||||
.atTime(now)
|
||||
.hasResponse("greeting.xml", ImmutableMap.of("DATE", now.toString(dateTimeNoMillis())));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSyntaxError() throws Exception {
|
||||
assertCommandAndResponse(
|
||||
"syntax_error.xml",
|
||||
ImmutableMap.of(),
|
||||
"response_error_no_cltrid.xml",
|
||||
ImmutableMap.of(
|
||||
"MSG",
|
||||
"Syntax error at line 4, column 65: cvc-complex-type.3.2.2: "
|
||||
+ "Attribute 'xsi:schemaLocation' is not allowed to appear in element 'epp'.",
|
||||
"CODE",
|
||||
"2001"));
|
||||
assertThatCommand("syntax_error.xml")
|
||||
.hasResponse(
|
||||
"response_error_no_cltrid.xml",
|
||||
ImmutableMap.of(
|
||||
"CODE", "2001",
|
||||
"MSG", "Syntax error at line 4, column 65: cvc-complex-type.3.2.2: "
|
||||
+ "Attribute 'xsi:schemaLocation' is not allowed to appear in element 'epp'."));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue