@Test public void shouldGetProgramTabVisibility() throws Exception { List<VaccineIvdTabVisibility> list = asList(new VaccineIvdTabVisibility()); when(service.getVisibilityForProgram(2L)).thenReturn( list ); ResponseEntity<OpenLmisResponse> response = controller.getProgramTabVisibility(2L); verify(service).getVisibilityForProgram(2L); assertThat(response.getBody().getData().get("visibilities"), is(notNullValue())); }
@RequestMapping(value = "tab-visibility/{programId}") public ResponseEntity<OpenLmisResponse> getProgramTabVisibility(@PathVariable Long programId) { VaccineServiceConfigDTO dto = new VaccineServiceConfigDTO(); dto.setTabVisibilitySettings(service.getVisibilityForProgram(programId)); dto.setProgramId(programId); return OpenLmisResponse.response(VISIBILITIES, dto); }
ConfigurationController { @RequestMapping(value = "tab-visibility/{programId}") public ResponseEntity<OpenLmisResponse> getProgramTabVisibility(@PathVariable Long programId) { VaccineServiceConfigDTO dto = new VaccineServiceConfigDTO(); dto.setTabVisibilitySettings(service.getVisibilityForProgram(programId)); dto.setProgramId(programId); return OpenLmisResponse.response(VISIBILITIES, dto); } }
ConfigurationController { @RequestMapping(value = "tab-visibility/{programId}") public ResponseEntity<OpenLmisResponse> getProgramTabVisibility(@PathVariable Long programId) { VaccineServiceConfigDTO dto = new VaccineServiceConfigDTO(); dto.setTabVisibilitySettings(service.getVisibilityForProgram(programId)); dto.setProgramId(programId); return OpenLmisResponse.response(VISIBILITIES, dto); }  }
ConfigurationController { @RequestMapping(value = "tab-visibility/{programId}") public ResponseEntity<OpenLmisResponse> getProgramTabVisibility(@PathVariable Long programId) { VaccineServiceConfigDTO dto = new VaccineServiceConfigDTO(); dto.setTabVisibilitySettings(service.getVisibilityForProgram(programId)); dto.setProgramId(programId); return OpenLmisResponse.response(VISIBILITIES, dto); }  @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 = "tab-visibility/{programId}") public ResponseEntity<OpenLmisResponse> getProgramTabVisibility(@PathVariable Long programId) { VaccineServiceConfigDTO dto = new VaccineServiceConfigDTO(); dto.setTabVisibilitySettings(service.getVisibilityForProgram(programId)); dto.setProgramId(programId); return OpenLmisResponse.response(VISIBILITIES, dto); }  @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; }