示例#1
0
  @Test
  public void canUpdateWithACustomTypeId() throws Exception {

    ExternalFriend friend = new ExternalFriend(999, "Robert");
    collection.save(friend);

    friend.setName("Robert");
    collection.save(friend);

    ExternalFriend result = collection.findOne().as(ExternalFriend.class);
    assertThat(result.getId()).isEqualTo(999);
  }