Created
July 5, 2017 11:45
-
-
Save tommysitu/6943b6dd4d9d0f0c211747cc3f747971 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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