@Test public void shouldReturnWithProperValueProxy() { when(client.sendGetterRequest(OPERATION_MODE_STATUS_URL)).thenReturn(Optional.of(JSON_STRING_PROXY_MODE)); OperationMode result = operationConfiguration.getOperationMode(); assertTrue(result == OperationMode.PROXY, "The operation mode should be PROXY."); verify(client, never()).sendSetterRequest(anyString()); }
public OperationMode getOperationMode() { LOG.debug("Call operation status API."); OperationMode status = null; JSONObject o = getterRequest(STATUS_GETTER_URL_POSTFIX); if (o != null) { Boolean proxyMode = (Boolean) o.get("proxyMode"); Boolean stubMode = (Boolean) o.get("stubMode"); Boolean wilmaMode = (Boolean) o.get("wilmaMode"); if (proxyMode) { status = OperationMode.PROXY; } if (stubMode) { status = OperationMode.STUB; } if (wilmaMode) { status = OperationMode.WILMA; } } return status; }
OperationConfiguration extends AbstractConfiguration { public OperationMode getOperationMode() { LOG.debug("Call operation status API."); OperationMode status = null; JSONObject o = getterRequest(STATUS_GETTER_URL_POSTFIX); if (o != null) { Boolean proxyMode = (Boolean) o.get("proxyMode"); Boolean stubMode = (Boolean) o.get("stubMode"); Boolean wilmaMode = (Boolean) o.get("wilmaMode"); if (proxyMode) { status = OperationMode.PROXY; } if (stubMode) { status = OperationMode.STUB; } if (wilmaMode) { status = OperationMode.WILMA; } } return status; } }
OperationConfiguration extends AbstractConfiguration { public OperationMode getOperationMode() { LOG.debug("Call operation status API."); OperationMode status = null; JSONObject o = getterRequest(STATUS_GETTER_URL_POSTFIX); if (o != null) { Boolean proxyMode = (Boolean) o.get("proxyMode"); Boolean stubMode = (Boolean) o.get("stubMode"); Boolean wilmaMode = (Boolean) o.get("wilmaMode"); if (proxyMode) { status = OperationMode.PROXY; } if (stubMode) { status = OperationMode.STUB; } if (wilmaMode) { status = OperationMode.WILMA; } } return status; } OperationConfiguration(WilmaServiceConfig config);  OperationConfiguration(WilmaServiceConfig config, WilmaHttpClient client); }
OperationConfiguration extends AbstractConfiguration { public OperationMode getOperationMode() { LOG.debug("Call operation status API."); OperationMode status = null; JSONObject o = getterRequest(STATUS_GETTER_URL_POSTFIX); if (o != null) { Boolean proxyMode = (Boolean) o.get("proxyMode"); Boolean stubMode = (Boolean) o.get("stubMode"); Boolean wilmaMode = (Boolean) o.get("wilmaMode"); if (proxyMode) { status = OperationMode.PROXY; } if (stubMode) { status = OperationMode.STUB; } if (wilmaMode) { status = OperationMode.WILMA; } } return status; } OperationConfiguration(WilmaServiceConfig config);  OperationConfiguration(WilmaServiceConfig config, WilmaHttpClient client); OperationMode getOperationMode(); boolean setOperationMode(OperationMode mode); }
OperationConfiguration extends AbstractConfiguration { public OperationMode getOperationMode() { LOG.debug("Call operation status API."); OperationMode status = null; JSONObject o = getterRequest(STATUS_GETTER_URL_POSTFIX); if (o != null) { Boolean proxyMode = (Boolean) o.get("proxyMode"); Boolean stubMode = (Boolean) o.get("stubMode"); Boolean wilmaMode = (Boolean) o.get("wilmaMode"); if (proxyMode) { status = OperationMode.PROXY; } if (stubMode) { status = OperationMode.STUB; } if (wilmaMode) { status = OperationMode.WILMA; } } return status; } OperationConfiguration(WilmaServiceConfig config);  OperationConfiguration(WilmaServiceConfig config, WilmaHttpClient client); OperationMode getOperationMode(); boolean setOperationMode(OperationMode mode);  }