New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration testing of Spring Boot app with Spock and Docker #8

Open
dfrommi opened this Issue Jun 9, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@dfrommi
Owner

dfrommi commented Jun 9, 2016

This issue is reserved for comments on the blog post Integration testing of Spring Boot app with Spock and Docker. Leave a comment below and it will show up on the blog post's web page. Thanks!

@akiroso

This comment has been minimized.

Show comment
Hide comment
@akiroso

akiroso Jul 10, 2017

Hello, I really liked your post.

There's only one thing, when I tried to reproduce your sample, the execution of:
restTemplate.exchange
or any other request method throws an exception for any response status on groups 400 and 500 so it's impossible to test for this kind of scenarios.

Can you give me a light on what I've missed?

Thanks in advance!

akiroso commented Jul 10, 2017

Hello, I really liked your post.

There's only one thing, when I tried to reproduce your sample, the execution of:
restTemplate.exchange
or any other request method throws an exception for any response status on groups 400 and 500 so it's impossible to test for this kind of scenarios.

Can you give me a light on what I've missed?

Thanks in advance!

@dfrommi

This comment has been minimized.

Show comment
Hide comment
@dfrommi

dfrommi Jul 11, 2017

Owner

@akiroso You could just check the exception. I believe it's a HttpStatusCodeException that is thrown and you can verify it's status code.

then:
def e = thrown(HttpStatusCodeException)
e.status == whatever
Owner

dfrommi commented Jul 11, 2017

@akiroso You could just check the exception. I believe it's a HttpStatusCodeException that is thrown and you can verify it's status code.

then:
def e = thrown(HttpStatusCodeException)
e.status == whatever
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment