From ac4a09c9fa390a4c3980ecc20b89f329adf99021 Mon Sep 17 00:00:00 2001 From: Matej Novotny Date: Wed, 9 Jun 2021 10:13:24 +0200 Subject: [PATCH 1/2] CDIInjectionEnricher uses deprecated BeanManager method, switch to a replacement. --- .../arquillian/testenricher/cdi/CDIInjectionEnricher.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testenrichers/cdi-jakarta/src/main/java/org/jboss/arquillian/testenricher/cdi/CDIInjectionEnricher.java b/testenrichers/cdi-jakarta/src/main/java/org/jboss/arquillian/testenricher/cdi/CDIInjectionEnricher.java index 243eb65d3..f1342c197 100644 --- a/testenrichers/cdi-jakarta/src/main/java/org/jboss/arquillian/testenricher/cdi/CDIInjectionEnricher.java +++ b/testenrichers/cdi-jakarta/src/main/java/org/jboss/arquillian/testenricher/cdi/CDIInjectionEnricher.java @@ -121,8 +121,9 @@ protected void injectClass(Object testCase) { @SuppressWarnings("unchecked") protected void injectNonContextualInstance(BeanManager manager, Object instance) { CreationalContext creationalContext = getCreationalContext(); - InjectionTarget injectionTarget = (InjectionTarget) manager.createInjectionTarget(manager - .createAnnotatedType(instance.getClass())); + InjectionTarget injectionTarget = (InjectionTarget) manager + .getInjectionTargetFactory(manager.createAnnotatedType(instance.getClass())) + .createInjectionTarget(null); injectionTarget.inject(instance, creationalContext); } } From 86ef3df8f6c97e94aefd71fa415422a3d545dba5 Mon Sep 17 00:00:00 2001 From: Matej Novotny Date: Fri, 11 Jun 2021 11:21:57 +0200 Subject: [PATCH 2/2] Also update the original javax enricher. --- testenrichers/cdi/pom.xml | 4 ++-- .../arquillian/testenricher/cdi/CDIInjectionEnricher.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/testenrichers/cdi/pom.xml b/testenrichers/cdi/pom.xml index 5fb93dfe9..ecf496be3 100644 --- a/testenrichers/cdi/pom.xml +++ b/testenrichers/cdi/pom.xml @@ -23,7 +23,7 @@ - 1.1.34.Final + 2.4.3.Final 2.2 1.7.30 @@ -48,7 +48,7 @@ javax.enterprise cdi-api - 1.0 + 1.2 provided diff --git a/testenrichers/cdi/src/main/java/org/jboss/arquillian/testenricher/cdi/CDIInjectionEnricher.java b/testenrichers/cdi/src/main/java/org/jboss/arquillian/testenricher/cdi/CDIInjectionEnricher.java index f93c418ae..9adc47d49 100644 --- a/testenrichers/cdi/src/main/java/org/jboss/arquillian/testenricher/cdi/CDIInjectionEnricher.java +++ b/testenrichers/cdi/src/main/java/org/jboss/arquillian/testenricher/cdi/CDIInjectionEnricher.java @@ -121,8 +121,9 @@ protected void injectClass(Object testCase) { @SuppressWarnings("unchecked") protected void injectNonContextualInstance(BeanManager manager, Object instance) { CreationalContext creationalContext = getCreationalContext(); - InjectionTarget injectionTarget = (InjectionTarget) manager.createInjectionTarget(manager - .createAnnotatedType(instance.getClass())); + InjectionTarget injectionTarget = (InjectionTarget) manager + .getInjectionTargetFactory(manager.createAnnotatedType(instance.getClass())) + .createInjectionTarget(null); injectionTarget.inject(instance, creationalContext); } }