diff --git a/spring-rest/src/test/java/com/baeldung/web/log/test/TestTaxiFareController.java b/spring-rest/src/test/java/com/baeldung/web/log/test/TestTaxiFareController.java index 935275983f..398e3c04e9 100644 --- a/spring-rest/src/test/java/com/baeldung/web/log/test/TestTaxiFareController.java +++ b/spring-rest/src/test/java/com/baeldung/web/log/test/TestTaxiFareController.java @@ -13,21 +13,21 @@ import com.baeldung.web.log.data.TaxiRide; 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 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); + TaxiRide taxiRide = new TaxiRide(true, 10l); + String fare = testRestTemplate.postForObject(URL + "calculate/", taxiRide, String.class); + assertThat(fare, equalTo("200")); } - - }