コード例 #1
0
  @Test
  public void successNotSetBoolean() {
    NotAnnotatedDocument doc = new NotAnnotatedDocument();

    initializer.initialize(doc);

    assertThat(doc.value, is(nullValue()));
  }
コード例 #2
0
  @Test
  public void successfullySettingBoolean() {
    AnnotatedDocument doc = new AnnotatedDocument();

    initializer.initialize(doc);

    assertThat(doc.value, is(1));
  }
コード例 #3
0
  @Test(expectedExceptions = RuntimeException.class)
  public void failsOnInitializeingFieldOfWrongType() {
    WronglyAnnotatedDocument doc = new WronglyAnnotatedDocument();

    initializer.initialize(doc);
  }