Manufacturing of nested generic type properties
Closed this issue · 5 comments
I have the following object hierarchy:
public class A { private B<String> b; }
public class B<T> { private List<C<T>> values;
public class C<T> { private T value; }
Trying to manufacture an A object with data using:
new PodamFactoryImpl().manufacturePojo(A.class)
throws the following exception:
java.lang.IllegalStateException: com.C is missing generic type arguments, expected [T] found [T]
needless to say this works:
new PodamFactoryImpl().manufacturePojoWithFullData(C.class, String.class)
This is not exactly the same, as in the test reference, the GenericListPojo
class is generic.
In my example the A
class is not generic, however it contains a generic proeprty.
Accidentally closed the issue.
Your class B is also generic. And the error is the same, but I guess you are using some older version of Podam:
uk.co.jemos.podam.exceptions.PodamMockeryException: An exception occurred while resolving the collection
at uk.co.jemos.podam.test.unit.pdm45.Pdm45UnitTest.testGenericListPojoManufacture(Pdm45UnitTest.java:45)
Caused by: java.lang.IllegalArgumentException: uk.co.jemos.podam.test.dto.pdm45.GenericPojo is missing generic type arguments, expected [F, S], provided [F, S]
at uk.co.jemos.podam.test.unit.pdm45.Pdm45UnitTest.testGenericListPojoManufacture(Pdm45UnitTest.java:45)
Please, give it a try with Podam 7.0.4-SNAPSHOT.
Issue solved.
Can you please release and upload to mvn repository ?
Now it should appear at some point in Maven. Thank you for reporting this issue.