Logging Spring Web Request
@@ -15,19 +15,19 @@ public class TestTaxiFareController {
private static final String URL = "http://localhost:" + 8082 + "/spring-rest/taxifare/";
@Test
- public void givenRequest_thenfetchTaxiFareRateCard() {
+ public void givenRequest_whenFetchTaxiFareRateCard_thanOK() {
TestRestTemplate testRestTemplate = new TestRestTemplate();
ResponseEntity<String> response = testRestTemplate.getForEntity(URL + "get/", String.class);
+
assertThat(response.getStatusCode(), equalTo(HttpStatus.OK));
}
@Test
- public void givenTaxiRide_thenGetCalculatedFare() {
+ public void givenTaxiRide_whenCalculatedFare_thanStatus200() {
TestRestTemplate testRestTemplate = new TestRestTemplate();
TaxiRide taxiRide = new TaxiRide(true, 10l);
String fare = testRestTemplate.postForObject(URL + "calculate/", taxiRide, String.class);
+
assertThat(fare, equalTo("200"));
}
-
-
}
