We are using PODAM to generate randomised POJOs for test purposes. My testing has a requirement that some types (RefData
below) are filled with specific data.
For example,
class RefData {
String code;
String description;
}
class Person {
String name;
RefData maritalStatus;
}
When manufacturing a Person
instance, I am happy for name to be random, but I want to have control to create and populate any instances of RefData
type myself, so that I can constrain them to valid values.
I have played around extensively with TypeManufacturer
(seems to instantiate the type and populate it, but PODAM then applies random data over the top). I have also tried with AbstractExternalFactory
, without success (perhaps it cannot apply to concrete types, only abstract and interface types).
Any suggestions would be welcomed, Robin.