I am working on a Java project, which is divided into a web project and a background project. The web interface accesses background content through web service calls.
There is one class in the web project that makes all the calls to web services, and I would like to add testing around this class. I want to do unit testing, not functional testing, so I donβt want the web service to actually run the tests. If this class simply passed calls to the background code, I could refuse testing, but caching is happening at the moment, so I want to check that it works correctly.
When creating the jax-ws web service, wsgen creates an interface that uses the interface. I used this generated interface to create a fake object for testing. This works very well, but there are problems with this approach.
Currently, I am the only one in my team who conducts unit testing, and this is the only one that supports test code. I would like to be able to create test code when the rest of the code is built, but if someone else introduces a new method into one of the web services classes, then the interface will have a new method on it and my fake object will not implement it and therefore it will be broken.
Website and reverse code projects are independent of each other, and I do not want to introduce a dependency between them. Thus, introducing an interface on top of the web service endpoint does not seem plausible, because if I put it at the end, my web code must reference it, and if I put it on the interface, my back-end code must reference it . I also cannot expand the endpoint, as this will also lead to dependency between projects.
I am not familiar with how web services work, and how classes are generated for a web project in order to be able to reference them. So, I do not know how to create an interface in the back that will be available to me in a web project.
So my question is: how can I access the interface for my front-end project without introducing the project dependency (in the path of building Eclipse)? Or is there another, better way to trick the internal web service I'm calling?