BAEL-554 - Logging Spring Web Request
This commit is contained in:
parent
34dc48c2e5
commit
7fdab0e191
|
@ -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<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);
|
||||
TaxiRide taxiRide = new TaxiRide(true, 10l);
|
||||
String fare = testRestTemplate.postForObject(URL + "calculate/", taxiRide, String.class);
|
||||
|
||||
assertThat(fare, equalTo("200"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue