コード例 #1
0
  @Test
  public void ensureSerializableIsWellLoadedWithPost() throws IOException, ClassNotFoundException {
    Post first = getPostService().find().matching(new FindPostByNote(1)).getFirst();
    User user = getUserService().find().matching(new FindUserByLogin()).getFirst();

    first.associatedData = user;
    first = getPostService().update(first);

    first = getPostService().find().matching(new FindPostByNote(1)).getFirst();
    ;

    assertThat(first.associatedData, Is.is((Serializable) user));
  }
コード例 #2
0
  @Test
  public void ensureSerializableIsWellLoadedWithString()
      throws IOException, ClassNotFoundException {
    Post first = getPostService().find().matching(new FindPostByNote(1)).getFirst();

    String string = "a string";
    first.associatedData = string;
    first = getPostService().update(first);

    first = getPostService().find().matching(new FindPostByNote(1)).getFirst();
    ;

    assertThat(first.associatedData, Is.is((Serializable) string));
  }
コード例 #3
0
  @Test
  public void ensureSerializableIsWellLoadedWithUnknownSerializable()
      throws IOException, ClassNotFoundException {
    Post first = getPostService().find().matching(new FindPostByNote(1)).getFirst();
    User user = getUserService().find().matching(new FindUserByLogin()).getFirst();

    UnknownSerializable value = new UnknownSerializable().withText("a string");
    first.associatedData = value;
    first = getPostService().update(first);

    first = getPostService().find().matching(new FindPostByNote(1)).getFirst();
    ;

    assertThat(first.associatedData, Is.is((Serializable) value));
  }