ich versuchte, es zu erhalten, indem:Wie Zugriff auf Spring ApplicationContext in junit @ BeforeClass statische Methode?
private static ApplicationContext applicationContext;
@Autowired
public static void setApplicationContext(ApplicationContext applicationContext) {
AuditorTest.applicationContext = applicationContext;
}
Aber es wie alle anderen Versuche, funktioniert nicht.
Wie autowire statisch ApplicationContext
?
Warum müssen Sie dies tun? –
Um db vor jUnit-Tests zu füllen? –
Sie müssen es einmal für den gesamten Testfall ausfüllen? –