use of com.qcadoo.mes.basic.controllers.BasicController in project mes by qcadoo.
the class BasicControllerTest method shouldPrepareViewForParameters.
@Test
public void shouldPrepareViewForParameters() throws Exception {
// // given
Map<String, String> arguments = ImmutableMap.of("context", "{\"form.id\":\"13\"}");
ModelAndView expectedMav = mock(ModelAndView.class);
CrudService crudController = mock(CrudService.class);
given(crudController.prepareView(BasicConstants.PLUGIN_IDENTIFIER, BasicConstants.VIEW_GENERAL_PARAMETERS, arguments, Locale.ENGLISH)).willReturn(expectedMav);
ParameterService parameterService = mock(ParameterService.class);
given(parameterService.getParameterId()).willReturn(13L);
BasicController basicController = new BasicController();
setField(basicController, "crudService", crudController);
setField(basicController, "parameterService", parameterService);
// // when
ModelAndView mav = basicController.getGeneralParameterPageView(Locale.ENGLISH);
// // then
assertEquals(expectedMav, mav);
}
Aggregations