lundi 13 janvier 2020

junit cleanup test data in object level

I'm new to junit.

I like to create some artifacts in DB before all the tests run and delete them afterward. but I can't use @BeforeClass and @AfterClass because they are static, my runner will run my cases in parellel so I need it per-object.

I'd imagine there are sort of non static setup()/ teardown() methods I can override in my cases, but could not find it.

What's the common practice for this situation?

--EDIT--

@Before and @After are not good as well. The per test creation and deletion will be an issue to the system

Aucun commentaire:

Enregistrer un commentaire