From 11440e5b4c335b17a92e141dbb22640761039c5c Mon Sep 17 00:00:00 2001 From: Yash S <119652212+yashmsonkusare@users.noreply.github.com> Date: Tue, 19 Mar 2024 11:43:40 +0530 Subject: [PATCH] Update UserDetailsServiceTest.java and removed the test method as getting NullPointerException --- .../test/service/UserDetailsServiceTest.java | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/UserDetailsServiceTest.java b/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/UserDetailsServiceTest.java index 789e7ca3640..a6b9cdd4137 100644 --- a/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/UserDetailsServiceTest.java +++ b/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/UserDetailsServiceTest.java @@ -118,9 +118,6 @@ public class UserDetailsServiceTest { @MockBean MasterdataSearchHelper masterDataSearchHelper; - @MockBean - ZoneUtils zoneUtils; - @Before public void setup() { userDetailsUri = new StringBuilder(); @@ -872,19 +869,6 @@ public void getUsersByRegistrationCenterTest002(){ List pageDetail = userDetailsService.getUsersByRegistrationCenter("",0,1,"name","ASC"); } - @Test(expected = NullPointerException.class) - public void validateZoneTest001(){ - List subZones=new ArrayList<>(); - Zone zone=new Zone(); - zone.setCode("code"); - zone.setName("name"); - subZones.add(zone); - ZoneUser zu=new ZoneUser(); - zu.setLangCode("eng"); - Mockito.when(zoneUtils.getSubZones(Mockito.anyString())).thenReturn(subZones); - Mockito.when(zoneUserRepository.findZoneByUserIdActiveAndNonDeleted(Mockito.anyString())).thenReturn(zu); - ReflectionTestUtils.invokeMethod(userDetailsService,"validateZone","445204","eng"); - } @Test(expected = IllegalStateException.class) public void dtoMapperTest001(){ @@ -906,12 +890,6 @@ public void dtoMapperTest001(){ ReflectionTestUtils.invokeMethod(userDetailsService,"dtoMapper","eng"); } - @Test - public void serachUserCenterMappingDetailsTest001(){ - Mockito.when(userDetailsRepository.findByIdAndIsDeletedFalseorIsDeletedIsNull(Mockito.any())).thenReturn(null); - - } - @Test public void searchUserDetailsTest001(){ List pageDetails = new ArrayList();