I have an application with this layer
- Resources (controllers/endpoints) written using Jersey,
- Services, I have services interfaces and their actual implementation. In resources I'm using @Autowired Spring annotation to set the services interfaces their implementation instance/bean.
I want to write test using Spring, JUnit, Mockito, etc. which will run tomcat(or other container), then mock the services and run the test. I already did it using stubs, but I think there should be a way without using stabs. It's running grizzly with replacing context to test context(the context excludes services implementations package and instead of it using stubs package), setting mocked services into stubs, after that I can mock services and like to usual unit tests test the endpoints.
Any idea how I can do it without using stubs (into resources directly insert mocked services)?
Aucun commentaire:
Enregistrer un commentaire