Created
January 16, 2017 22:45
-
-
Save ian-ellis/1d45b1a31aafefdb531ff19784ed8c47 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CatalogProductEntity mockProduct(String sku, String name, String brand, Double price, Double specialPrice, List<String> imageUrls){ | |
return Mock(CatalogProductEntity) { | |
it.getSku() >> sku | |
it.getName() >> name | |
it.getBrand() >> Mock(BrandEntity){ | |
it.getName() >> brand | |
} | |
it.getPrice() >> price | |
it.getSpecialPrice() >> specialPrice | |
it.getImages() >> imageUrls.collect{ url-> | |
return Mock(ImageEntity){ | |
it.getUrl() >> url | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment