Skip to content
Advertisement

Tag: postconstruct

How to disable @PostConstruct in Spring during Test

Within a Spring Component I have a @PostConstruct statement. Similar to below: During Unit tests I would not like to have the @PostConstruct function called, is there a way to telling Spring not to do post processing? Or is there a better Annotation for calling a initiation method on a class durning non-testing ? Answer Since you are not testing

Advertisement