quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.67k stars 2.65k forks source link

Fire CDI events at certain parts of the test lifecycle #11812

Open famod opened 4 years ago

famod commented 4 years ago

Description This came up here: https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Mocking.20an.20interface/near/208800925

For some testing use cases it would be very handy if you could observe CDI events for e.g. test started or test finished. This could then be used to e.g. reset an @ApplicationScoped "mockito interface mock" (see zulip link) in a producer after the test finished.

I guess it also makes sense to document how to use it, ideally with the mock producer use case.

quarkusbot commented 4 years ago

/cc @mkouba, @manovotn