@Test(expected = ClientHandlerException.class) public void testGet_ClientHandlerException_caused() { ClientHandlerException ex = new ClientHandlerException(); ex.initCause(new java.net.ConnectException()); when(client.get(any(String.class), Mockito.<MultivaluedMap<String, String>>any())).thenThrow(ex); connection.get(PATH, params); }
@Nullable public JsonRestClientResponse get(String path, MultivaluedMap<String, String> params) { if (!isInitialized()) { throw new IllegalStateException(EX_MSG_NOT_INITIALIZED); } try { JsonRestClientResponse responce = client.get(path, params); Preconditions.checkNotNull(responce); return responce; } catch (ClientHandlerException e) { processClientHandlerException(e); } return null; }
SFlowRTConnection { @Nullable public JsonRestClientResponse get(String path, MultivaluedMap<String, String> params) { if (!isInitialized()) { throw new IllegalStateException(EX_MSG_NOT_INITIALIZED); } try { JsonRestClientResponse responce = client.get(path, params); Preconditions.checkNotNull(responce); return responce; } catch (ClientHandlerException e) { processClientHandlerException(e); } return null; } }
SFlowRTConnection { @Nullable public JsonRestClientResponse get(String path, MultivaluedMap<String, String> params) { if (!isInitialized()) { throw new IllegalStateException(EX_MSG_NOT_INITIALIZED); } try { JsonRestClientResponse responce = client.get(path, params); Preconditions.checkNotNull(responce); return responce; } catch (ClientHandlerException e) { processClientHandlerException(e); } return null; } SFlowRTConnection(ScheduledExecutorService executor, String collectorUri, FlowCache flowCache, JsonRestClient client); }
SFlowRTConnection { @Nullable public JsonRestClientResponse get(String path, MultivaluedMap<String, String> params) { if (!isInitialized()) { throw new IllegalStateException(EX_MSG_NOT_INITIALIZED); } try { JsonRestClientResponse responce = client.get(path, params); Preconditions.checkNotNull(responce); return responce; } catch (ClientHandlerException e) { processClientHandlerException(e); } return null; } SFlowRTConnection(ScheduledExecutorService executor, String collectorUri, FlowCache flowCache, JsonRestClient client); @Nullable String getJsonResponse(String path, MultivaluedMap<String, String> params); @Nullable JsonRestClientResponse get(String path,
            MultivaluedMap<String, String> params); @Nullable JsonRestClientResponse put(String path, String someJson); JsonRestClientResponse delete(String path); boolean isInitialized(); FlowCache getFlowCache(); ScheduledExecutorService getExecutor(); String getCollectorUri(); void initialize(); }
SFlowRTConnection { @Nullable public JsonRestClientResponse get(String path, MultivaluedMap<String, String> params) { if (!isInitialized()) { throw new IllegalStateException(EX_MSG_NOT_INITIALIZED); } try { JsonRestClientResponse responce = client.get(path, params); Preconditions.checkNotNull(responce); return responce; } catch (ClientHandlerException e) { processClientHandlerException(e); } return null; } SFlowRTConnection(ScheduledExecutorService executor, String collectorUri, FlowCache flowCache, JsonRestClient client); @Nullable String getJsonResponse(String path, MultivaluedMap<String, String> params); @Nullable JsonRestClientResponse get(String path,
            MultivaluedMap<String, String> params); @Nullable JsonRestClientResponse put(String path, String someJson); JsonRestClientResponse delete(String path); boolean isInitialized(); FlowCache getFlowCache(); ScheduledExecutorService getExecutor(); String getCollectorUri(); void initialize();  }