public class CDIInjectionEnricher extends java.lang.Object implements TestEnricher
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ANNOTATION_NAME |
private Instance<javax.enterprise.inject.spi.BeanManager> |
beanManagerInst |
private InstanceProducer<javax.enterprise.context.spi.CreationalContext> |
creationalContextProducer |
private static java.util.logging.Logger |
log |
Constructor and Description |
---|
CDIInjectionEnricher() |
Modifier and Type | Method and Description |
---|---|
void |
enrich(java.lang.Object testCase)
Extension point to add features to the a Test class instance.
IE. |
javax.enterprise.inject.spi.BeanManager |
getBeanManager() |
javax.enterprise.context.spi.CreationalContext<java.lang.Object> |
getCreationalContext() |
private <T> T |
getInstanceByType(javax.enterprise.inject.spi.BeanManager manager,
int position,
java.lang.reflect.Method method) |
protected void |
injectClass(java.lang.Object testCase) |
protected void |
injectNonContextualInstance(javax.enterprise.inject.spi.BeanManager manager,
java.lang.Object instance) |
java.lang.Object[] |
resolve(java.lang.reflect.Method method)
Extension point to add features to the test method arguments.
IE. |
private static final java.lang.String ANNOTATION_NAME
private static final java.util.logging.Logger log
@Inject @TestScoped private InstanceProducer<javax.enterprise.context.spi.CreationalContext> creationalContextProducer
public javax.enterprise.inject.spi.BeanManager getBeanManager()
public javax.enterprise.context.spi.CreationalContext<java.lang.Object> getCreationalContext()
public void enrich(java.lang.Object testCase)
TestEnricher
enrich
in interface TestEnricher
testCase
- The test case instancepublic java.lang.Object[] resolve(java.lang.reflect.Method method)
TestEnricher
TestEnricher
.resolve
in interface TestEnricher
private <T> T getInstanceByType(javax.enterprise.inject.spi.BeanManager manager, int position, java.lang.reflect.Method method)
protected void injectClass(java.lang.Object testCase)
protected void injectNonContextualInstance(javax.enterprise.inject.spi.BeanManager manager, java.lang.Object instance)