HeaderModifier implements CollectorJob { @Override public void setParameters(Map<String, String> params) throws ParametersException { if (params.containsKey(PARAM_KEY) && params.containsKey(PARAM_VALUE)) { key = params.get(PARAM_KEY); value = params.get(PARAM_VALUE); } else { throw new ParametersException("Missing Key or Value on Header Modifier"); } if (params.containsKey(PARAM_OVERRIDE)) { override = Boolean.parseBoolean(params.get(PARAM_OVERRIDE)); } else { override = false; } } HeaderModifier(WebCommunicationWrapper webCommunicationWrapper); @Override CollectorStepResult collect(); @Override void setParameters(Map<String, String> params); static final String NAME; }
@Test(expected = ParametersException.class) public void testSetParameters_invalid() throws Exception { headerModifier.setParameters(ImmutableMap.of("key", "header")); }