@Override public void removeEndpointRegistrationByEndpointId(String endpointId) throws EndpointRegistrationServiceException { try { Validate.notBlank(endpointId, "Invalid endpoint ID provided!"); this.endpointRegistrationDao.removeByEndpointId(endpointId); } catch (Exception cause) { LOG.error("An unexpected exception occured while removing endpoint registration!", cause); throw new EndpointRegistrationServiceException(cause); } }
@Test public void testRemoveByEndpointId() throws Exception { EndpointRegistrationDto endpointRegistrationDto = this.generateEndpointRegistration(APPLICATION_ID, ENDPOINT_ID, CREDENTIALS_ID); Assert.assertNotNull(endpointRegistrationDto); Assert.assertNotNull(endpointRegistrationDto.getId()); this.endpointRegistrationDao.removeByEndpointId(ENDPOINT_ID); Assert.assertNull(this.endpointRegistrationDao.findByEndpointId(ENDPOINT_ID).orElse(null)); } }
@Test public void testRemoveByEndpointId() throws Exception { EndpointRegistrationDto endpointRegistrationDto = this.generateEndpointRegistration(APPLICATION_ID, ENDPOINT_ID, CREDENTIALS_ID, null, null); Assert.assertNotNull(endpointRegistrationDto); Assert.assertNotNull(endpointRegistrationDto.getId()); this.endpointRegistrationDao.removeByEndpointId(ENDPOINT_ID); Assert.assertNull(this.endpointRegistrationDao.findByEndpointId(ENDPOINT_ID).orElse(null)); } }