For a Spring Framework
App, about Testing:
- The business layer is working with
AssertJ
andJUnit
. - The web layer is working with
JUnit
andSpring 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:
containsExactly
tuple
parse
To be applied in:
.andExpect(model().attribute("personas", ???)
I did a research in google:
- about collections there are samples for simple collections (
String
,Integer
withhasItems
) - about dates, is working only with
Date
objects, of course same type, but not withString
too.