@Test public void testCallToSpecialServices() { String queryString = "blah"; when(client.sendGetterRequest(SERVICE_URL + queryString)).thenReturn(Optional.of("{\"unknownRequest\":\"blah\"}")); JSONObject o = wilmaApplication.callGetService(queryString); verify(client, never()).sendSetterRequest(anyString()); Assert.assertTrue("Wilma Special Service Call is wrong.", o != null); }
public JSONObject callGetService(final String serviceQueryString) { LOG.debug("Call special service with request: " + serviceQueryString); String url = buildUrl(SERVICE_URL_POSTFIX + serviceQueryString); JSONObject jsonObject = null; LOG.debug("Send getter request to: " + url); Optional<String> response = wilmaClient.sendGetterRequest(url); if (response.isPresent()) { jsonObject = new JSONObject(response.get()); } return jsonObject; }
WilmaApplication { public JSONObject callGetService(final String serviceQueryString) { LOG.debug("Call special service with request: " + serviceQueryString); String url = buildUrl(SERVICE_URL_POSTFIX + serviceQueryString); JSONObject jsonObject = null; LOG.debug("Send getter request to: " + url); Optional<String> response = wilmaClient.sendGetterRequest(url); if (response.isPresent()) { jsonObject = new JSONObject(response.get()); } return jsonObject; } }
WilmaApplication { public JSONObject callGetService(final String serviceQueryString) { LOG.debug("Call special service with request: " + serviceQueryString); String url = buildUrl(SERVICE_URL_POSTFIX + serviceQueryString); JSONObject jsonObject = null; LOG.debug("Send getter request to: " + url); Optional<String> response = wilmaClient.sendGetterRequest(url); if (response.isPresent()) { jsonObject = new JSONObject(response.get()); } return jsonObject; } WilmaApplication(WilmaServiceConfig config);  WilmaApplication(WilmaServiceConfig config, WilmaHttpClient client); }
WilmaApplication { public JSONObject callGetService(final String serviceQueryString) { LOG.debug("Call special service with request: " + serviceQueryString); String url = buildUrl(SERVICE_URL_POSTFIX + serviceQueryString); JSONObject jsonObject = null; LOG.debug("Send getter request to: " + url); Optional<String> response = wilmaClient.sendGetterRequest(url); if (response.isPresent()) { jsonObject = new JSONObject(response.get()); } return jsonObject; } WilmaApplication(WilmaServiceConfig config);  WilmaApplication(WilmaServiceConfig config, WilmaHttpClient client); String getVersionInformation(); WilmaLoadInformation getActualLoadInformation(); boolean shutdownApplication(); JSONObject callGetService(final String serviceQueryString); }
WilmaApplication { public JSONObject callGetService(final String serviceQueryString) { LOG.debug("Call special service with request: " + serviceQueryString); String url = buildUrl(SERVICE_URL_POSTFIX + serviceQueryString); JSONObject jsonObject = null; LOG.debug("Send getter request to: " + url); Optional<String> response = wilmaClient.sendGetterRequest(url); if (response.isPresent()) { jsonObject = new JSONObject(response.get()); } return jsonObject; } WilmaApplication(WilmaServiceConfig config);  WilmaApplication(WilmaServiceConfig config, WilmaHttpClient client); String getVersionInformation(); WilmaLoadInformation getActualLoadInformation(); boolean shutdownApplication(); JSONObject callGetService(final String serviceQueryString);  }