diff --git a/cart-service/pom.xml b/cart-service/pom.xml index e5e160a..b77e797 100644 --- a/cart-service/pom.xml +++ b/cart-service/pom.xml @@ -5,7 +5,7 @@ com.drinkool drinkool - 1.5.15 + 1.5.16 ../pom.xml diff --git a/cart-service/src/main/java/com/drinkool/GreetingResource.java b/cart-service/src/main/java/com/drinkool/GreetingResource.java deleted file mode 100644 index 2648675..0000000 --- a/cart-service/src/main/java/com/drinkool/GreetingResource.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.drinkool; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@Path("/hello") -public class GreetingResource { - - @GET - @Produces(MediaType.TEXT_PLAIN) - public String hello() { - return "Hello from Quarkus REST"; - } -} diff --git a/cart-service/src/main/java/com/drinkool/MyMessagingApplication.java b/cart-service/src/main/java/com/drinkool/MyMessagingApplication.java deleted file mode 100644 index 9ffdede..0000000 --- a/cart-service/src/main/java/com/drinkool/MyMessagingApplication.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.drinkool; - -import io.quarkus.runtime.StartupEvent; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; -import org.eclipse.microprofile.reactive.messaging.Channel; -import org.eclipse.microprofile.reactive.messaging.Emitter; -import org.eclipse.microprofile.reactive.messaging.Incoming; -import org.eclipse.microprofile.reactive.messaging.Outgoing; - -import java.util.stream.Stream; - -@ApplicationScoped -public class MyMessagingApplication { - - /** - * Injects an emitter to send messages to the "words-out" channel. - */ - @Channel("words-out") - Emitter emitter; - - /** - * Sends message to the "words-out" channel, can be used from a JAX-RS resource or any bean of your application. - * Messages are sent to the broker. - **/ - void onStart(@Observes StartupEvent ev) { - Stream.of("Hello", "with", "Quarkus", "Messaging", "message").forEach(string -> emitter.send(string)); - } - - /** - * Consume the message from the "words-in" channel, uppercase it and send it to the uppercase channel. - * This method is called by the framework when a message is received on the "words-in" channel (from the broker). - **/ - @Incoming("words-in") - @Outgoing("uppercase") - public String toUpperCase(String message) { - return message.toUpperCase(); - } - - /** - * Consume the uppercase channel (coming from within the application) and print the messages to the console. - **/ - @Incoming("uppercase") - public void sink(String word) { - System.out.println(">> " + word); - } -} diff --git a/cart-service/src/test/java/com/drinkool/GreetingResourceIT.java b/cart-service/src/test/java/com/drinkool/GreetingResourceIT.java deleted file mode 100644 index 688a75b..0000000 --- a/cart-service/src/test/java/com/drinkool/GreetingResourceIT.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.drinkool; - -import io.quarkus.test.junit.QuarkusIntegrationTest; - -@QuarkusIntegrationTest -class GreetingResourceIT extends GreetingResourceTest { - // Execute the same tests but in packaged mode. -} diff --git a/cart-service/src/test/java/com/drinkool/GreetingResourceTest.java b/cart-service/src/test/java/com/drinkool/GreetingResourceTest.java deleted file mode 100644 index 894bbed..0000000 --- a/cart-service/src/test/java/com/drinkool/GreetingResourceTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.drinkool; - -import io.quarkus.test.junit.QuarkusTest; -import org.junit.jupiter.api.Test; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; - -@QuarkusTest -class GreetingResourceTest { - @Test - void testHelloEndpoint() { - given() - .when().get("/hello") - .then() - .statusCode(200) - .body(is("Hello from Quarkus REST")); - } - -} \ No newline at end of file diff --git a/cart-service/src/test/java/com/drinkool/MyMessagingApplicationTest.java b/cart-service/src/test/java/com/drinkool/MyMessagingApplicationTest.java deleted file mode 100644 index 4e7c537..0000000 --- a/cart-service/src/test/java/com/drinkool/MyMessagingApplicationTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.drinkool; - -import io.quarkus.test.junit.QuarkusTest; - -import org.junit.jupiter.api.Test; - -import jakarta.inject.Inject; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -@QuarkusTest -class MyMessagingApplicationTest { - - @Inject - MyMessagingApplication application; - - @Test - void test() { - assertEquals("HELLO", application.toUpperCase("Hello")); - assertEquals("BONJOUR", application.toUpperCase("bonjour")); - } -}