Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ProductEndpoinSpec extends IntegrationSpec{
- @Autowired
- ProductFacade productFacade
- def "chould return product"(){
- given: "define existing product"
- def product = new ProductRequestDto(null, "czerwony patyk")
- and: "save defined product"
- def createdProduct = productFacade.create(product)
- and: "get request"
- def url = url("/products/${createdProduct.getId()}")
- when: "get request"
- def response = httpClient.getForEntity(url, ProductResponseDto.class)
- then: "check status code if it is 200"
- response.getStatusCode() == OK
- and: "returned product is equal to existing one"
- response.getBody() == createdProduct
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement