SetRequestScopedParametersTask implements
		ReportParameterConfigurerTask { @Override public Map<String, Object> configure(ReportProps reportProps, ReportFormat reportFormat, JRDataSource datasource) { final Map<String, Object> parameters = this.requestScopedParametersProvider .getRequestScopedParameters().getParameters(); Assert.notEmpty(parameters, "RequestScopedParameters.parameters must have at least '1' element"); return parameters; } SetRequestScopedParametersTask(
			RequestScopedParametersProvider requestScopedParametersProvider); @Override Map<String, Object> configure(ReportProps reportProps,
			ReportFormat reportFormat, JRDataSource datasource);  }
@Test public void testConfigure_HTML() { final ReportFormat reportFormat = ReportFormat.HTML; RequestScopedParameters requestScopedParameters = mock(RequestScopedParameters.class); when(requestScopedParametersProvider.getRequestScopedParameters()).thenReturn(requestScopedParameters); Map<String, Object> parameters = new HashMap<>(); String key = "key"; String value = "value"; parameters.put(key, value); when(requestScopedParameters.getParameters()).thenReturn(parameters); final Map<String, Object> configure = sut.configure(reportProps, reportFormat, datasource); assertEquals(parameters,configure); }
@Test public void testConfigure_HTML_Throws_IllegalArgumentException_Parameters_Empty() { thrown.expect(IllegalArgumentException.class); final ReportFormat reportFormat = ReportFormat.HTML; RequestScopedParameters requestScopedParameters = mock(RequestScopedParameters.class); when(requestScopedParametersProvider.getRequestScopedParameters()).thenReturn(requestScopedParameters); Map<String, Object> parameters = new HashMap<>(); when(requestScopedParameters.getParameters()).thenReturn(parameters); sut.configure(reportProps, reportFormat, datasource); }
@Test public void testConfigure_HTML_Throws_IllegalArgumentException_Parameters_Null() { thrown.expect(IllegalArgumentException.class); final ReportFormat reportFormat = ReportFormat.HTML; RequestScopedParameters requestScopedParameters = mock(RequestScopedParameters.class); when(requestScopedParametersProvider.getRequestScopedParameters()).thenReturn(requestScopedParameters); when(requestScopedParameters.getParameters()).thenReturn(null); sut.configure(reportProps, reportFormat, datasource); }