Package org.springframework.data.rest.webmvc.jpa

Examples of org.springframework.data.rest.webmvc.jpa.Order


  @Test
  public void setsExpandedSelfUriInLocationHeader() throws Exception {

    RootResourceInformation information = getResourceInformation(Order.class);

    PersistentEntityResource persistentEntityResource = PersistentEntityResource.build(new Order(new Person()),
        entities.getPersistentEntity(Order.class)).build();

    ResponseEntity<?> entity = controller.putItemResource(information, persistentEntityResource, 1L, assembler);

    assertThat(entity.getHeaders().getLocation().toString(), not(endsWith("{?projection}")));
View Full Code Here


  @Test
  public void deserializesEmbeddedAssociationsCorrectly() throws Exception {

    String content = TestUtils.readFileFromClasspath("order.json");

    Order order = mapper.readValue(content, Order.class);
    assertThat(order.getLineItems(), hasSize(2));
  }
View Full Code Here

  @Test
  public void serializesReferencesWithinPagedResourceCorrectly() throws Exception {

    Person creator = new Person("Dave", "Matthews");

    Order order = new Order(creator);
    order.add(new LineItem("first"));
    order.add(new LineItem("second"));

    PersistentEntityResource orderResource = PersistentEntityResource.//
        build(order, repositories.getPersistentEntity(Order.class)).//
        withLink(new Link("/orders/1")).//
        build();
View Full Code Here

TOP

Related Classes of org.springframework.data.rest.webmvc.jpa.Order

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.