@Test(expected = ResourceNotFoundException.class) @WithMockUser(authorities = { "DELETE_ENDPOINT" }) public void deleteEndpointNotExist() { endpointsApiController.deleteEndpoint(NO_SUCH_ENDPOINT_ID); }
@Override @PreAuthorize("hasAuthority('DELETE_ENDPOINT')") @AuditEventMethod(event = DELETE_REST_ENDPOINT) public ResponseEntity<Void> deleteEndpoint(String id) { Long endpointId = parseLongIdOrThrowNotFound(id); try { endpointService.deleteEndpoint(endpointId); } catch (EndpointNotFoundException e) { throw new ResourceNotFoundException(e); } catch (ClientNotFoundException e) { throw new ConflictException("Client not found for the given endpoint with id: " + id); } catch (EndpointService.IllegalGeneratedEndpointRemoveException e) { throw new BadRequestException("Removing is not allowed for generated endpoint " + id); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); }
EndpointsApiController implements EndpointsApi { @Override @PreAuthorize("hasAuthority('DELETE_ENDPOINT')") @AuditEventMethod(event = DELETE_REST_ENDPOINT) public ResponseEntity<Void> deleteEndpoint(String id) { Long endpointId = parseLongIdOrThrowNotFound(id); try { endpointService.deleteEndpoint(endpointId); } catch (EndpointNotFoundException e) { throw new ResourceNotFoundException(e); } catch (ClientNotFoundException e) { throw new ConflictException("Client not found for the given endpoint with id: " + id); } catch (EndpointService.IllegalGeneratedEndpointRemoveException e) { throw new BadRequestException("Removing is not allowed for generated endpoint " + id); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); } }
EndpointsApiController implements EndpointsApi { @Override @PreAuthorize("hasAuthority('DELETE_ENDPOINT')") @AuditEventMethod(event = DELETE_REST_ENDPOINT) public ResponseEntity<Void> deleteEndpoint(String id) { Long endpointId = parseLongIdOrThrowNotFound(id); try { endpointService.deleteEndpoint(endpointId); } catch (EndpointNotFoundException e) { throw new ResourceNotFoundException(e); } catch (ClientNotFoundException e) { throw new ConflictException("Client not found for the given endpoint with id: " + id); } catch (EndpointService.IllegalGeneratedEndpointRemoveException e) { throw new BadRequestException("Removing is not allowed for generated endpoint " + id); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @Autowired  EndpointsApiController(
            EndpointService endpointService,
            EndpointConverter endpointConverter,
            AccessRightService accessRightService,
            ServiceClientConverter serviceClientConverter,
            ServiceClientHelper serviceClientHelper,
            ServiceClientService serviceClientService); }
EndpointsApiController implements EndpointsApi { @Override @PreAuthorize("hasAuthority('DELETE_ENDPOINT')") @AuditEventMethod(event = DELETE_REST_ENDPOINT) public ResponseEntity<Void> deleteEndpoint(String id) { Long endpointId = parseLongIdOrThrowNotFound(id); try { endpointService.deleteEndpoint(endpointId); } catch (EndpointNotFoundException e) { throw new ResourceNotFoundException(e); } catch (ClientNotFoundException e) { throw new ConflictException("Client not found for the given endpoint with id: " + id); } catch (EndpointService.IllegalGeneratedEndpointRemoveException e) { throw new BadRequestException("Removing is not allowed for generated endpoint " + id); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @Autowired  EndpointsApiController(
            EndpointService endpointService,
            EndpointConverter endpointConverter,
            AccessRightService accessRightService,
            ServiceClientConverter serviceClientConverter,
            ServiceClientHelper serviceClientHelper,
            ServiceClientService serviceClientService); @Override @PreAuthorize("hasAuthority('VIEW_ENDPOINT')") ResponseEntity<Endpoint> getEndpoint(String id); @Override @PreAuthorize("hasAuthority('DELETE_ENDPOINT')") @AuditEventMethod(event = DELETE_REST_ENDPOINT) ResponseEntity<Void> deleteEndpoint(String id); @Override @PreAuthorize("hasAuthority('EDIT_OPENAPI3_ENDPOINT')") @AuditEventMethod(event = EDIT_REST_ENDPOINT) ResponseEntity<Endpoint> updateEndpoint(String id, EndpointUpdate endpointUpdate); @Override @PreAuthorize("hasAuthority('VIEW_ENDPOINT_ACL')") ResponseEntity<List<ServiceClient>> getEndpointServiceClients(String id); @Override @PreAuthorize("hasAuthority('EDIT_ENDPOINT_ACL')") ResponseEntity<List<ServiceClient>> addEndpointServiceClients(String id, ServiceClients serviceClients); @Override @PreAuthorize("hasAuthority('EDIT_ENDPOINT_ACL')") ResponseEntity<Void> deleteEndpointServiceClients(String id, ServiceClients serviceClients); }
EndpointsApiController implements EndpointsApi { @Override @PreAuthorize("hasAuthority('DELETE_ENDPOINT')") @AuditEventMethod(event = DELETE_REST_ENDPOINT) public ResponseEntity<Void> deleteEndpoint(String id) { Long endpointId = parseLongIdOrThrowNotFound(id); try { endpointService.deleteEndpoint(endpointId); } catch (EndpointNotFoundException e) { throw new ResourceNotFoundException(e); } catch (ClientNotFoundException e) { throw new ConflictException("Client not found for the given endpoint with id: " + id); } catch (EndpointService.IllegalGeneratedEndpointRemoveException e) { throw new BadRequestException("Removing is not allowed for generated endpoint " + id); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @Autowired  EndpointsApiController(
            EndpointService endpointService,
            EndpointConverter endpointConverter,
            AccessRightService accessRightService,
            ServiceClientConverter serviceClientConverter,
            ServiceClientHelper serviceClientHelper,
            ServiceClientService serviceClientService); @Override @PreAuthorize("hasAuthority('VIEW_ENDPOINT')") ResponseEntity<Endpoint> getEndpoint(String id); @Override @PreAuthorize("hasAuthority('DELETE_ENDPOINT')") @AuditEventMethod(event = DELETE_REST_ENDPOINT) ResponseEntity<Void> deleteEndpoint(String id); @Override @PreAuthorize("hasAuthority('EDIT_OPENAPI3_ENDPOINT')") @AuditEventMethod(event = EDIT_REST_ENDPOINT) ResponseEntity<Endpoint> updateEndpoint(String id, EndpointUpdate endpointUpdate); @Override @PreAuthorize("hasAuthority('VIEW_ENDPOINT_ACL')") ResponseEntity<List<ServiceClient>> getEndpointServiceClients(String id); @Override @PreAuthorize("hasAuthority('EDIT_ENDPOINT_ACL')") ResponseEntity<List<ServiceClient>> addEndpointServiceClients(String id, ServiceClients serviceClients); @Override @PreAuthorize("hasAuthority('EDIT_ENDPOINT_ACL')") ResponseEntity<Void> deleteEndpointServiceClients(String id, ServiceClients serviceClients);  }