Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommysitu/6943b6dd4d9d0f0c211747cc3f747971 to your computer and use it in GitHub Desktop.
Save tommysitu/6943b6dd4d9d0f0c211747cc3f747971 to your computer and use it in GitHub Desktop.
@Test
public void shouldUpgradeAccountIfPaymentIsSuccessful() throws Exception {
hoverflyRule.simulate(dsl(
service(matches("*.payment.*"))
.post("/v1/charges")
.body(equalsToJson(json(new Charge("id", 20000, GBP))))
.willReturn(success()),
service(matches("*.account.*"))
.put("/v1/account/id")
.body(equalsToJson("{\"type\":\"premium\"}"))
.willReturn(success())
));
serviceUnderTest.upgrade("id");
hoverflyRule.verifyAll();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment