Replace SeamAutowire with real CDI in tests

Description

Replacing Autowire with real CDI will enable less fragile, more accurate tests (eg multiple scopes), and the use of CDI interceptors. SeamAutowire for CDI is still based on Seam conventions like bean names, which means changing or removing a bean name might break a test.

Note that it is currently not possible to use CdiUnitRunner (for CDI-Unit injections) at the same time as DataProviderRunner (for parameterised test methods). It may be possible to implement delegation in one of the runners. This would be ideal.

If not, we could try starting CDI scopes (eg with DeltaSpike Container Control) and inject beans into the test ourselves.

Activity

Show:
Sean Flanigan
March 8, 2016, 5:50 AM

It is now possible to use @Parameterized in CDI-Unit tests as an alternative to DataProviderRunner. See https://github.com/zanata/zanata-server/pull/1106

Sean Flanigan
November 20, 2015, 8:14 AM
Ready for Release

Assignee

Carlos Munoz

Reporter

Sean Flanigan

Tested Version/s

None

Story Points

5

Epic Link

Sprint

None

Fix versions

Priority

unspecified