### Question:
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);  }### Answer:
@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()); }
@Test @WithMockUser(authorities = { "VIEW_SECURITY_SERVERS" }) public void getCurrentSecurityServer() { ResponseEntity<List<SecurityServer>> response = securityServersApiController .getSecurityServers(true); assertEquals(HttpStatus.OK, response.getStatusCode()); List<SecurityServer> securityServers = response.getBody(); assertEquals(1, securityServers.size()); }