Examples of username()


Examples of com.saasovation.identityaccess.domain.model.identity.User.username()

        assertTrue(
                ApplicationServiceRegistry
                    .accessApplicationService()
                    .isUserInRole(
                            user.tenantId().id(),
                            user.username(),
                            role.name()));
    }

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

Examples of com.saasovation.identityaccess.domain.model.identity.User.username()

        String url = "http://localhost:" + PORT + "/tenants/{tenantId}/users/{username}/autenticatedWith/{password}";

        System.out.println(">>> GET: " + url);
        ClientRequest request = new ClientRequest(url);
        request.pathParameter("tenantId", user.tenantId().id());
        request.pathParameter("username", user.username());
        request.pathParameter("password", FIXTURE_PASSWORD);

        String output = request.getTarget(String.class);
        System.out.println(output);
View Full Code Here

Examples of com.saasovation.identityaccess.domain.model.identity.User.username()

        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

Examples of com.saasovation.identityaccess.domain.model.identity.User.username()

        String url = "http://localhost:" + PORT + "/tenants/{tenantId}/users/{username}/autenticatedWith/{password}";

        System.out.println(">>> GET: " + url);
        ClientRequest request = new ClientRequest(url);
        request.pathParameter("tenantId", user.tenantId().id());
        request.pathParameter("username", user.username());
        request.pathParameter("password", UUID.randomUUID().toString());
        ClientResponse<String> response = request.get(String.class);
        assertTrue(response.getStatus() == 404 || response.getStatus() == 500);
    }
View Full Code Here

Examples of com.saasovation.identityaccess.domain.model.identity.User.username()

        String url = "http://localhost:" + PORT + "/tenants/{tenantId}/users/{username}";

        System.out.println(">>> GET: " + url);
        ClientRequest request = new ClientRequest(url);
        request.pathParameter("tenantId", user.tenantId().id());
        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);
View Full Code Here

Examples of com.saasovation.identityaccess.domain.model.identity.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"));
    }

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

Examples of com.saasovation.identityaccess.domain.model.identity.User.username()

        String url = "http://localhost:" + PORT + "/tenants/{tenantId}/users/{username}";

        System.out.println(">>> GET: " + url);
        ClientRequest request = new ClientRequest(url);
        request.pathParameter("tenantId", user.tenantId().id());
        request.pathParameter("username", user.username() + "!");
        ClientResponse<String> response = request.get(String.class);
        assertTrue(response.getStatus() == 404 || response.getStatus() == 500);
    }

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

Examples of com.saasovation.identityaccess.domain.model.identity.User.username()

        String url = "http://localhost:" + PORT + "/tenants/{tenantId}/users/{username}/inRole/{role}";

        System.out.println(">>> GET: " + url);
        ClientRequest request = new ClientRequest(url);
        request.pathParameter("tenantId", user.tenantId().id());
        request.pathParameter("username", user.username());
        request.pathParameter("role", role.name());
        ClientResponse<String> response = request.get(String.class);
        assertEquals(200, response.getStatus());
        String entity = response.getEntity();
        System.out.println(entity);
View Full Code Here

Examples of com.saasovation.identityaccess.domain.model.identity.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"));
        assertEquals(role.name(), reader.stringValue("role"));
    }

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

Examples of com.saasovation.identityaccess.domain.model.identity.User.username()

        String url = "http://localhost:" + PORT + "/tenants/{tenantId}/users/{username}/inRole/{role}";

        System.out.println(">>> GET: " + url);
        ClientRequest request = new ClientRequest(url);
        request.pathParameter("tenantId", user.tenantId().id());
        request.pathParameter("username", user.username());
        request.pathParameter("role", role.name());
        ClientResponse<String> response = request.get(String.class);
        assertEquals(204, response.getStatus());
    }
}
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.