@Test
public void test_getADServiceAccounts_all_success() {

erDetails userDetails = getMockUser(true);
	String token = userDetails.getClientToken();
	String userPrincipalName = "test";
	boolean excludeOnboarded = false;
    List<ADServiceAccount> allServiceAccounts = generateADSerivceAccounts();
    ResponseEntity<ADServiceAccountObjects> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(generateADServiceAccountObjects(allServiceAccounts));
    List<ADUserAccount> list = new ArrayList<>();
    ADUserAccount adUserAccount = new ADUserAccount();
    adUserAccount.setUserId("user.user11");
    adUserAccount.setUserName("user11");
    adUserAccount.setDisplayName("user user11");
    adUserAccount.setGivenName("user11");
    adUserAccount.setUserEmail("user11@abc.com");
    list.add(adUserAccount);
    String encodedFilter = "(&(userPrincipalName=test*)(objectClass=user)(!(CN=null)))";
    ReflectionTestUtils.setField(serviceAccountsService, "ldapTemplate", ldapTemplate);
    when(ldapTemplate.search(Mockito.anyString(), Mockito.anyString(), Mockito.any(AttributesMapper.class))).thenReturn(list);
    ReflectionTestUtils.setField(serviceAccountsService, "adUserLdapTemplate", ldapTemplate);
    when(ldapTemplate.search(Mockito.anyString(), Mockito.eq(encodedFilter), Mockito.any(AttributesMapper.class))).thenReturn(allServiceAccounts);
    ResponseEntity<ADServiceAccountObjects> responseEntity = serviceAccountsService.getADServiceAccounts(token, userDetails, userPrincipalName, excludeOnboarded);
    assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected.getBody().getData().getValues()[0].toString(), responseEntity.getBody().getData().getValues()[0].toString());
}