Consider the following POJO structure in my main code. I want to create some testing framework for this kind of hierarchical classes, where the calling test method can specify if they want to modify a particular attribute only like for second Attributes
set the height to a particular number and using default values for other attributes.
I thought about annotations, but due to this hierarchal and many objects in a list, it is becoming infeasible.
class Player {
private PlayerCurrentCondition currentCondition;
private List<Attributes> playerAttributes
private List<Addresses> addresses;
}
class Attributes {
private Integer height;
private List<Sibling> siblings;
private String name;
}
class Addresses {
private List<Secondary> secondary;
}
In different JUnit tests, we want to build the Player
object based on different criteria like in some test case setting a paritcular Attributes
and then assert on that. How can we build Player
object in a good design fashion so we do not clutter the code with creating new
objects and then setting them manually.
Player
object based on different criteria like in some test case setting a paritcularAttributes
and then assert on that. How can we buildPlayer
object in a good design fashion so we do not clutter the code with creatingnew
objects and then setting them manually.int goalAttempts;
member variable on the player object.