I assume you are using Guice for DI.
A discussion of question 4809 in the github repo framework should help answer your question.
I managed to get it to work using one of the solutions to the problem:
new GuiceApplicationBuilder() .configure((Map) Helpers.inMemoryDatabase()) .in(Mode.TEST) .build();
source share