Package com.saasovation.common.media

Examples of com.saasovation.common.media.RepresentationReader.stringValue()


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

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


            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

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

        return link;
    }
View Full Code Here

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

        return link;
    }
View Full Code Here

        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"));
    }

    public void testGetAuthenticUserWrongPassword() throws Exception {
View Full Code Here

        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"));
    }

    public void testGetAuthenticUserWrongPassword() throws Exception {
        User user = this.userAggregate();
View Full Code Here

        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"));
    }

    public void testGetAuthenticUserWrongPassword() throws Exception {
        User user = this.userAggregate();
        DomainRegistry.userRepository().add(user);
View Full Code Here

        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"));
    }

    public void testGetNonExistingUser() throws Exception {
        User user = this.userAggregate();
View Full Code Here

        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"));
    }

    public void testIsUserNotInRole() throws Exception {
        User user = this.userAggregate();
View Full Code Here

        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"));
    }

    public void testIsUserNotInRole() throws Exception {
        User user = this.userAggregate();
        DomainRegistry.userRepository().add(user);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.