mardi 6 octobre 2015

Non static @BeforeClass equivalent when Spring unit test runner? [duplicate]

This question already has an answer here:

I have multiple interconnected beans in configuration and would like to test various operation after global state changed.

For example, I have execute() of some bean, after which many beans are changed.

Currently I put all check inside testExecute() method, but this method becomes huge and non-separated.

Is it possible to execute execute() before entire class run, i.e. just after context was initialized?

@BeforeClass methods should be static, while I need to have context already initialized and autowired. Is it possible?

Aucun commentaire:

Enregistrer un commentaire