@Test @WithMockUser(authorities = { "VIEW_SECURITY_SERVERS" }) public void getAllSecurityServers() { ResponseEntity<List<SecurityServer>> response = securityServersApiController .getSecurityServers(false); assertEquals(HttpStatus.OK, response.getStatusCode()); List<SecurityServer> securityServers = response.getBody(); assertEquals(2, securityServers.size()); }
@Override @PreAuthorize("hasAuthority('VIEW_SECURITY_SERVERS')") public ResponseEntity<List<SecurityServer>> getSecurityServers(Boolean currentServer) { boolean getOnlyCurrentServer = Boolean.TRUE.equals(currentServer); List<SecurityServer> securityServers = null; if (getOnlyCurrentServer) { SecurityServerId currentSecurityServerId = serverConfService.getSecurityServerId(); SecurityServer currentSecurityServer = securityServerConverter.convert(currentSecurityServerId); securityServers = Collections.singletonList(currentSecurityServer); } else { List<SecurityServerId> securityServerIds = globalConfFacade.getSecurityServers(); securityServers = securityServerConverter.convert(securityServerIds); } return new ResponseEntity<>(securityServers, HttpStatus.OK); }
SecurityServersApiController implements SecurityServersApi { @Override @PreAuthorize("hasAuthority('VIEW_SECURITY_SERVERS')") public ResponseEntity<List<SecurityServer>> getSecurityServers(Boolean currentServer) { boolean getOnlyCurrentServer = Boolean.TRUE.equals(currentServer); List<SecurityServer> securityServers = null; if (getOnlyCurrentServer) { SecurityServerId currentSecurityServerId = serverConfService.getSecurityServerId(); SecurityServer currentSecurityServer = securityServerConverter.convert(currentSecurityServerId); securityServers = Collections.singletonList(currentSecurityServer); } else { List<SecurityServerId> securityServerIds = globalConfFacade.getSecurityServers(); securityServers = securityServerConverter.convert(securityServerIds); } return new ResponseEntity<>(securityServers, HttpStatus.OK); } }
SecurityServersApiController implements SecurityServersApi { @Override @PreAuthorize("hasAuthority('VIEW_SECURITY_SERVERS')") public ResponseEntity<List<SecurityServer>> getSecurityServers(Boolean currentServer) { boolean getOnlyCurrentServer = Boolean.TRUE.equals(currentServer); List<SecurityServer> securityServers = null; if (getOnlyCurrentServer) { SecurityServerId currentSecurityServerId = serverConfService.getSecurityServerId(); SecurityServer currentSecurityServer = securityServerConverter.convert(currentSecurityServerId); securityServers = Collections.singletonList(currentSecurityServer); } else { List<SecurityServerId> securityServerIds = globalConfFacade.getSecurityServers(); securityServers = securityServerConverter.convert(securityServerIds); } return new ResponseEntity<>(securityServers, HttpStatus.OK); } @Autowired  SecurityServersApiController(GlobalConfService globalConfService, GlobalConfFacade globalConfFacade,
            SecurityServerConverter securityServerConverter, ServerConfService serverConfService); }
SecurityServersApiController implements SecurityServersApi { @Override @PreAuthorize("hasAuthority('VIEW_SECURITY_SERVERS')") public ResponseEntity<List<SecurityServer>> getSecurityServers(Boolean currentServer) { boolean getOnlyCurrentServer = Boolean.TRUE.equals(currentServer); List<SecurityServer> securityServers = null; if (getOnlyCurrentServer) { SecurityServerId currentSecurityServerId = serverConfService.getSecurityServerId(); SecurityServer currentSecurityServer = securityServerConverter.convert(currentSecurityServerId); securityServers = Collections.singletonList(currentSecurityServer); } else { List<SecurityServerId> securityServerIds = globalConfFacade.getSecurityServers(); securityServers = securityServerConverter.convert(securityServerIds); } return new ResponseEntity<>(securityServers, 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('VIEW_SECURITY_SERVERS')") public ResponseEntity<List<SecurityServer>> getSecurityServers(Boolean currentServer) { boolean getOnlyCurrentServer = Boolean.TRUE.equals(currentServer); List<SecurityServer> securityServers = null; if (getOnlyCurrentServer) { SecurityServerId currentSecurityServerId = serverConfService.getSecurityServerId(); SecurityServer currentSecurityServer = securityServerConverter.convert(currentSecurityServerId); securityServers = Collections.singletonList(currentSecurityServer); } else { List<SecurityServerId> securityServerIds = globalConfFacade.getSecurityServers(); securityServers = securityServerConverter.convert(securityServerIds); } return new ResponseEntity<>(securityServers, 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);  }