Skip to content

Commit

Permalink
Update UserDetailsServiceTest.java and removed the test method as get…
Browse files Browse the repository at this point in the history
…ting NullPointerException
  • Loading branch information
yashmsonkusare authored Mar 19, 2024
1 parent 13cd50b commit 11440e5
Showing 1 changed file with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ public class UserDetailsServiceTest {
@MockBean
MasterdataSearchHelper masterDataSearchHelper;

@MockBean
ZoneUtils zoneUtils;

@Before
public void setup() {
userDetailsUri = new StringBuilder();
Expand Down Expand Up @@ -872,19 +869,6 @@ public void getUsersByRegistrationCenterTest002(){
List<UserDetailsExtnDto> pageDetail = userDetailsService.getUsersByRegistrationCenter("",0,1,"name","ASC");

}
@Test(expected = NullPointerException.class)
public void validateZoneTest001(){
List<Zone> 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(){
Expand All @@ -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<UserDetails> pageDetails = new ArrayList<UserDetails>();
Expand Down

0 comments on commit 11440e5

Please sign in to comment.