@Test public void shouldReturnJSONObjectWithProperValue() { when(client.sendGetterRequest(LOGGING_STATUS_URL)).thenReturn(Optional.of(JSON_STRING)); MessageLoggingControlStatus result = messageLoggingConfiguration.getMessageLoggingStatus(); Assert.assertTrue(result == MessageLoggingControlStatus.ON); verify(client, never()).sendSetterRequest(anyString()); }
public MessageLoggingControlStatus getMessageLoggingStatus() { LOG.debug("Call message logging status API."); MessageLoggingControlStatus status = null; JSONObject o = getterRequest(STATUS_GETTER_URL_POSTFIX); if (o != null) { Boolean requestLogging = (Boolean) o.get("requestLogging"); Boolean responseLogging = (Boolean) o.get("responseLogging"); if (requestLogging && responseLogging) { status = MessageLoggingControlStatus.ON; } else { status = MessageLoggingControlStatus.OFF; } } return status; }
MessageLoggingConfiguration extends AbstractConfiguration { public MessageLoggingControlStatus getMessageLoggingStatus() { LOG.debug("Call message logging status API."); MessageLoggingControlStatus status = null; JSONObject o = getterRequest(STATUS_GETTER_URL_POSTFIX); if (o != null) { Boolean requestLogging = (Boolean) o.get("requestLogging"); Boolean responseLogging = (Boolean) o.get("responseLogging"); if (requestLogging && responseLogging) { status = MessageLoggingControlStatus.ON; } else { status = MessageLoggingControlStatus.OFF; } } return status; } }
MessageLoggingConfiguration extends AbstractConfiguration { public MessageLoggingControlStatus getMessageLoggingStatus() { LOG.debug("Call message logging status API."); MessageLoggingControlStatus status = null; JSONObject o = getterRequest(STATUS_GETTER_URL_POSTFIX); if (o != null) { Boolean requestLogging = (Boolean) o.get("requestLogging"); Boolean responseLogging = (Boolean) o.get("responseLogging"); if (requestLogging && responseLogging) { status = MessageLoggingControlStatus.ON; } else { status = MessageLoggingControlStatus.OFF; } } return status; } MessageLoggingConfiguration(WilmaServiceConfig config);  MessageLoggingConfiguration(WilmaServiceConfig config, WilmaHttpClient client); }
MessageLoggingConfiguration extends AbstractConfiguration { public MessageLoggingControlStatus getMessageLoggingStatus() { LOG.debug("Call message logging status API."); MessageLoggingControlStatus status = null; JSONObject o = getterRequest(STATUS_GETTER_URL_POSTFIX); if (o != null) { Boolean requestLogging = (Boolean) o.get("requestLogging"); Boolean responseLogging = (Boolean) o.get("responseLogging"); if (requestLogging && responseLogging) { status = MessageLoggingControlStatus.ON; } else { status = MessageLoggingControlStatus.OFF; } } return status; } MessageLoggingConfiguration(WilmaServiceConfig config);  MessageLoggingConfiguration(WilmaServiceConfig config, WilmaHttpClient client); MessageLoggingControlStatus getMessageLoggingStatus(); boolean setMessageLoggingStatus(MessageLoggingControlStatus control); }
MessageLoggingConfiguration extends AbstractConfiguration { public MessageLoggingControlStatus getMessageLoggingStatus() { LOG.debug("Call message logging status API."); MessageLoggingControlStatus status = null; JSONObject o = getterRequest(STATUS_GETTER_URL_POSTFIX); if (o != null) { Boolean requestLogging = (Boolean) o.get("requestLogging"); Boolean responseLogging = (Boolean) o.get("responseLogging"); if (requestLogging && responseLogging) { status = MessageLoggingControlStatus.ON; } else { status = MessageLoggingControlStatus.OFF; } } return status; } MessageLoggingConfiguration(WilmaServiceConfig config);  MessageLoggingConfiguration(WilmaServiceConfig config, WilmaHttpClient client); MessageLoggingControlStatus getMessageLoggingStatus(); boolean setMessageLoggingStatus(MessageLoggingControlStatus control);  }