Refactor EppToolVerifier to accept chaining verify commands

We're doing this to allow several new tests:
- xml files (that exist today)
- xml files with substitutions
- xml content (maybe? Currently private. Caching the files seems more readable)
- no data at all

Instead of having only one interface

eppToolVerifier.verifySent("file1.xml", "file2.xml");

we're refactoring to allow:
eppToolVerifier
  .verifySent("file1.xml")
  .verifySentAny() // we don't care about this epps
  .verifySent("file2.xml", substitutions)
  .verifyNoMoreSent();

In this case we're checking that "exactly 3 EPPs were sent, where the 1st one has content from file1.xml, and the 3rd one has the content from file2.xml, after the given substitutions were applied"

This also updates EppToolCommandTestCase to have only one EppToolVerifier, and
always finish by checking verifyNoMoreSent, meaning that in every test - all
sent epps must be accounted for (verified or skiped)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177353887
This commit is contained in:
guyben 2017-11-29 13:20:55 -08:00 committed by jianglai
parent 0e3d050dae
commit 68768a561f
20 changed files with 285 additions and 190 deletions

View file

@ -29,7 +29,7 @@ public class CreateHostCommandTest extends EppToolCommandTestCase<CreateHostComm
"--client=NewRegistrar",
"--host=example.tld",
"--addresses=162.100.102.99,2001:0db8:85a3:0000:0000:8a2e:0370:7334,4.5.6.7");
eppVerifier().verifySent("host_create_complete.xml");
eppVerifier.verifySent("host_create_complete.xml");
}
@Test
@ -38,7 +38,7 @@ public class CreateHostCommandTest extends EppToolCommandTestCase<CreateHostComm
runCommandForced(
"--client=NewRegistrar",
"--host=notours.external");
eppVerifier().verifySent("host_create_minimal.xml");
eppVerifier.verifySent("host_create_minimal.xml");
}
@Test