As you know, JUnit's @BeforeClass annotation must be declared static if you want it to run once before all the @test methods.
However, this cannot be used with dependency injection.
I want to clean up a database that I @Autowire with Spring Boot, once before I run my JUnit tests. I cannot @Autowire static fields so I need to think of a work around.
Any ideas?
Thanks
Aucun commentaire:
Enregistrer un commentaire