Exemple #1
0
  @Test
  public void propertyReflectionAwareModelNoProperty() throws Exception {
    A a = new A();
    a.b = new B();

    LazyModel<C> model = model(from(a).getB().getC(0));

    assertNull(model.getPropertyField());
    assertNull(model.getPropertyGetter());
    assertNull(model.getPropertySetter());
  }
Exemple #2
0
  @Test
  public void propertyReflectionAwareModel() throws Exception {
    A a = new A();
    a.b = new B();

    LazyModel<Character> model = model(from(a).getB().getCharacter());

    assertNull(model.getPropertyField());
    assertEquals(B.class.getMethod("getCharacter"), model.getPropertyGetter());
    assertEquals(B.class.getMethod("setCharacter", Character.TYPE), model.getPropertySetter());
  }