// Path: src/test/java/gluu/scim2/client/UserBaseTest.java
// public class UserBaseTest extends BaseTest {
// 
//     protected static final Class<UserResource> usrClass=UserResource.class;
// 
//     public UserResource createUserFromJson(String json){
// 
//         Response response=client.createUser(json, null, null);
//         assertEquals(response.getStatus(), CREATED.getStatusCode());
// 
//         UserResource user=response.readEntity(usrClass);
//         assertNotNull(user.getMeta());
//         logger.debug("User created with id {}", user.getId());
// 
//         return user;
//     }
// 
//     public void deleteUser(UserResource user){
// 
//         logger.debug("Deleting user {}", user.getUserName());
//         Response response=client.deleteUser(user.getId());
//         assertEquals(response.getStatus(), NO_CONTENT.getStatusCode());
//         logger.debug("deleted");
// 
//     }
// 
// }


import gluu.scim2.client.UserBaseTest;
import org.gluu.oxtrust.model.scim2.ListResponse;
import org.gluu.oxtrust.model.scim2.user.UserResource;
import org.testng.annotations.Test;
import javax.ws.rs.core.Response;
import java.util.List;
import java.util.stream.Collectors;
import static javax.ws.rs.core.Response.Status.OK;
import static org.testng.Assert.*;
package gluu.scim2.client.singleresource;






/**
 * NOTES:
 * Check first if /install/community-edition-setup/templates/test/scim-client/data/scim-test-data.ldif has been loaded to LDAP.
 *
 * Created by jgomer on 2017-11-12.
 */
public class QueryParamRetrievalTest extends UserBaseTest {

    private UserResource user;

    @Test
    public void multipleRetrieval(){
        logger.debug("Retrieving test users...");
        String include="displayName, externalId";

        Response response=client.searchUsers("displayName co \"Test\"", null, null, null, null, include, null);
        assertEquals(response.getStatus(), OK.getStatusCode());

// Path: src/test/java/gluu/scim2/client/UserBaseTest.java
// public class UserBaseTest extends BaseTest {
// 
//     protected static final Class<UserResource> usrClass=UserResource.class;
// 
//     public UserResource createUserFromJson(String json){
// 
//         Response response=client.createUser(json, null, null);
//         assertEquals(response.getStatus(), CREATED.getStatusCode());
// 
//         UserResource user=response.readEntity(usrClass);
//         assertNotNull(user.getMeta());
//         logger.debug("User created with id {}", user.getId());
// 
//         return user;
//     }
// 
//     public void deleteUser(UserResource user){
// 
//         logger.debug("Deleting user {}", user.getUserName());
//         Response response=client.deleteUser(user.getId());
//         assertEquals(response.getStatus(), NO_CONTENT.getStatusCode());
//         logger.debug("deleted");
// 
//     }
// 
// }


// Path: src/test/java/gluu/scim2/client/singleresource/QueryParamRetrievalTest.java
import gluu.scim2.client.UserBaseTest;
import org.gluu.oxtrust.model.scim2.ListResponse;
import org.gluu.oxtrust.model.scim2.user.UserResource;
import org.testng.annotations.Test;
import javax.ws.rs.core.Response;
import java.util.List;
import java.util.stream.Collectors;
import static javax.ws.rs.core.Response.Status.OK;
import static org.testng.Assert.*;

package gluu.scim2.client.singleresource;






/**
 * NOTES:
 * Check first if /install/community-edition-setup/templates/test/scim-client/data/scim-test-data.ldif has been loaded to LDAP.
 *
 * Created by jgomer on 2017-11-12.
 */
public class QueryParamRetrievalTest extends UserBaseTest {

    private UserResource user;

    @Test
    public void multipleRetrieval(){
        logger.debug("Retrieving test users...");
        String include="displayName, externalId";

        Response response=client.searchUsers("displayName co \"Test\"", null, null, null, null, include, null);
        assertEquals(response.getStatus(), OK.getStatusCode());

        ListResponse listResponse = response.readEntity(ListResponse.class);