@Test
public void test_searchByCorpId_successfully() {

    DirectoryUser directoryUser = new DirectoryUser();
    directoryUser.setDisplayName("testUser");
    directoryUser.setGivenName("testUser");
    directoryUser.setUserEmail("testUser@t-mobile.com");
    directoryUser.setUserId("testuser01");
    directoryUser.setUserName("testUser");
    List<DirectoryUser> persons = new ArrayList<>();
    persons.add(directoryUser);
    DirectoryObjects users = new DirectoryObjects();
    DirectoryObjectsList usersList = new DirectoryObjectsList();
    usersList.setValues(persons.toArray(new DirectoryUser[persons.size()]));
    users.setData(usersList);
    ResponseEntity<DirectoryObjects> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(users);
    when(ldapTemplate.search(Mockito.anyString(), Mockito.anyString(), Mockito.any(AttributesMapper.class))).thenReturn(persons);
    ResponseEntity<DirectoryObjects> responseEntity = directoryService.searchByCorpId("test_corpid");
    assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
    assertEquals(responseEntityExpected.getBody().getData().getValues()[0], responseEntity.getBody().getData().getValues()[0]);
}