@Test(expected = IllegalStateException.class) public void shouldNotSaveResponseBodyInVariable() { Mockito.when(webServiceConnector.getBody()).thenThrow(new ValidationException()); final ExecuteResult result = action.execute(connectors); Assert.assertFalse(result.isSuccess()); Assert.assertNull(variableStore.getStore().get("var")); variableStore.get("var"); }
@Override public ExecuteResult execute(ConnectorManager connector) { final WebServiceConnector webServiceConnector = connector.getConnector(WebServiceConnector.class); final VariableStoreConnector variableStore = connector.getConnector(VariableStoreConnector.class); try { final String body = webServiceConnector.getBody(); variableStore.set(name, body); LOGGER.info(LoggerMarkers.LEARNER, "Set variable '{}' to HTTP body.", name); return getSuccessOutput(); } catch (Exception e) { LOGGER.info(LoggerMarkers.LEARNER, "Could not set variable '{}' to HTTP body.", name); return getFailedOutput(); } }
SetVariableByHttpResponseAction extends SymbolAction { @Override public ExecuteResult execute(ConnectorManager connector) { final WebServiceConnector webServiceConnector = connector.getConnector(WebServiceConnector.class); final VariableStoreConnector variableStore = connector.getConnector(VariableStoreConnector.class); try { final String body = webServiceConnector.getBody(); variableStore.set(name, body); LOGGER.info(LoggerMarkers.LEARNER, "Set variable '{}' to HTTP body.", name); return getSuccessOutput(); } catch (Exception e) { LOGGER.info(LoggerMarkers.LEARNER, "Could not set variable '{}' to HTTP body.", name); return getFailedOutput(); } } }
SetVariableByHttpResponseAction extends SymbolAction { @Override public ExecuteResult execute(ConnectorManager connector) { final WebServiceConnector webServiceConnector = connector.getConnector(WebServiceConnector.class); final VariableStoreConnector variableStore = connector.getConnector(VariableStoreConnector.class); try { final String body = webServiceConnector.getBody(); variableStore.set(name, body); LOGGER.info(LoggerMarkers.LEARNER, "Set variable '{}' to HTTP body.", name); return getSuccessOutput(); } catch (Exception e) { LOGGER.info(LoggerMarkers.LEARNER, "Could not set variable '{}' to HTTP body.", name); return getFailedOutput(); } }  }
SetVariableByHttpResponseAction extends SymbolAction { @Override public ExecuteResult execute(ConnectorManager connector) { final WebServiceConnector webServiceConnector = connector.getConnector(WebServiceConnector.class); final VariableStoreConnector variableStore = connector.getConnector(VariableStoreConnector.class); try { final String body = webServiceConnector.getBody(); variableStore.set(name, body); LOGGER.info(LoggerMarkers.LEARNER, "Set variable '{}' to HTTP body.", name); return getSuccessOutput(); } catch (Exception e) { LOGGER.info(LoggerMarkers.LEARNER, "Could not set variable '{}' to HTTP body.", name); return getFailedOutput(); } }  @Override ExecuteResult execute(ConnectorManager connector); String getName(); void setName(String name); }
SetVariableByHttpResponseAction extends SymbolAction { @Override public ExecuteResult execute(ConnectorManager connector) { final WebServiceConnector webServiceConnector = connector.getConnector(WebServiceConnector.class); final VariableStoreConnector variableStore = connector.getConnector(VariableStoreConnector.class); try { final String body = webServiceConnector.getBody(); variableStore.set(name, body); LOGGER.info(LoggerMarkers.LEARNER, "Set variable '{}' to HTTP body.", name); return getSuccessOutput(); } catch (Exception e) { LOGGER.info(LoggerMarkers.LEARNER, "Could not set variable '{}' to HTTP body.", name); return getFailedOutput(); } }  @Override ExecuteResult execute(ConnectorManager connector); String getName(); void setName(String name);  }