jeudi 11 janvier 2018

Creating integrationtests on classes with dependency injection

I have a java EE webapplication that heavily relies on dependency injection. Currently it works as expected and it is injecting everything the way I want it to in production and I can without too much hassle inject mock objects when I am writing unit tests.

However I now want to create integration tests so that I know that the entire flow is working and it is getting and parsing correct data from other APIs.

The problem I am seeing now is with solving dependency injection in a test environment. Because it is an integration test there are alot more dependencies to solve so doing this manually does not seem feasible.

So how is this usually solved? for reference I am using a mix of @EJB and @Inject to inject objects

Aucun commentaire:

Enregistrer un commentaire