From 025077096bf374c5c3b2bae443bb3b3729ed6251 Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Fri, 6 Sep 2024 17:09:45 +0200 Subject: [PATCH] ci(#1195): make sure citrus-quarkus-it tests run --- .../citrus-quarkus/citrus-quarkus-it/pom.xml | 8 ++- .../quarkus/app/DemoApplicationTest.java | 69 +++++++++---------- 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/runtime/citrus-quarkus/citrus-quarkus-it/pom.xml b/runtime/citrus-quarkus/citrus-quarkus-it/pom.xml index 2ab0fbcf45..c5282a4b97 100644 --- a/runtime/citrus-quarkus/citrus-quarkus-it/pom.xml +++ b/runtime/citrus-quarkus/citrus-quarkus-it/pom.xml @@ -97,6 +97,13 @@ ${maven.home} + + + org.apache.maven.surefire + surefire-junit-platform + ${maven.surefire.plugin.version} + + @@ -118,5 +125,4 @@ - diff --git a/runtime/citrus-quarkus/citrus-quarkus-it/src/test/java/org/citrusframework/quarkus/app/DemoApplicationTest.java b/runtime/citrus-quarkus/citrus-quarkus-it/src/test/java/org/citrusframework/quarkus/app/DemoApplicationTest.java index 31f7dd0774..0131fc6075 100644 --- a/runtime/citrus-quarkus/citrus-quarkus-it/src/test/java/org/citrusframework/quarkus/app/DemoApplicationTest.java +++ b/runtime/citrus-quarkus/citrus-quarkus-it/src/test/java/org/citrusframework/quarkus/app/DemoApplicationTest.java @@ -32,16 +32,17 @@ import org.citrusframework.spi.BindToRegistry; import org.citrusframework.validation.DefaultTextEqualsMessageValidator; import org.citrusframework.validation.MessageValidator; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import static org.citrusframework.actions.CreateVariablesAction.Builder.createVariables; import static org.citrusframework.actions.ReceiveMessageAction.Builder.receive; import static org.citrusframework.actions.SendMessageAction.Builder.send; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; @QuarkusTest @CitrusSupport -public class DemoApplicationTest { +class DemoApplicationTest { @CitrusFramework private Citrus citrus; @@ -50,9 +51,7 @@ public class DemoApplicationTest { private final MessageQueue messageQueue = new DefaultMessageQueue("messages"); @CitrusEndpoint - @DirectEndpointConfig( - queue = "messageQueue" - ) + @DirectEndpointConfig(queue = "messageQueue") private DirectEndpoint messages; @BindToRegistry @@ -61,7 +60,7 @@ public class DemoApplicationTest { .build(); @CitrusResource - private TestCaseRunner t; + private TestCaseRunner testCaseRunner; @BindToRegistry private final DefaultTextEqualsMessageValidator textEqualsMessageValidator = new DefaultTextEqualsMessageValidator(); @@ -71,45 +70,45 @@ public class DemoApplicationTest { @Test void shouldInjectCitrusResources() { - Assertions.assertNotNull(citrus); - Assertions.assertNotNull(context); - Assertions.assertNotNull(t); - Assertions.assertNotNull(messages); - Assertions.assertNotNull(moreMessages); - Assertions.assertEquals(context.getReferenceResolver().resolve("textEqualsMessageValidator", MessageValidator.class), textEqualsMessageValidator); + assertNotNull(citrus); + assertNotNull(context); + assertNotNull(testCaseRunner); + assertNotNull(messages); + assertNotNull(moreMessages); + assertEquals(context.getReferenceResolver().resolve("textEqualsMessageValidator", MessageValidator.class), textEqualsMessageValidator); - t.variable("greeting", "Hello!"); + testCaseRunner.variable("greeting", "Hello!"); - t.given( - createVariables().variable("text", "Citrus rocks!") + testCaseRunner.given( + createVariables().variable("text", "Citrus rocks!") ); - t.when( - send() - .endpoint(messages) - .message() - .body("${text}") + testCaseRunner.when( + send() + .endpoint(messages) + .message() + .body("${text}") ); - t.when( - receive() - .endpoint(messages) - .message() - .body("${text}") + testCaseRunner.then( + receive() + .endpoint(messages) + .message() + .body("${text}") ); - t.when( - send() - .endpoint(moreMessages) - .message() - .body("${greeting}") + testCaseRunner.when( + send() + .endpoint(moreMessages) + .message() + .body("${greeting}") ); - t.when( - receive() - .endpoint(moreMessages) - .message() - .body("${greeting}") + testCaseRunner.then( + receive() + .endpoint(moreMessages) + .message() + .body("${greeting}") ); } }