public class Gh177 extends TestBase {
public static class Foo {
Bar bar;
public Foo() {}
public Foo(Bar bar) {
this.bar = bar;
}
}
public static class Bar {
String name;
int id;
public Bar() {}
public Bar(String name, int id) {
this.name = name;
this.id = id;
}
}
@Test
public void test() {
Foo foo = $.map(new Foo(new Bar("abc", 123))).filter("-bar.name").to(Foo.class);
Bar bar = foo.bar;
eq(123, bar.id);
isNull(bar.name); // failed here
}
}
Test case: