Este artículo A Functional Approach to Given When Then Using Java 8 describe de forma muy sencilla cómo comenzar a escribir tests en Java 8 siguiendo el patrón Given-When-Then:
1. Given: The initial context is received.
2. When: One or more actions are performed.
3. Then: The action results are checked against expectations.
Una forma sería esta:
Pero con Java 8 y el uso de Lambdas existe una forma mucho mejor:



Deja un comentario