dimanche 17 avril 2016

Spock Mock internal Date object

I am returning a string from the groovy utility class. The method is return "${new SimpleDateFormate("dd_MM_yyyy").format(new Date())}"

I want to test this method with my date. Can I mock the new Date() as 2016-01-14. If it is possible, how to implement it.

Aucun commentaire:

Enregistrer un commentaire