@Test
public void shouldGetValidatedOrderOnRequest() throws Exception {

  Order orderV1 = new Order(id(1L), 2L, OrderState.CREATED, Product.JUMPERS, 10, 100d);
  OrderBean beanV1 = OrderBean.toBean(orderV1);
  final Client client = ClientBuilder.newClient();
  //Given a rest service
  rest = new OrdersService(
      new HostInfo("localhost", port)
  );
  rest.start(CLUSTER.bootstrapServers());
  //When we post an order
  client.target(paths.urlPost())
      .request(APPLICATION_JSON_TYPE)
      .post(Entity.json(beanV1));
  //Simulate the order being validated
  MicroserviceTestUtils.sendOrders(asList(
      newBuilder(orderV1)
          .setState(OrderState.VALIDATED)
          .build()));
  //When we GET the order from the returned location
  OrderBean returnedBean = client.target(paths.urlGetValidated(beanV1.getId()))
      .queryParam("timeout", MIN / 2)
      .request(APPLICATION_JSON_TYPE)
      .get(new GenericType<OrderBean>() {
      });
  //Then status should be Validated
  assertThat(returnedBean.getState()).isEqualTo(OrderState.VALIDATED);
}