ExecutorApiGateway { <T> T callForJsonType(final String host, final int port, final String path, final List<Pair<String, String>> paramList, final Class<T> valueType) throws IOException { final String responseString = callForJsonString(host, port, path, paramList); if (null == responseString || responseString.length() == 0) { return null; } return new ObjectMapper().readValue(responseString, valueType); } @Inject  ExecutorApiGateway(final ExecutorApiClient apiClient); Map<String, Object> updateExecutions(final Executor executor,
      final List<ExecutableFlow> executions);  }
@Test public void testExecutorInfoJsonParser() throws Exception { final ExecutorInfo exeInfo = new ExecutorInfo(99.9, 14095, 50, System.currentTimeMillis(), 89, 10); final String json = JSONUtils.toJSON(exeInfo); when(this.client.httpPost(any(), any())).thenReturn(json); final ExecutorInfo exeInfo2 = this.gateway .callForJsonType("localhost", 1234, "executor", null, ExecutorInfo.class); Assert.assertTrue(exeInfo.equals(exeInfo2)); }