Examples of UserRepresentation


Examples of chirp.service.representations.UserRepresentation

  }

  @Test
  public void getUserMustReturnUser() {
    User expected = getUserRepository().createUser("testuser", "Test User");
    UserRepresentation actual = usersResource.path("testuser").get(UserRepresentation.class);
    assertEquals(expected.getUsername(), actual.getUsername());
    assertEquals(expected.getRealname(), actual.getRealname());
  }
View Full Code Here

Examples of chirp.service.representations.UserRepresentation

  @GET
  @Path("{username}")
  @Produces(MediaType.APPLICATION_JSON)
  public UserRepresentation getUser(@PathParam("username") String username) {
    User user = userRepository.getUser(username);
    return new UserRepresentation(user, false);
  }
View Full Code Here

Examples of com.saasovation.identityaccess.application.representation.UserRepresentation

                        .build();
        } else {
            String representation =
                    ObjectSerializer
                        .instance()
                        .serialize(new UserRepresentation(aUser));

            response =
                    Response
                        .ok(representation)
                        .cacheControl(this.cacheControlFor(3600))
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.user.UserRepresentation

        assertThat(jsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));

        // then
        assertThat(jsonResp.getStatus(), is(HttpStatusCode.OK));

        final UserRepresentation repr = jsonResp.getEntity();
        assertThat(repr, is(not(nullValue())));
        assertThat(repr.isMap(), is(true));

        assertThat(repr.getSelf(), isLink(client).httpMethod(HttpMethod.GET));
        assertThat(repr.getUserName(), is(not(nullValue())));
        assertThat(repr.getFriendlyName(), is(nullValue())); // TODO: change
                                                             // fixture so
                                                             // populated
        assertThat(repr.getEmail(), is(nullValue())); // TODO: change fixture so
                                                      // populated
        assertThat(repr.getRoles(), is(not(nullValue()))); // TODO: change
                                                           // fixture so have
                                                           // non-empty list

        assertThat(repr.getLinks(), isArray());
        assertThat(repr.getExtensions(), isMap());
    }
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.user.UserRepresentation

    }

    @Test
    public void self_isFollowable() throws Exception {
        // given
        final UserRepresentation repr = givenRepresentation();

        // when, then
        assertThat(repr, isFollowableLinkToSelf(client));
    }
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.user.UserRepresentation

    public void followLink() throws Exception {

        // given
        final Response serviceResp = userResource.user();
        final RestfulResponse<UserRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
        final UserRepresentation serviceRepr = serviceJsonResp.getEntity();
        final LinkRepresentation selfLink = serviceRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation putLink = selfLink.withMethod(RestfulHttpMethod.PUT);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(putLink);
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.user.UserRepresentation

    public void followLink() throws Exception {

        // given
        final Response serviceResp = userResource.user();
        final RestfulResponse<UserRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
        final UserRepresentation serviceRepr = serviceJsonResp.getEntity();
        final LinkRepresentation selfLink = serviceRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation postLink = selfLink.withMethod(RestfulHttpMethod.POST);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(postLink);
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.user.UserRepresentation

        assertThat(jsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));

        // then
        assertThat(jsonResp.getStatus(), is(HttpStatusCode.OK));

        final UserRepresentation repr = jsonResp.getEntity();
        assertThat(repr, is(not(nullValue())));
        assertThat(repr.isMap(), is(true));

        assertThat(repr.getSelf(), isLink(client)
                                    .rel(Rel.SELF)
                                    .href(endsWith(":39393/user"))
                                    .httpMethod(RestfulHttpMethod.GET)
                                    .type(RepresentationType.USER.getMediaType())
                                    .returning(HttpStatusCode.OK)
                                    );
       
        assertThat(repr.getUp(), isLink(client)
                                    .rel(Rel.UP)
                                    .href(endsWith(":39393/"))
                                    .httpMethod(RestfulHttpMethod.GET)
                                    .type(RepresentationType.HOME_PAGE.getMediaType())
                                    .returning(HttpStatusCode.OK)
                                    );
        assertThat(repr.getUserName(), is(not(nullValue())));
       
        // TODO: change fixture so populated
        assertThat(repr.getFriendlyName(), is(nullValue()));
        assertThat(repr.getEmail(), is(nullValue()));
        assertThat(repr.getRoles(), is(not(nullValue())));

        assertThat(repr.getLinks(), isArray());
        assertThat(repr.getExtensions(), isMap());
    }
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.user.UserRepresentation

        // given
        final Response resp = resource.user();

        final RestfulResponse<UserRepresentation> jsonResp = RestfulResponse.ofT(resp);
        final UserRepresentation repr = jsonResp.getEntity();
        final LinkRepresentation selfLink = repr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation deleteLink = selfLink.withMethod(RestfulHttpMethod.DELETE);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);
View Full Code Here

Examples of org.keycloak.representations.idm.UserRepresentation

                    }

                    // TODO: support for more transactions per single users file (if needed)
                    List<UserRepresentation> userReps = new ArrayList<UserRepresentation>();
                    while (parser.getCurrentToken() == JsonToken.START_OBJECT) {
                        UserRepresentation user = parser.readValueAs(UserRepresentation.class);
                        userReps.add(user);
                        parser.nextToken();
                    }

                    importUsers(session, model, realmName, userReps);
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.