Answer the question
In order to leave comments, you need to log in
How to gracefully populate static data when unit testing in Java, JUnit?
Faced the following problem. I'm writing unit tests for a Java project (personal). And very, very often you have to write such canvases of code (for ease of perception, I reduced the number of objects):
LinkedList<Vertex[]> sharedData = new LinkedList<>();
sharedData.add(
new Vertex[]{
new Vertex(0, 0),
new Vertex(10, 0),
new Vertex(0, 10)
});
LinkedList<Vertex> sharedData = listFiller.Vertex().add(0, 0).add(10, 0).add(0, 10).toList();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question