-
Notifications
You must be signed in to change notification settings - Fork 238
Generics doesn't work properly in chained method calls #213
Copy link
Copy link
Closed
Labels
Description
With JMockit 1.19 I have the following test code:
public class MockTest {
public interface Baz {
}
public interface Bar {
public Baz getBaz(String name);
}
public interface Foo {
public <DataT> Bar getBar(DataT model); // this does not work: "baz" is null
// public Bar getBar(String model); // this works!
}
@Test
public void test_cascading_class(@Mocked Foo foo) {
assertNotNull(foo);
final Bar bar = foo.getBar("blah");
assertNotNull(bar);
final Baz baz = bar.getBaz("foo"); // "baz" is null
assertNotNull(baz);
}
}The third assertion is null if using getBar() with generics. If I use the method without generics all works fine.
Reactions are currently unavailable