@Test public void pingReturnsSuccess_whenSecondTraceSucceeds() throws Exception { doReturn(ResponseEntity.ok().build()).when(restTemplate).getForEntity("http: OrderResponse response = this.subject.chargeChard(); OrderResponse expectedResponse = new OrderResponse(true, "order processed successfully"); assertThat(response, equalTo(expectedResponse)); verify(restTemplate).getForEntity("http: }
public OrderResponse chargeChard() { ResponseEntity<String> orderResponse = request(ordersHost, "/process-order"); return new OrderResponse(orderResponse); }
OrdersConnector { public OrderResponse chargeChard() { ResponseEntity<String> orderResponse = request(ordersHost, "/process-order"); return new OrderResponse(orderResponse); } }
OrdersConnector { public OrderResponse chargeChard() { ResponseEntity<String> orderResponse = request(ordersHost, "/process-order"); return new OrderResponse(orderResponse); } @Autowired  OrdersConnector(
            @Value("${orders.host}") String ordersHost,
            RestTemplate restTemplate
    ); }
OrdersConnector { public OrderResponse chargeChard() { ResponseEntity<String> orderResponse = request(ordersHost, "/process-order"); return new OrderResponse(orderResponse); } @Autowired  OrdersConnector(
            @Value("${orders.host}") String ordersHost,
            RestTemplate restTemplate
    ); OrderResponse chargeChard(); }
OrdersConnector { public OrderResponse chargeChard() { ResponseEntity<String> orderResponse = request(ordersHost, "/process-order"); return new OrderResponse(orderResponse); } @Autowired  OrdersConnector(
            @Value("${orders.host}") String ordersHost,
            RestTemplate restTemplate
    ); OrderResponse chargeChard();  }