For a Spring Framework App, about Testing:
- The business layer is working with
AssertJandJUnit. - The web layer is working with
JUnitandSpring MVC Test, where the latter works mandatorily withHamcrest. See Is there a way to use AssertJ assertions with Spring MVC Test? (The answer is no yet)
If in AssertJ is possible apply the following for a collection:
.containsExactly(tuple("087", "Peter", "Jordani", parse("1980-01-01")),
...
tuple("088", "Isaias", "Jordano", parse("1980-01-01")))
What could be the best equivalent approximation of these three methods:
containsExactlytupleparse
To be applied in:
.andExpect(model().attribute("personas", ???)
I did a research in google:
- about collections there are samples for simple collections (
String,IntegerwithhasItems) - about dates, is working only with
Dateobjects, of course same type, but not withStringtoo.