Package com.wesabe.grendel.representations

Examples of com.wesabe.grendel.representations.UserInfoRepresentation


      when(user.getId()).thenReturn("mrpeepers");
      when(user.getKeySet()).thenReturn(keySet);
      when(user.getCreatedAt()).thenReturn(new DateTime(2009, 12, 22, 4, 9, 00, 00, DateTimeZone.UTC));
      when(user.getModifiedAt()).thenReturn(new DateTime(2009, 12, 28, 14, 23, 00, 00, DateTimeZone.UTC));
     
      this.rep = new UserInfoRepresentation(uriInfo, user);
    }
View Full Code Here


      final Response response = resource.show(request, uriInfo, "bob");
      assertThat(response.getStatus()).isEqualTo(Status.OK.getStatusCode());
      assertThat(response.getMetadata().getFirst("ETag")).isEqualTo(new EntityTag("user-bob-4"));
      assertThat(response.getMetadata().getFirst("Last-Modified")).isEqualTo(modifiedAt.toDate());
     
      final UserInfoRepresentation list = (UserInfoRepresentation) response.getEntity();
      assertThat(list.getUser()).isEqualTo(user);
      assertThat(list.getUriInfo()).isEqualTo(uriInfo);
    }
View Full Code Here

      throw new WebApplicationException(Status.NOT_FOUND);
    }
   
    checkPreconditions(request, user);
   
    return Response.ok(new UserInfoRepresentation(uriInfo, user))
            .tag(user.getEtag())
            .lastModified(user.getModifiedAt().toDate())
            .build();
  }
View Full Code Here

TOP

Related Classes of com.wesabe.grendel.representations.UserInfoRepresentation

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.