I have a Spring Bean class which communicates with the DB, and I'm working on writing a test case for it.
I'm making use of DbUnit which sets up an in-memory database (based on extending a base DbUnit class) using JUnit Annotation @Before.
The issue is with the @Autowired bean I'm trying to test: it accesses the database in its @Postconstruct method, and this happens before DB Setup, note the class itself is annotated with @Component.
So, I need a way or annotation to use so that the bean I'm testing gets initialized only after the @Before JUnit method runs.