### Question:
SecurityServiceImpl implements SecurityService { @Override public Response modifySecurityConfig(SecurityConfig info, HttpHeaders headers) { SecurityConfig sc = securityRepository.findById(info.getId()); if (sc == null) { return new Response<>(0, "Security Config Not Exist", null); } else { sc.setName(info.getName()); sc.setValue(info.getValue()); sc.setDescription(info.getDescription()); securityRepository.save(sc); return new Response<>(1, success, sc); } }  @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 testModifySecurityConfig1() { SecurityConfig sc = new SecurityConfig(); Mockito.when(securityRepository.findById(Mockito.any(UUID.class))).thenReturn(null); Response result = securityServiceImpl.modifySecurityConfig(sc, headers); Assert.assertEquals(new Response<>(0, "Security Config Not Exist", null), result); }
@Test public void testModifySecurityConfig2() { SecurityConfig sc = new SecurityConfig(); Mockito.when(securityRepository.findById(Mockito.any(UUID.class))).thenReturn(sc); Mockito.when(securityRepository.save(Mockito.any(SecurityConfig.class))).thenReturn(null); Response result = securityServiceImpl.modifySecurityConfig(sc, headers); Assert.assertEquals(new Response<>(1, "Success", sc), result); }