From cb5d101d2fe84f845ebfe8b9937a4809dc3e545c Mon Sep 17 00:00:00 2001 From: BrendanAndrews <113378507+BrendanAndrews@users.noreply.github.com> Date: Thu, 5 Dec 2024 21:40:44 -0500 Subject: [PATCH] Removing ExampleConsumer and TestConsumerTest --- .../alertMessenger/ExampleConsumer.java | 31 ---------- .../plugin/alertManager/TestConsumerTest.java | 60 ------------------- 2 files changed, 91 deletions(-) delete mode 100644 software/plugins/alert-messenger/src/main/java/tech/ebp/oqm/plugin/alertMessenger/ExampleConsumer.java delete mode 100644 software/plugins/alert-messenger/src/test/java/tech/ebp/oqm/plugin/alertManager/TestConsumerTest.java diff --git a/software/plugins/alert-messenger/src/main/java/tech/ebp/oqm/plugin/alertMessenger/ExampleConsumer.java b/software/plugins/alert-messenger/src/main/java/tech/ebp/oqm/plugin/alertMessenger/ExampleConsumer.java deleted file mode 100644 index 6c79c294c..000000000 --- a/software/plugins/alert-messenger/src/main/java/tech/ebp/oqm/plugin/alertMessenger/ExampleConsumer.java +++ /dev/null @@ -1,31 +0,0 @@ -// package tech.ebp.oqm.plugin.alertMessenger; - -// import com.fasterxml.jackson.databind.node.ObjectNode; -// import jakarta.annotation.PostConstruct; -// import jakarta.enterprise.context.ApplicationScoped; -// import lombok.Getter; -// import lombok.extern.slf4j.Slf4j; -// import org.eclipse.microprofile.reactive.messaging.Incoming; -// import org.eclipse.microprofile.reactive.messaging.Message; - -// import java.util.concurrent.CompletionStage; - -// @Slf4j -// @ApplicationScoped -// public class ExampleConsumer { - -// @Getter -// private boolean received = false; - -// @PostConstruct -// public void init() { -// log.info("Starting ExampleConsumer"); -// } - -// @Incoming("oqm-core-all-events") -// public CompletionStage receive(Message message) { -// log.info("Received message {}", message.getPayload()); -// this.received = true; -// return message.ack(); -// } -// } diff --git a/software/plugins/alert-messenger/src/test/java/tech/ebp/oqm/plugin/alertManager/TestConsumerTest.java b/software/plugins/alert-messenger/src/test/java/tech/ebp/oqm/plugin/alertManager/TestConsumerTest.java deleted file mode 100644 index d48d90b1f..000000000 --- a/software/plugins/alert-messenger/src/test/java/tech/ebp/oqm/plugin/alertManager/TestConsumerTest.java +++ /dev/null @@ -1,60 +0,0 @@ -// package tech.ebp.oqm.plugin.alertManager; - -// import com.fasterxml.jackson.databind.ObjectMapper; -// import io.quarkus.test.junit.QuarkusTest; -// import jakarta.inject.Inject; -// import lombok.extern.slf4j.Slf4j; -// import org.eclipse.microprofile.rest.client.inject.RestClient; -// import org.junit.jupiter.api.Assertions; -// import org.junit.jupiter.api.Test; -// import tech.ebp.oqm.lib.core.api.quarkus.runtime.OqmDatabaseService; -// import tech.ebp.oqm.lib.core.api.quarkus.runtime.restClient.OqmCoreApiClientService; -// import tech.ebp.oqm.lib.core.api.quarkus.runtime.sso.KcClientAuthService; -// import tech.ebp.oqm.plugin.alertMessenger.ExampleConsumer; - -// import java.time.LocalDateTime; - -// import static org.junit.jupiter.api.Assertions.assertFalse; - -// @Slf4j -// @QuarkusTest -// public class TestConsumerTest { - -// @Inject -// OqmDatabaseService oqmDatabaseService; -// @Inject -// KcClientAuthService serviceAccountService; -// @RestClient -// OqmCoreApiClientService coreApiClientService; -// @Inject -// ObjectMapper objectMapper; - -// @Inject -// ExampleConsumer testConsumer; - -// @Test -// public void test() throws InterruptedException { -// assertFalse(this.testConsumer.isReceived()); - -// String newid = this.coreApiClientService -// .storageBlockAdd( -// this.serviceAccountService.getAuthString(), -// "default", -// this.objectMapper.createObjectNode() -// .put("label", "new block") -// ) -// .await().indefinitely(); - -// log.info("Id of new block: {}", newid); - -// LocalDateTime timeout = LocalDateTime.now().plusMinutes(1); -// while(!this.testConsumer.isReceived()){ -// if(LocalDateTime.now().isAfter(timeout)){ -// Assertions.fail("Failed to receive message."); -// } - -// Thread.sleep(250); -// } -// } - -// }