@Test(expected = ResourceNotFoundException.class) @WithMockUser(authorities = { "INIT_CONFIG" }) public void getSecurityServerNoMatch() { securityServersApiController.getSecurityServer("XRD2:GOV:M4:server-does-not-exist"); }
@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);  }