spring-retry with MockWebServiceServer error: 'webServiceTemplate' must not be null
See original GitHub issueI’m using spring-boot 1.5.7.RELEASE and I’m having trouble when I have a mocked WebServiceGatewaySupport which has @Retryable annotations in the subclass of that class. When I call Mockito.verify() I get an UnfinishedVerificationException exception.
I find a workaround like #6828 and #5837
if (client instanceof Advised) {
client = (MySubClassOfWebServiceGatewaySupport) ((Advised) client).getTargetSource().getTarget();
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Test Web Service Client with spring MockWebServiceServer
I believe the error has something to do with the WebServiceTemplate I autowired into my WS client as below. Since I am using...
Read more >Guide to Spring Retry - Baeldung
A quick and practical guide to implementing retry logic with Spring Retry.
Read more >MockWebServiceServer xref - Spring
WebServiceTemplate ; 22 import org.springframework.ws.client.core.support. ... notNull(webServiceTemplate, "'webServiceTemplate' must not be null"); 110 111 ...
Read more >Spring Retry — How to Handle Failures - DZone
Learn various way to handle failures in microservices software architecture with Spring Retry in this tutorial for Java microservices ...
Read more >Client Integration Testing with MockWebServiceServer
Instead, I prefer to have WebServiceTemplate injected into my client class. ... First, we need the following Spring Web Services dependency: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks. This isn’t a Spring Boot problem. It’s a problem with Spring Retry proxying
QuoteClientdue to its@Retryablemethod andMockWebServiceServer.createServerbeing unable to correctly consume that proxy. You can avoid the problem by unwrapping the proxy before passing it intocreateServer:Demo spring boot app to reproduce the issue demo.zip