Package org.springframework.data.rest.webmvc.mongodb

Examples of org.springframework.data.rest.webmvc.mongodb.User


    Address address = new Address();
    address.street = "Foo";
    address.zipCode = "Bar";

    this.user = new User();
    this.user.firstname = "Oliver";
    this.user.lastname = "Gierke";
    this.user.address = address;
  }
View Full Code Here


  public void appliesRemoveOperationCorrectly() throws Exception {

    String input = "[{ \"op\": \"replace\", \"path\": \"/address/zipCode\", \"value\": \"ZIP\" },"
        + "{ \"op\": \"remove\", \"path\": \"/lastname\" }]";

    User result = handler.applyPatch(asStream(input), user);

    assertThat(result.lastname, is(nullValue()));
    assertThat(result.address.zipCode, is("ZIP"));
  }
View Full Code Here

  @Test
  public void appliesMergePatchCorrectly() throws Exception {

    String input = "{ \"address\" : { \"zipCode\" : \"ZIP\"}, \"lastname\" : null }";

    User result = handler.applyMergePatch(asStream(input), user);

    assertThat(result.lastname, is(nullValue()));
    assertThat(result.address.zipCode, is("ZIP"));
  }
View Full Code Here

   * @see DATAREST-250
   */
  @Test
  public void serializesEmbeddedReferencesCorrectly() throws Exception {

    User user = new User();
    user.address = new Address();
    user.address.street = "Street";

    PersistentEntityResource userResource = PersistentEntityResource.//
        build(user, repositories.getPersistentEntity(User.class)).//
View Full Code Here

TOP

Related Classes of org.springframework.data.rest.webmvc.mongodb.User

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.