How to make fun of an entire JAX-RPC session?

I have an outdated application that works with a third-party web service through JAX-RPC. Now I need to do unit testing of the application, mocking some XML RPC calls with test data. In fact, I need to replace Apache Axis , which is used by the application, with another library that will be JAX-RPC-compatible, but will return what I say to return. I am sure that I am not alone with such a problem ... Are there any open source libraries for this purpose?

+3
source share
3 answers

You can do this with the Spring framework and EasyMock.

What is the best framework for Java?

0

WireMock. Jetty, , . XML-RPC . .

stubFor(post(urlEqualTo("/RPC2"))
        .withRequestBody(containing("<methodName>...</methodName>"))
        .willReturn(aResponse()
            .withBody("<methodResponse>...</methodResponse>")));
0

You can use to redirect calls to external services EasyMock+Powermockor Mockito you can do something like this

Easymock.expect(your function calling external Systems).andReturn(your required output)

hope this helps!

Good luck

0
source

All Articles