You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2021/03/22 07:29:36 UTC
[camel] branch master updated: Remove unnecessary thread local in
CamelSpringTestHelper
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 133a1be Remove unnecessary thread local in CamelSpringTestHelper
133a1be is described below
commit 133a1be0ef04d649deb3d3b9121eabe1b0720695
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon Mar 22 08:29:10 2021 +0100
Remove unnecessary thread local in CamelSpringTestHelper
---
.../CamelSpringTestContextLoaderTestExecutionListener.java | 1 -
.../camel/test/spring/junit5/CamelSpringTestHelper.java | 11 +++++------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoaderTestExecutionListener.java b/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoaderTestExecutionListener.java
index b3eef1d..c320bae 100644
--- a/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoaderTestExecutionListener.java
+++ b/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoaderTestExecutionListener.java
@@ -40,7 +40,6 @@ public class CamelSpringTestContextLoaderTestExecutionListener extends AbstractT
@Override
public void prepareTestInstance(TestContext testContext) throws Exception {
- CamelSpringTestHelper.setTestClass(testContext.getTestClass());
CamelSpringTestHelper.setTestContext(testContext);
}
}
diff --git a/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestHelper.java b/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestHelper.java
index 2f886c1..cbabded 100644
--- a/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestHelper.java
+++ b/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestHelper.java
@@ -39,7 +39,6 @@ public final class CamelSpringTestHelper {
private static ThreadLocal<String> originalJmxDisabledValue = new ThreadLocal<>();
private static ThreadLocal<String> originalExcludeRoutesValue = new ThreadLocal<>();
- private static ThreadLocal<Class<?>> testClazz = new ThreadLocal<>();
private static ThreadLocal<TestContext> testContext = new ThreadLocal<>();
private CamelSpringTestHelper() {
@@ -62,15 +61,15 @@ public final class CamelSpringTestHelper {
}
public static Class<?> getTestClass() {
- return testClazz.get();
+ return getTestContext().getTestClass();
}
- public static void setTestClass(Class<?> testClass) {
- testClazz.set(testClass);
+ public static Method getTestMethod() {
+ return getTestContext().getTestMethod();
}
- public static Method getTestMethod() {
- return testContext.get().getTestMethod();
+ public static TestContext getTestContext() {
+ return testContext.get();
}
public static void setTestContext(TestContext context) {