@Test public void shouldReturnWithProperBooleanValueForSetterRequest() { when(client.sendSetterRequest(OPERATION_MODE_SETTER_URL_WILMA)).thenReturn(true); when(client.sendSetterRequest(OPERATION_MODE_SETTER_URL_STUB)).thenReturn(false); when(client.sendSetterRequest(OPERATION_MODE_SETTER_URL_PROXY)).thenReturn(true); assertTrue(operationConfiguration.setOperationMode(WILMA)); assertTrue(operationConfiguration.setOperationMode(PROXY)); assertFalse(operationConfiguration.setOperationMode(STUB)); verify(client, never()).sendGetterRequest(anyString()); }
public boolean setOperationMode(OperationMode mode) { LOG.debug("Call operation mode setter API with value: " + mode); String postfix = String.format(STATUS_SETTER_URL_POSTFIX_FORMAT, mode.toString().toLowerCase()); return setterRequest(postfix); }
OperationConfiguration extends AbstractConfiguration { public boolean setOperationMode(OperationMode mode) { LOG.debug("Call operation mode setter API with value: " + mode); String postfix = String.format(STATUS_SETTER_URL_POSTFIX_FORMAT, mode.toString().toLowerCase()); return setterRequest(postfix); } }
OperationConfiguration extends AbstractConfiguration { public boolean setOperationMode(OperationMode mode) { LOG.debug("Call operation mode setter API with value: " + mode); String postfix = String.format(STATUS_SETTER_URL_POSTFIX_FORMAT, mode.toString().toLowerCase()); return setterRequest(postfix); } OperationConfiguration(WilmaServiceConfig config);  OperationConfiguration(WilmaServiceConfig config, WilmaHttpClient client); }
OperationConfiguration extends AbstractConfiguration { public boolean setOperationMode(OperationMode mode) { LOG.debug("Call operation mode setter API with value: " + mode); String postfix = String.format(STATUS_SETTER_URL_POSTFIX_FORMAT, mode.toString().toLowerCase()); return setterRequest(postfix); } OperationConfiguration(WilmaServiceConfig config);  OperationConfiguration(WilmaServiceConfig config, WilmaHttpClient client); OperationMode getOperationMode(); boolean setOperationMode(OperationMode mode); }
OperationConfiguration extends AbstractConfiguration { public boolean setOperationMode(OperationMode mode) { LOG.debug("Call operation mode setter API with value: " + mode); String postfix = String.format(STATUS_SETTER_URL_POSTFIX_FORMAT, mode.toString().toLowerCase()); return setterRequest(postfix); } OperationConfiguration(WilmaServiceConfig config);  OperationConfiguration(WilmaServiceConfig config, WilmaHttpClient client); OperationMode getOperationMode(); boolean setOperationMode(OperationMode mode);  }