@Test @WithMockUser(authorities = { "INIT_CONFIG" }) public void getSecurityServerFindsOne() { ResponseEntity<SecurityServer> response = securityServersApiController.getSecurityServer( "XRD2:GOV:M4:server1"); assertEquals(HttpStatus.OK, response.getStatusCode()); SecurityServer securityServer = response.getBody(); assertEquals("XRD2:GOV:M4:server1", securityServer.getId()); assertEquals("XRD2", securityServer.getInstanceId()); assertEquals("GOV", securityServer.getMemberClass()); assertEquals("M4", securityServer.getMemberCode()); assertEquals("server1", securityServer.getServerCode()); assertEquals(SERVER_ADDRESS, securityServer.getServerAddress()); }
@Override @PreAuthorize("hasAuthority('INIT_CONFIG')") public ResponseEntity<SecurityServer> getSecurityServer(String encodedSecurityServerId) { SecurityServerId securityServerId = securityServerConverter.convertId(encodedSecurityServerId); if (!globalConfService.securityServerExists(securityServerId)) { throw new ResourceNotFoundException("Security server " + encodedSecurityServerId + " not found"); } SecurityServer securityServer = securityServerConverter.convert(securityServerId); return new ResponseEntity<>(securityServer, HttpStatus.OK); }
SecurityServersApiController implements SecurityServersApi { @Override @PreAuthorize("hasAuthority('INIT_CONFIG')") public ResponseEntity<SecurityServer> getSecurityServer(String encodedSecurityServerId) { SecurityServerId securityServerId = securityServerConverter.convertId(encodedSecurityServerId); if (!globalConfService.securityServerExists(securityServerId)) { throw new ResourceNotFoundException("Security server " + encodedSecurityServerId + " not found"); } SecurityServer securityServer = securityServerConverter.convert(securityServerId); return new ResponseEntity<>(securityServer, HttpStatus.OK); } }
SecurityServersApiController implements SecurityServersApi { @Override @PreAuthorize("hasAuthority('INIT_CONFIG')") public ResponseEntity<SecurityServer> getSecurityServer(String encodedSecurityServerId) { SecurityServerId securityServerId = securityServerConverter.convertId(encodedSecurityServerId); if (!globalConfService.securityServerExists(securityServerId)) { throw new ResourceNotFoundException("Security server " + encodedSecurityServerId + " not found"); } SecurityServer securityServer = securityServerConverter.convert(securityServerId); return new ResponseEntity<>(securityServer, HttpStatus.OK); } @Autowired  SecurityServersApiController(GlobalConfService globalConfService, GlobalConfFacade globalConfFacade,
            SecurityServerConverter securityServerConverter, ServerConfService serverConfService); }
SecurityServersApiController implements SecurityServersApi { @Override @PreAuthorize("hasAuthority('INIT_CONFIG')") public ResponseEntity<SecurityServer> getSecurityServer(String encodedSecurityServerId) { SecurityServerId securityServerId = securityServerConverter.convertId(encodedSecurityServerId); if (!globalConfService.securityServerExists(securityServerId)) { throw new ResourceNotFoundException("Security server " + encodedSecurityServerId + " not found"); } SecurityServer securityServer = securityServerConverter.convert(securityServerId); return new ResponseEntity<>(securityServer, HttpStatus.OK); } @Autowired  SecurityServersApiController(GlobalConfService globalConfService, GlobalConfFacade globalConfFacade,
            SecurityServerConverter securityServerConverter, ServerConfService serverConfService); @Override @PreAuthorize("hasAuthority('INIT_CONFIG')") ResponseEntity<SecurityServer> getSecurityServer(String encodedSecurityServerId); @Override @PreAuthorize("hasAuthority('VIEW_SECURITY_SERVERS')") ResponseEntity<List<SecurityServer>> getSecurityServers(Boolean currentServer); }
SecurityServersApiController implements SecurityServersApi { @Override @PreAuthorize("hasAuthority('INIT_CONFIG')") public ResponseEntity<SecurityServer> getSecurityServer(String encodedSecurityServerId) { SecurityServerId securityServerId = securityServerConverter.convertId(encodedSecurityServerId); if (!globalConfService.securityServerExists(securityServerId)) { throw new ResourceNotFoundException("Security server " + encodedSecurityServerId + " not found"); } SecurityServer securityServer = securityServerConverter.convert(securityServerId); return new ResponseEntity<>(securityServer, HttpStatus.OK); } @Autowired  SecurityServersApiController(GlobalConfService globalConfService, GlobalConfFacade globalConfFacade,
            SecurityServerConverter securityServerConverter, ServerConfService serverConfService); @Override @PreAuthorize("hasAuthority('INIT_CONFIG')") ResponseEntity<SecurityServer> getSecurityServer(String encodedSecurityServerId); @Override @PreAuthorize("hasAuthority('VIEW_SECURITY_SERVERS')") ResponseEntity<List<SecurityServer>> getSecurityServers(Boolean currentServer);  }