From cff928b08efbf3845d9baeed78272306b1f4d41d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crocquesel?= <88554524+scrocquesel@users.noreply.github.com> Date: Sun, 18 Feb 2024 11:03:54 +0100 Subject: [PATCH] Refactor deprecated usages --- src/main/resources/application.properties | 3 +-- .../inulogic/PingSourceOperatorE2ETest.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 247080b..88c52ff 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,7 +5,6 @@ quarkus.quartz.start-mode=forced quarkus.container-image.builder=jib quarkus.operator-sdk.crd.apply=true +quarkus.kubernetes.namespace=default mp.messaging.outgoing.ping-source-requests.connector=quarkus-http - -%test.quarkus.operator-sdk.start-operator=true \ No newline at end of file diff --git a/src/test/java/com/inulogic/PingSourceOperatorE2ETest.java b/src/test/java/com/inulogic/PingSourceOperatorE2ETest.java index 0466a5a..781f76d 100644 --- a/src/test/java/com/inulogic/PingSourceOperatorE2ETest.java +++ b/src/test/java/com/inulogic/PingSourceOperatorE2ETest.java @@ -18,17 +18,36 @@ import com.inulogic.api.PingSource; import com.inulogic.api.PingSourceSpec; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import io.fabric8.kubernetes.api.model.ObjectMetaBuilder; import io.fabric8.kubernetes.client.KubernetesClient; +import io.javaoperatorsdk.operator.Operator; import io.quarkus.kubernetes.client.runtime.KubernetesClientUtils; import io.quarkus.test.junit.QuarkusTest; +import jakarta.inject.Inject; @QuarkusTest @WithWiremock(name = "ping-source-requests", urlProperty = "mp.messaging.outgoing.ping-source-requests.url") class PingSourceOperatorE2ETest { + @Inject + Operator operator; + + @BeforeAll + void startOperator() { + operator.start(); + } + + @AfterAll + void stopOperator() { + operator.stop(); + } + protected final KubernetesClient client = KubernetesClientUtils.createClient(); @Wiremock(name = "ping-source-requests")