diff --git a/docs/modules/ROOT/examples/components/mybatis-bean.yml b/docs/modules/ROOT/examples/components/mybatis-bean.yml
deleted file mode 100644
index 5e1384613cfa..000000000000
--- a/docs/modules/ROOT/examples/components/mybatis-bean.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-# Do not edit directly!
-# This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
-cqArtifactId: camel-quarkus-mybatis
-cqArtifactIdBase: mybatis
-cqNativeSupported: true
-cqStatus: Stable
-cqDeprecated: false
-cqJvmSince: 1.1.0
-cqNativeSince: 2.8.0
-cqCamelPartName: mybatis-bean
-cqCamelPartTitle: MyBatis Bean
-cqCamelPartDescription: Perform queries, inserts, updates or deletes in a relational database using MyBatis.
-cqExtensionPageTitle: MyBatis
diff --git a/docs/modules/ROOT/examples/components/mybatis.yml b/docs/modules/ROOT/examples/components/mybatis.yml
deleted file mode 100644
index 942d96ff42e1..000000000000
--- a/docs/modules/ROOT/examples/components/mybatis.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-# Do not edit directly!
-# This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
-cqArtifactId: camel-quarkus-mybatis
-cqArtifactIdBase: mybatis
-cqNativeSupported: true
-cqStatus: Stable
-cqDeprecated: false
-cqJvmSince: 1.1.0
-cqNativeSince: 2.8.0
-cqCamelPartName: mybatis
-cqCamelPartTitle: MyBatis
-cqCamelPartDescription: Performs a query, poll, insert, update or delete in a relational database using MyBatis.
-cqExtensionPageTitle: MyBatis
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 05380b3c999b..977b3639cf8b 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -212,7 +212,6 @@
*** xref:reference/extensions/mongodb.adoc[MongoDB]
*** xref:reference/extensions/mongodb-gridfs.adoc[MongoDB GridFS]
*** xref:reference/extensions/mustache.adoc[Mustache]
-*** xref:reference/extensions/mybatis.adoc[MyBatis]
*** xref:reference/extensions/nats.adoc[Nats]
*** xref:reference/extensions/netty.adoc[Netty]
*** xref:reference/extensions/netty-http.adoc[Netty HTTP]
diff --git a/docs/modules/ROOT/pages/reference/extensions/mybatis.adoc b/docs/modules/ROOT/pages/reference/extensions/mybatis.adoc
deleted file mode 100644
index 8f7ad4f18a6b..000000000000
--- a/docs/modules/ROOT/pages/reference/extensions/mybatis.adoc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Do not edit directly!
-// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
-= MyBatis
-:linkattrs:
-:cq-artifact-id: camel-quarkus-mybatis
-:cq-native-supported: true
-:cq-status: Stable
-:cq-status-deprecation: Stable
-:cq-description: Performs a query, poll, insert, update or delete in a relational database using MyBatis.
-:cq-deprecated: false
-:cq-jvm-since: 1.1.0
-:cq-native-since: 2.8.0
-
-[.badges]
-[.badge-key]##JVM since##[.badge-supported]##1.1.0## [.badge-key]##Native since##[.badge-supported]##2.8.0##
-
-Performs a query, poll, insert, update or delete in a relational database using MyBatis.
-
-== What's inside
-
-* xref:{cq-camel-components}::mybatis-component.adoc[MyBatis component], URI syntax: `mybatis:statement`
-* xref:{cq-camel-components}::mybatis-bean-component.adoc[MyBatis Bean component], URI syntax: `mybatis-bean:beanName:methodName`
-
-Please refer to the above links for usage and configuration details.
-
-== Maven coordinates
-
-https://code.quarkus.io/?extension-search=camel-quarkus-mybatis[Create a new project with this extension on code.quarkus.io, window="_blank"]
-
-Or add the coordinates to your existing project:
-
-[source,xml]
-----
-
- org.apache.camel.quarkus
- camel-quarkus-mybatis
-
-----
-
-Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
-
-== Additional Camel Quarkus configuration
-
-Please refer to https://quarkiverse.github.io/quarkiverse-docs/quarkus-mybatis/dev/index.html[Quarkus MyBatis] for configuration. It must enable the following options
-
-[source, properties]
-----
-quarkus.mybatis.xmlconfig.enable=true
-quarkus.mybatis.xmlconfig.path=SqlMapConfig.xml
-----
-TIP: `quarkus.mybatis.xmlconfig.path` must be the same with `configurationUri` param in the mybatis endpoint.
-
-
diff --git a/extensions-core/core/deployment/pom.xml b/extensions-core/core/deployment/pom.xml
index 765250a7dee4..065008c38e8b 100644
--- a/extensions-core/core/deployment/pom.xml
+++ b/extensions-core/core/deployment/pom.xml
@@ -37,6 +37,10 @@
io.quarkus
quarkus-arc-deployment
+
+ io.quarkus.arc
+ arc-processor
+
diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/InjectionPointsProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/InjectionPointsProcessor.java
index e8ced1788acf..6d924f1b982b 100644
--- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/InjectionPointsProcessor.java
+++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/InjectionPointsProcessor.java
@@ -78,6 +78,8 @@ public class InjectionPointsProcessor {
.createSimple(EndpointInject.class.getName());
private static final DotName PRODUCE_ANNOTATION = DotName
.createSimple(Produce.class.getName());
+ private static final DotName TEST_SUPPORT_CLASS_NAME = DotName
+ .createSimple("org.apache.camel.quarkus.test.CamelQuarkusTestSupport");
private static SyntheticBeanBuildItem syntheticBean(DotName name, Supplier> creator) {
return SyntheticBeanBuildItem.configure(name)
@@ -226,12 +228,16 @@ void syntheticBeans(
BuildProducer syntheticBeans,
BuildProducer proxyDefinitions) {
+ Set alreadyCreated = new HashSet<>();
+
for (AnnotationInstance annot : index.getIndex().getAnnotations(ENDPOINT_INJECT_ANNOTATION)) {
final AnnotationTarget target = annot.target();
switch (target.kind()) {
case FIELD: {
final FieldInfo field = target.asField();
- endpointInjectBeans(recorder, syntheticBeans, index.getIndex(), annot, field.type().name());
+ if (!excludeTestSyntheticBeanDuplicities(annot, alreadyCreated, field.declaringClass(), index.getIndex())) {
+ endpointInjectBeans(recorder, syntheticBeans, index.getIndex(), annot, field.type().name());
+ }
break;
}
case METHOD: {
@@ -251,8 +257,10 @@ void syntheticBeans(
switch (target.kind()) {
case FIELD: {
final FieldInfo field = target.asField();
- produceBeans(recorder, capabilities, syntheticBeans, proxyDefinitions, beanCapabilityAvailable,
- index.getIndex(), annot, field.type().name(), field.name(), field.declaringClass().name());
+ if (!excludeTestSyntheticBeanDuplicities(annot, alreadyCreated, field.declaringClass(), index.getIndex())) {
+ produceBeans(recorder, capabilities, syntheticBeans, proxyDefinitions, beanCapabilityAvailable,
+ index.getIndex(), annot, field.type().name(), field.name(), field.declaringClass().name());
+ }
break;
}
case METHOD: {
@@ -266,6 +274,47 @@ void syntheticBeans(
}
}
+ private boolean excludeTestSyntheticBeanDuplicities(AnnotationInstance annot, Set alreadyCreated,
+ ClassInfo declaringClass, IndexView index) {
+ String identifier = annot.toString(false) + ":" + getTargetClass(annot).toString();
+
+ if (extendsCamelQuarkusTest(declaringClass, index)) {
+ if (alreadyCreated.contains(identifier)) {
+ // System.out.println(">>>>>>>>>> already exists: " + identifier);
+ return true;
+ } else {
+ // System.out.println(">>>>>>>>>> creating: " + identifier);
+ alreadyCreated.add(identifier);
+ }
+ }
+ return false;
+ }
+
+ private DotName getTargetClass(AnnotationInstance annot) {
+ switch (annot.target().kind()) {
+ case FIELD:
+ return annot.target().asField().type().name();
+ case METHOD:
+ return annot.target().asMethod().returnType().name();
+ default:
+ return null;
+ }
+ }
+
+ private boolean extendsCamelQuarkusTest(ClassInfo declaringClass, IndexView indexView) {
+ if (declaringClass == null) {
+ return false;
+ }
+
+ if (TEST_SUPPORT_CLASS_NAME.equals(declaringClass.name())) {
+ return true;
+ }
+
+ //iterate over parent until found CamelQuarkusTest or null
+ return (declaringClass.superName() != null &&
+ extendsCamelQuarkusTest(indexView.getClassByName(declaringClass.superName()), indexView));
+ }
+
void produceBeans(CamelRecorder recorder, List capabilities,
BuildProducer syntheticBeans,
BuildProducer proxyDefinitions,
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 64d77a1b9d16..d896fac39267 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -166,7 +166,6 @@
mongodb
mongodb-gridfs
mustache
- mybatis
nats
netty
netty-http
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index a0e80c281938..ba04015c413e 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -148,7 +148,6 @@
mllp
mongodb-grouped
mustache
- mybatis
nats
netty
nitrite
diff --git a/pom.xml b/pom.xml
index ecd259d87236..66a027ea000d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -222,6 +222,7 @@
integration-test-groups
docs
integration-tests-jvm
+ test-framework
@@ -586,6 +587,10 @@
integration-tests-support
camel-quarkus-integration-test-support-
+
+ test-framework
+ camel-quarkus-test-framework
+
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 679a37770633..931d11337cc3 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -5299,6 +5299,11 @@
+
+ org.apache.camel
+ camel-test-junit5
+ ${camel.version}
+
org.apache.camel
camel-threadpoolfactory-vertx
@@ -7602,6 +7607,11 @@
camel-quarkus-jta-deployment
${camel-quarkus.version}
+
+ org.apache.camel.quarkus
+ camel-quarkus-junit5
+ ${camel-quarkus.version}
+
org.apache.camel.quarkus
camel-quarkus-kafka
@@ -10199,92 +10209,92 @@
-
- org.l2x6.cq
- cq-maven-plugin
-
-
- flatten-bom
-
- flatten-bom
-
- process-resources
-
-
-
-
-
- io.quarkus:quarkus-bom
-
-
-
-
-
- org.apache.camel.quarkus:*
- ca.uhn.hapi:*
- net.openhft:affinity
-
-
-
- org.amqphub.quarkus:quarkus-qpid-jms
- org.apache.geronimo.specs:geronimo-jms_2.0_spec
-
-
- com.datastax.oss:java-driver-core
- com.google.code.findbugs:jsr305
-
-
- com.datastax.oss:java-driver-query-builder
- com.google.code.findbugs:jsr305
-
-
- io.quarkiverse.minio:quarkus-minio
- com.google.code.findbugs:jsr305
-
-
- software.amazon.awssdk:apache-client
- commons-logging:commons-logging
-
-
- io.debezium:debezium-embedded:1.6.1.Final:jar
- javax.activation:activation,javax.servlet:javax.servlet-api,log4j:log4j,org.apache.kafka:kafka-log4j-appender,org.apache.kafka:connect-runtime,org.apache.kafka:connect-file
-
-
- org.glassfish.jaxb:jaxb-runtime
- jakarta.xml.bind:jakarta.xml.bind-api
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- com.google.http-client:google-http-client
- com.google.code.findbugs:jsr305
-
-
- io.debezium:debezium-embedded
- javax.ws.rs:javax.ws.rs-api
-
-
- io.grpc:grpc-netty
- com.google.code.findbugs:jsr305
-
-
- org.apache.httpcomponents:*
- commons-logging:commons-logging
-
-
- org.apache.kafka:connect-runtime
- javax.activation:activation,javax.servlet:javax.servlet-api,log4j:log4j
-
-
- com.fasterxml.jackson.module:jackson-module-jaxb-annotations
- jakarta.activation:jakarta.activation-api,jakarta.xml.bind:jakarta.xml.bind-api
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/test-framework/junit5/pom.xml b/test-framework/junit5/pom.xml
new file mode 100644
index 000000000000..3311436e05d5
--- /dev/null
+++ b/test-framework/junit5/pom.xml
@@ -0,0 +1,72 @@
+
+
+
+
+ org.apache.camel.quarkus
+ camel-quarkus-test-framework
+ 2.11.0-SNAPSHOT
+ ../pom.xml
+
+ 4.0.0
+
+ camel-quarkus-junit5
+ Camel Quarkus :: Test Framework :: Junit5
+
+
+
+ org.slf4j
+ slf4j-api
+
+
+ io.quarkus
+ quarkus-junit5
+
+
+ org.assertj
+ assertj-core
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+
+
+ org.apache.camel.quarkus
+ camel-quarkus-integration-test-support
+
+
+ org.apache.camel.quarkus
+ camel-quarkus-core
+
+
+ org.apache.camel
+ camel-test-junit5
+
+
+ org.apache.camel.quarkus
+ camel-quarkus-bean
+ test
+
+
+ org.apache.camel.quarkus
+ camel-quarkus-management
+
+
+
+
diff --git a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/AfterAllCallback.java b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/AfterAllCallback.java
new file mode 100644
index 000000000000..764c9b769899
--- /dev/null
+++ b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/AfterAllCallback.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.test;
+
+import io.quarkus.test.junit.callback.QuarkusTestAfterAllCallback;
+import io.quarkus.test.junit.callback.QuarkusTestContext;
+
+public class AfterAllCallback implements QuarkusTestAfterAllCallback {
+
+ @Override
+ public void afterAll(QuarkusTestContext context) {
+ CamelQuarkusTestSupport testInstance = (CamelQuarkusTestSupport) context.getTestInstance();
+
+ if (CallbackUtil.isPerClass(testInstance)) {
+ CallbackUtil.resetContext(testInstance);
+ }
+ }
+}
diff --git a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/AfterEachCallback.java b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/AfterEachCallback.java
new file mode 100644
index 000000000000..22e8e3af3599
--- /dev/null
+++ b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/AfterEachCallback.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.test;
+
+import io.quarkus.test.junit.callback.QuarkusTestAfterEachCallback;
+import io.quarkus.test.junit.callback.QuarkusTestMethodContext;
+
+public class AfterEachCallback implements QuarkusTestAfterEachCallback {
+
+ @Override
+ public void afterEach(QuarkusTestMethodContext context) {
+ CamelQuarkusTestSupport testInstance = (CamelQuarkusTestSupport) context.getTestInstance();
+
+ if (!CallbackUtil.isPerClass(testInstance)) {
+ CallbackUtil.resetContext(testInstance);
+ }
+ }
+}
diff --git a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/BeforeEachCallback.java b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/BeforeEachCallback.java
new file mode 100644
index 000000000000..fbded7f4c217
--- /dev/null
+++ b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/BeforeEachCallback.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.test;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+import io.quarkus.test.junit.callback.QuarkusTestBeforeEachCallback;
+import io.quarkus.test.junit.callback.QuarkusTestMethodContext;
+import org.junit.jupiter.api.extension.ExtensionContext;
+
+public class BeforeEachCallback implements QuarkusTestBeforeEachCallback {
+
+ @Override
+ public void beforeEach(QuarkusTestMethodContext context) {
+ CamelQuarkusTestSupport testInstance = (CamelQuarkusTestSupport) context.getTestInstance();
+ ExtensionContext mockContext = new CallbackUtil.MockExtensionContext(CallbackUtil.getLifecycle(testInstance),
+ getDisplayName(context.getTestMethod()));
+
+ try {
+ testInstance.mockBeforeEach(mockContext);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ testInstance.mockBeforeAll(mockContext);
+ }
+
+ private String getDisplayName(Method method) {
+ StringBuilder sb = new StringBuilder(method.getName());
+ sb.append("(");
+ sb.append(Arrays.stream(method.getParameterTypes()).map(c -> c.getSimpleName()).collect(Collectors.joining(", ")));
+ sb.append(")");
+
+ return sb.toString();
+ }
+
+}
diff --git a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CallbackUtil.java b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CallbackUtil.java
new file mode 100644
index 000000000000..84da04eef08d
--- /dev/null
+++ b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CallbackUtil.java
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.test;
+
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Method;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Function;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.TestInstances;
+import org.junit.jupiter.api.parallel.ExecutionMode;
+import org.junit.jupiter.engine.execution.ExtensionValuesStore;
+import org.junit.jupiter.engine.execution.NamespaceAwareStore;
+
+public class CallbackUtil {
+
+ static boolean isPerClass(CamelQuarkusTestSupport testSupport) {
+ return getLifecycle(testSupport).filter(lc -> lc.equals(TestInstance.Lifecycle.PER_CLASS)).isPresent();
+ }
+
+ static Optional getLifecycle(CamelQuarkusTestSupport testSupport) {
+ if (testSupport.getClass().getAnnotation(TestInstance.class) != null) {
+ return Optional.of(testSupport.getClass().getAnnotation(TestInstance.class).value());
+ }
+
+ return Optional.empty();
+ }
+
+ static void resetContext(CamelQuarkusTestSupport testInstance) {
+
+ try {
+ testInstance.context.getRouteController().stopAllRoutes();
+ testInstance.context.getRouteController().removeAllRoutes();
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ testInstance.context.getComponentNames().forEach(cn -> testInstance.context.removeComponent(cn));
+ MockEndpoint.resetMocks(testInstance.context);
+
+ //
+ // // if jmx object for context already exists. unmanage it
+ // if (testInstance.context.getManagementName() != null) {
+ // Object me = testInstance.context.getManagementStrategy().getManagementObjectStrategy()
+ // .getManagedObjectForCamelContext(testInstance.context);
+ // if (testInstance.context.getManagementStrategy().isManaged(me)) {
+ // try {
+ // testInstance.context.getManagementStrategy().unmanageObject(me);
+ // } catch (Exception e) {
+ // throw new RuntimeException(e);
+ // }
+ // System.out.println(">>>>> unmanaging: " + testInstance.getClass().getName());
+ // } else {
+ // System.out.println(">>>>> no need: " + testInstance.getClass().getName());
+ // }
+ // } else {
+ // System.out.println(">>>>> no managed name: " + testInstance.getClass().getName());
+ // }
+ }
+
+ static class MockExtensionContext implements ExtensionContext {
+
+ private final Optional lifecycle;
+ private final String currentTestName;
+ private final ExtensionContext.Store globalStore;
+
+ public MockExtensionContext(Optional lifecycle, String currentTestName) {
+ this.lifecycle = lifecycle;
+ this.currentTestName = currentTestName;
+ this.globalStore = new NamespaceAwareStore(new ExtensionValuesStore(null), ExtensionContext.Namespace.GLOBAL);
+ }
+
+ @Override
+ public Optional getParent() {
+ return Optional.empty();
+ }
+
+ @Override
+ public ExtensionContext getRoot() {
+ return null;
+ }
+
+ @Override
+ public String getUniqueId() {
+ return null;
+ }
+
+ @Override
+ public String getDisplayName() {
+ return currentTestName;
+ }
+
+ @Override
+ public Set getTags() {
+ return null;
+ }
+
+ @Override
+ public Optional getElement() {
+ return Optional.empty();
+ }
+
+ @Override
+ public Optional> getTestClass() {
+ return Optional.empty();
+ }
+
+ @Override
+ public Optional getTestInstanceLifecycle() {
+ return lifecycle;
+ }
+
+ @Override
+ public Optional