@Test(expected = OnrampException.class) public void ioError() throws Exception { stubFor(post(urlEqualTo("/onramp/v1/roads/" + TEST_ROAD + "/messages")) .willReturn(aResponse().withFault(Fault.RANDOM_DATA_THEN_CLOSE))); SimpleModel messageModel = new SimpleModel(); messageModel.setId(1L); messageModel.setStr("test message"); underTest.sendMessage(messageModel); }
@Override public StandardResponse sendMessage(T message) { return sendMessages(singletonList(message)).get(0); }
SimpleRoadClient implements RoadClient<T> { @Override public StandardResponse sendMessage(T message) { return sendMessages(singletonList(message)).get(0); } }
SimpleRoadClient implements RoadClient<T> { @Override public StandardResponse sendMessage(T message) { return sendMessages(singletonList(message)).get(0); } @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(String host, String username, String password, String roadName); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(String host, String username, String password, String roadName, int threads); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(String host, String username, String password, String roadName, ObjectMapper objectMapper); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(
      String host,
      String username,
      String password,
      String roadName,
      int threads,
      ObjectMapper objectMapper); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(
      String host,
      String username,
      String password,
      String roadName,
      int threads,
      TLSConfig tlsConfig); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(
      String host,
      String username,
      String password,
      String roadName,
      int threads,
      TLSConfig tlsConfig,
      ObjectMapper objectMapper);  SimpleRoadClient(OnrampOptions options); }
SimpleRoadClient implements RoadClient<T> { @Override public StandardResponse sendMessage(T message) { return sendMessages(singletonList(message)).get(0); } @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(String host, String username, String password, String roadName); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(String host, String username, String password, String roadName, int threads); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(String host, String username, String password, String roadName, ObjectMapper objectMapper); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(
      String host,
      String username,
      String password,
      String roadName,
      int threads,
      ObjectMapper objectMapper); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(
      String host,
      String username,
      String password,
      String roadName,
      int threads,
      TLSConfig tlsConfig); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(
      String host,
      String username,
      String password,
      String roadName,
      int threads,
      TLSConfig tlsConfig,
      ObjectMapper objectMapper);  SimpleRoadClient(OnrampOptions options); @Override StandardResponse sendMessage(T message); @Override List<StandardResponse> sendMessages(List<T> messages); String errorResponseAsString(HttpResponse response); @Override void close(); }
SimpleRoadClient implements RoadClient<T> { @Override public StandardResponse sendMessage(T message) { return sendMessages(singletonList(message)).get(0); } @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(String host, String username, String password, String roadName); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(String host, String username, String password, String roadName, int threads); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(String host, String username, String password, String roadName, ObjectMapper objectMapper); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(
      String host,
      String username,
      String password,
      String roadName,
      int threads,
      ObjectMapper objectMapper); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(
      String host,
      String username,
      String password,
      String roadName,
      int threads,
      TLSConfig tlsConfig); @Deprecated /** @deprecated Use {@link #SimpleRoadClient(OnrampOptions)} */  SimpleRoadClient(
      String host,
      String username,
      String password,
      String roadName,
      int threads,
      TLSConfig tlsConfig,
      ObjectMapper objectMapper);  SimpleRoadClient(OnrampOptions options); @Override StandardResponse sendMessage(T message); @Override List<StandardResponse> sendMessages(List<T> messages); String errorResponseAsString(HttpResponse response); @Override void close();  }