Package com.saasovation.common.media

Examples of com.saasovation.common.media.RepresentationReader


        Link link = null;

        JsonElement linkElement = this.elementFrom(this.representation(), aLinkName);

        if (linkElement.isJsonObject()) {
            RepresentationReader rep = new RepresentationReader(linkElement.getAsJsonObject());

            link =
                    new Link(
                            rep.stringValue("href"),
                            rep.stringValue("rel"),
                            rep.stringValue("title"),
                            rep.stringValue("type"));
        }

        return link;
    }
View Full Code Here


        request.pathParameter("password", FIXTURE_PASSWORD);

        String output = request.getTarget(String.class);
        System.out.println(output);

        RepresentationReader reader = new RepresentationReader(output);

        assertEquals(user.tenantId().id(), reader.stringValue("tenantId.id"));
        assertEquals(user.username(), reader.stringValue("username"));
        assertEquals(user.person().emailAddress().address(), reader.stringValue("emailAddress"));
    }
View Full Code Here

        request.pathParameter("username", user.username());
        ClientResponse<String> response = request.get(String.class);
        assertEquals(200, response.getStatus());
        String entity = response.getEntity();
        System.out.println(entity);
        RepresentationReader reader = new RepresentationReader(entity);
        assertEquals(user.username(), reader.stringValue("username"));
        assertTrue(reader.booleanValue("enabled"));
    }
View Full Code Here

        request.pathParameter("role", role.name());
        ClientResponse<String> response = request.get(String.class);
        assertEquals(200, response.getStatus());
        String entity = response.getEntity();
        System.out.println(entity);
        RepresentationReader reader = new RepresentationReader(entity);
        assertEquals(user.username(),  reader.stringValue("username"));
        assertEquals(role.name(), reader.stringValue("role"));
    }
View Full Code Here

        ClientRequest request = new ClientRequest(url);
        request.pathParameter("tenantId", tenant.tenantId().id());
        String output = request.getTarget(String.class);
        System.out.println(output);

        RepresentationReader reader = new RepresentationReader(output);

        assertEquals(tenant.name(), reader.stringValue("name"));
        assertTrue(reader.booleanValue("active"));
    }
View Full Code Here

    public <T extends Collaborator> T toCollaboratorFromRepresentation(
            String aUserInRoleRepresentation,
            Class<T> aCollaboratorClass)
    throws Exception {

        RepresentationReader reader =
                new RepresentationReader(aUserInRoleRepresentation);

        String username = reader.stringValue("username");
        String firstName = reader.stringValue("firstName");
        String lastName = reader.stringValue("lastName");
        String emailAddress = reader.stringValue("emailAddress");

        T collaborator =
            this.newCollaborator(
                    username,
                    firstName,
View Full Code Here

        request.pathParameter("tenantId", group.tenantId().id());
        request.pathParameter("groupName", group.name());
        String output = request.getTarget(String.class);
        System.out.println(output);

        RepresentationReader reader = new RepresentationReader(output);

        assertEquals(group.tenantId().id(), reader.stringValue("tenantId.id"));
        assertEquals(group.name(), reader.stringValue("name"));
    }
View Full Code Here

TOP

Related Classes of com.saasovation.common.media.RepresentationReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.