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")