@Test public void shouldSave() throws Exception { List<VaccineIvdTabVisibility> list = asList(new VaccineIvdTabVisibility()); VaccineServiceConfigDTO dto = new VaccineServiceConfigDTO(); dto.setTabVisibilitySettings(list); dto.setProgramId(2L); ResponseEntity<OpenLmisResponse> response = controller.save( dto); verify(service).save(list, dto.getProgramId()); assertThat(response.getBody().getData().get("visibilities"), is(notNullValue())); }
@RequestMapping(value = "save-tab-visibility") public ResponseEntity<OpenLmisResponse> save(@RequestBody VaccineServiceConfigDTO settings) { service.save(settings.getTabVisibilitySettings(), settings.getProgramId()); return OpenLmisResponse.response(VISIBILITIES, settings); }
ConfigurationController { @RequestMapping(value = "save-tab-visibility") public ResponseEntity<OpenLmisResponse> save(@RequestBody VaccineServiceConfigDTO settings) { service.save(settings.getTabVisibilitySettings(), settings.getProgramId()); return OpenLmisResponse.response(VISIBILITIES, settings); } }
ConfigurationController { @RequestMapping(value = "save-tab-visibility") public ResponseEntity<OpenLmisResponse> save(@RequestBody VaccineServiceConfigDTO settings) { service.save(settings.getTabVisibilitySettings(), settings.getProgramId()); return OpenLmisResponse.response(VISIBILITIES, settings); }  }
ConfigurationController { @RequestMapping(value = "save-tab-visibility") public ResponseEntity<OpenLmisResponse> save(@RequestBody VaccineServiceConfigDTO settings) { service.save(settings.getTabVisibilitySettings(), settings.getProgramId()); return OpenLmisResponse.response(VISIBILITIES, settings); }  @RequestMapping(value = "tab-visibility/{programId}") ResponseEntity<OpenLmisResponse> getProgramTabVisibility(@PathVariable Long programId); @RequestMapping(value = "save-tab-visibility") ResponseEntity<OpenLmisResponse> save(@RequestBody VaccineServiceConfigDTO settings); }
ConfigurationController { @RequestMapping(value = "save-tab-visibility") public ResponseEntity<OpenLmisResponse> save(@RequestBody VaccineServiceConfigDTO settings) { service.save(settings.getTabVisibilitySettings(), settings.getProgramId()); return OpenLmisResponse.response(VISIBILITIES, settings); }  @RequestMapping(value = "tab-visibility/{programId}") ResponseEntity<OpenLmisResponse> getProgramTabVisibility(@PathVariable Long programId); @RequestMapping(value = "save-tab-visibility") ResponseEntity<OpenLmisResponse> save(@RequestBody VaccineServiceConfigDTO settings); static final String VISIBILITIES; }