-
Notifications
You must be signed in to change notification settings - Fork 49
Unwrapping ExecutionException when executed synchronously. Fixes #139 #142
Conversation
executor.exchange(HttpMethod.GET, [host: 'http://localhost:7777', url: '/api'.toURI()], Object) | ||
|
||
then: | ||
ResourceAccessException e = thrown(ResourceAccessException) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of the examples when IMHO def
is readable enough and much more consist. Wouldn't you agree @marcingrzejszczak?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def
in the method name of test? Of course it does - I also use def
in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the line I commented :).
ResourceAccessException e = thrown(ResourceAccessException)
e.message?.contains('localhost:7777')
vs.
def e = thrown(ResourceAccessException)
e.message?.contains('localhost:7777')
especially that it is used in the next line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D I'm not an evangelist of anti-def. Everything is ok if you use common sense. If you have such a case then it does make sense to use def :)
+1 |
This change is a breaking one? Meaning that instead of throwing our custom exception we will be throwing the original one from RestTemplate? |
Everything is fine, this fixes a regression after #13. |
+1 |
Merged (04ad2c9). |
No description provided.