diff --git a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/KubernetesActorTest.java b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/KubernetesActorTest.java index f9d2fecb22..58f5b5053e 100644 --- a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/KubernetesActorTest.java +++ b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/KubernetesActorTest.java @@ -29,6 +29,7 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +@Test(singleThreaded = true) public class KubernetesActorTest { private final KubernetesMockServer k8sServer = new KubernetesMockServer(new Context(), new MockWebServer(), @@ -47,9 +48,9 @@ public void stop() { k8sServer.destroy(); } - @Test public void shouldVerifyConnectedState() { try { + KubernetesActor.resetConnectionState(); Assert.assertFalse(new KubernetesActor(k8sClient).isDisabled()); } finally { KubernetesActor.resetConnectionState(); @@ -63,14 +64,15 @@ public void shouldVerifyConnectedState() { } } - @Test public void shouldOverruleConnectedState() { boolean initial = KubernetesSettings.isEnabled(); try { + KubernetesActor.resetConnectionState(); System.setProperty("citrus.kubernetes.enabled", "false"); Assert.assertTrue(new KubernetesActor(k8sClient).isDisabled()); } finally { System.setProperty("citrus.kubernetes.enabled", Boolean.toString(initial)); + KubernetesActor.resetConnectionState(); } initial = Boolean.parseBoolean(System.getProperty("citrus.test.actor.k8s.enabled", "true")); @@ -79,6 +81,7 @@ public void shouldOverruleConnectedState() { Assert.assertTrue(new KubernetesActor(k8sClient).isDisabled()); } finally { System.setProperty("citrus.test.actor.k8s.enabled", Boolean.toString(initial)); + KubernetesActor.resetConnectionState(); } } }