### Question:
SecurityServiceImpl implements SecurityService { @Override public Response deleteSecurityConfig(String id, HttpHeaders headers) { securityRepository.deleteById(UUID.fromString(id)); SecurityConfig sc = securityRepository.findById(UUID.fromString(id)); if (sc == null) { return new Response<>(1, success, id); } else { return new Response<>(0, "Reason Not clear", id); } }  @Override Response findAllSecurityConfig(HttpHeaders headers); @Override Response addNewSecurityConfig(SecurityConfig info, HttpHeaders headers); @Override Response modifySecurityConfig(SecurityConfig info, HttpHeaders headers); @Override Response deleteSecurityConfig(String id, HttpHeaders headers); @Override Response check(String accountId, HttpHeaders headers);  }### Answer:
@Test public void testDeleteSecurityConfig1() { UUID id = UUID.randomUUID(); Mockito.doNothing().doThrow(new RuntimeException()).when(securityRepository).deleteById(Mockito.any(UUID.class)); Mockito.when(securityRepository.findById(Mockito.any(UUID.class))).thenReturn(null); Response result = securityServiceImpl.deleteSecurityConfig(id.toString(), headers); Assert.assertEquals(new Response<>(1, "Success", id.toString()), result); }
@Test public void testDeleteSecurityConfig2() { UUID id = UUID.randomUUID(); SecurityConfig sc = new SecurityConfig(); Mockito.doNothing().doThrow(new RuntimeException()).when(securityRepository).deleteById(Mockito.any(UUID.class)); Mockito.when(securityRepository.findById(Mockito.any(UUID.class))).thenReturn(sc); Response result = securityServiceImpl.deleteSecurityConfig(id.toString(), headers); Assert.assertEquals("Reason Not clear", result.getMsg()); }