JsErrorsFilter extends AbstractDataModifierJob<Set<JsErrorLog>> { @Override public void setParameters(Map<String, String> params) throws ParametersException { errorMessage = ParamsHelper.getParamAsString(PARAM_ERROR, params); errorMessagePattern = ParamsHelper.getParamAsPattern(PARAM_ERROR_PATTERN, params); line = ParamsHelper.getParamAsInteger(PARAM_LINE, params); sourceFile = ParamsHelper.getParamAsString(PARAM_SOURCE, params); sourceFilePattern = ParamsHelper.getParamAsPattern(PARAM_SOURCE_PATTERN, params); ParamsHelper.atLeastOneIsProvided( errorMessage, errorMessagePattern, sourceFile, sourceFilePattern, line); }  @Override void setParameters(Map<String, String> params); @Override Set<JsErrorLog> modifyData(Set<JsErrorLog> data); @Override String getInfo(); static final String NAME; }
@Test public void setParametersTest() throws ParametersException { params = createParams(PARAM_LINE_VALUE, PARAM_ERROR_PATTERN_VALUE, PARAM_SOURCE_VALUE, PARAM_SOURCE_PATTERN_VALUE, PARAM_ERROR_VALUE); tested.setParameters(params); }
@Test(expected = ParametersException.class) public void setParametersTest_allEmpty() throws ParametersException { params = createParams(null, null, null, null, null); tested.setParameters(params); }
@Test(expected = ParametersException.class) public void setParametersTest_lineNotANumber() throws ParametersException { params = createParams(PARAM_LINE_VALUE_NAN, null, null, null, null); tested.setParameters(params); }