From 192cbc1ea5c66b7a7d2ea5656a385bd6d4008d46 Mon Sep 17 00:00:00 2001 From: Thorsten Schlathoelter Date: Mon, 25 Nov 2024 13:45:53 +0100 Subject: [PATCH] feat: changes on open api feature due to first beta tests --- .../jbang/actions/JBangActionTest.java | 10 + .../citrusframework/jbang/xml/JBangTest.java | 10 + .../citrusframework/jbang/yaml/JBangTest.java | 10 + connectors/citrus-testcontainers/pom.xml | 207 ++++++++++-------- .../org/citrusframework/util/TestUtils.java | 32 ++- .../camel/integration/CamelJBangIT.java | 24 +- .../citrusframework/camel/xml/JBangTest.java | 10 + .../citrusframework/camel/yaml/JBangTest.java | 10 + .../groovy/dsl/container/WaitForTest.java | 17 +- .../citrusframework/testng/TestNGHelper.java | 41 +++- .../xml/container/WaitForTest.java | 14 +- .../yaml/container/WaitForTest.java | 13 +- .../citrus-test-api-generator-core/pom.xml | 2 - .../main/resources/java-citrus/api.mustache | 2 +- .../src/test/resources/apis/petstore-v3.yaml | 2 +- .../rest/extpetstore/ExtPetStoreOpenApi.java | 2 +- .../rest/extpetstore/model/Category.java | 2 +- .../extpetstore/model/HistoricalData.java | 2 +- .../rest/extpetstore/model/Pet.java | 2 +- .../rest/extpetstore/model/PetIdentifier.java | 2 +- .../rest/extpetstore/model/Tag.java | 2 +- .../model/VaccinationDocumentResult.java | 2 +- .../rest/extpetstore/request/ExtPetApi.java | 2 +- .../spring/ExtPetStoreBeanConfiguration.java | 2 +- .../spring/ExtPetStoreNamespaceHandler.java | 2 +- .../rest/petstore/PetStoreOpenApi.java | 2 +- .../rest/petstore/model/Address.java | 2 +- .../rest/petstore/model/Category.java | 2 +- .../rest/petstore/model/Customer.java | 2 +- .../rest/petstore/model/ModelApiResponse.java | 2 +- .../rest/petstore/model/Order.java | 2 +- .../expectedgen/rest/petstore/model/Pet.java | 2 +- .../expectedgen/rest/petstore/model/Tag.java | 2 +- .../expectedgen/rest/petstore/model/User.java | 2 +- .../rest/petstore/request/PetApi.java | 2 +- .../rest/petstore/request/StoreApi.java | 2 +- .../rest/petstore/request/UserApi.java | 2 +- .../spring/PetStoreBeanConfiguration.java | 2 +- .../spring/PetStoreNamespaceHandler.java | 2 +- .../request/BookServiceSoapApi.java | 2 +- .../spring/BookServiceBeanConfiguration.java | 2 +- .../spring/BookServiceNamespaceHandler.java | 2 +- .../maven/plugin/TestApiGeneratorMojo.java | 3 +- .../plugin/SpringMetaFileGeneratorTest.java | 3 +- 44 files changed, 313 insertions(+), 151 deletions(-) diff --git a/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/actions/JBangActionTest.java b/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/actions/JBangActionTest.java index 1a80074d7c..fedf6ff504 100644 --- a/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/actions/JBangActionTest.java +++ b/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/actions/JBangActionTest.java @@ -21,13 +21,23 @@ import org.citrusframework.jbang.UnitTestSupport; import org.citrusframework.spi.Resource; import org.citrusframework.spi.Resources; +import org.citrusframework.util.TestUtils; import org.testng.Assert; +import org.testng.SkipException; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class JBangActionTest extends UnitTestSupport { private final Resource helloScript = Resources.fromClasspath("org/citrusframework/jbang/hello.java"); + @BeforeClass + public static void beforeEach() { + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible."); + } + } + @Test public void testScriptOrFile() { JBangAction jbang = new JBangAction.Builder() diff --git a/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/xml/JBangTest.java b/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/xml/JBangTest.java index 07cc310078..c4fbdc6151 100644 --- a/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/xml/JBangTest.java +++ b/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/xml/JBangTest.java @@ -19,13 +19,23 @@ import org.citrusframework.TestCase; import org.citrusframework.TestCaseMetaInfo; import org.citrusframework.jbang.actions.JBangAction; +import org.citrusframework.util.TestUtils; import org.citrusframework.xml.XmlTestLoader; import org.citrusframework.xml.actions.XmlTestActionBuilder; import org.testng.Assert; +import org.testng.SkipException; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class JBangTest extends AbstractXmlActionTest { + @BeforeClass + public static void beforeEach() { + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible."); + } + } + @Test public void shouldLoadJBangActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/jbang/xml/jbang-test.xml"); diff --git a/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/yaml/JBangTest.java b/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/yaml/JBangTest.java index 596e61dc2b..03d272eee1 100644 --- a/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/yaml/JBangTest.java +++ b/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/yaml/JBangTest.java @@ -19,13 +19,23 @@ import org.citrusframework.TestCase; import org.citrusframework.TestCaseMetaInfo; import org.citrusframework.jbang.actions.JBangAction; +import org.citrusframework.util.TestUtils; import org.citrusframework.yaml.YamlTestLoader; import org.citrusframework.yaml.actions.YamlTestActionBuilder; import org.testng.Assert; +import org.testng.SkipException; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class JBangTest extends AbstractYamlActionTest { + @BeforeClass + public static void beforeEach() { + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible."); + } + } + @Test public void shouldLoadJBangActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/jbang/yaml/jbang-test.yaml"); diff --git a/connectors/citrus-testcontainers/pom.xml b/connectors/citrus-testcontainers/pom.xml index eee004cf4d..2fb9a692d4 100644 --- a/connectors/citrus-testcontainers/pom.xml +++ b/connectors/citrus-testcontainers/pom.xml @@ -1,102 +1,125 @@ - 4.0.0 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 - - org.citrusframework - citrus-connectors - 4.5.0-SNAPSHOT - ../pom.xml - + + org.citrusframework + citrus-connectors + 4.5.0-SNAPSHOT + ../pom.xml + - citrus-testcontainers - Citrus :: Connectors :: Testcontainers + citrus-testcontainers + Citrus :: Connectors :: Testcontainers - - - org.citrusframework - citrus-base - ${project.version} - - - org.citrusframework - citrus-kubernetes - ${project.version} - + + false + - - org.testcontainers - testcontainers - - - com.github.docker-java - docker-java-transport-okhttp - + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipContainerTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + ${skipContainerTests} + + + + - - org.testcontainers - mongodb - - - org.testcontainers - postgresql - - - org.testcontainers - redpanda - - - org.testcontainers - kafka - + + + org.citrusframework + citrus-base + ${project.version} + + + org.citrusframework + citrus-kubernetes + ${project.version} + - - org.apache.commons - commons-dbcp2 - + + org.testcontainers + testcontainers + + + com.github.docker-java + docker-java-transport-okhttp + - - - software.amazon.awssdk - auth - + + org.testcontainers + mongodb + + + org.testcontainers + postgresql + + + org.testcontainers + redpanda + + + org.testcontainers + kafka + - - - org.citrusframework - citrus-test-support - ${project.version} - test - - - org.citrusframework - citrus-testng - ${project.version} - test - - - org.citrusframework - citrus-spring - ${project.version} - test - - - org.citrusframework - citrus-xml - ${project.version} - test - - - org.citrusframework - citrus-yaml - ${project.version} - test - - - org.postgresql - postgresql - test - - + + org.apache.commons + commons-dbcp2 + + + + + software.amazon.awssdk + auth + + + + + org.citrusframework + citrus-test-support + ${project.version} + test + + + org.citrusframework + citrus-testng + ${project.version} + test + + + org.citrusframework + citrus-spring + ${project.version} + test + + + org.citrusframework + citrus-xml + ${project.version} + test + + + org.citrusframework + citrus-yaml + ${project.version} + test + + + org.postgresql + postgresql + test + + diff --git a/core/citrus-base/src/main/java/org/citrusframework/util/TestUtils.java b/core/citrus-base/src/main/java/org/citrusframework/util/TestUtils.java index 469d2963fe..8299a0db3d 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/util/TestUtils.java +++ b/core/citrus-base/src/main/java/org/citrusframework/util/TestUtils.java @@ -16,13 +16,9 @@ package org.citrusframework.util; -import org.citrusframework.CitrusSettings; -import org.citrusframework.Completable; -import org.citrusframework.context.TestContext; -import org.citrusframework.exceptions.CitrusRuntimeException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; @@ -30,6 +26,12 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import org.citrusframework.CitrusSettings; +import org.citrusframework.Completable; +import org.citrusframework.context.TestContext; +import org.citrusframework.exceptions.CitrusRuntimeException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Utility class for test cases providing several utility @@ -38,6 +40,8 @@ */ public abstract class TestUtils { + public static final String HTTPS_CITRUSFRAMEWORK_ORG = "https://citrusframework.org"; + /** Used to identify waiting task threads pool */ public static final String WAIT_THREAD_PREFIX = "citrus-waiting-"; @@ -137,4 +141,18 @@ private static Thread createWaitingThread(final Runnable runnable, TestContext c } return waitThread; } + + public static boolean isNetworkReachable() { + try { + URL url = new URL(HTTPS_CITRUSFRAMEWORK_ORG); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.setConnectTimeout(5000); + connection.setReadTimeout(5000); + int responseCode = connection.getResponseCode(); + return responseCode == HttpURLConnection.HTTP_OK; + } catch (IOException e) { + return false; + } + } } diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelJBangIT.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelJBangIT.java index a039791085..6397cc3b45 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelJBangIT.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelJBangIT.java @@ -16,20 +16,27 @@ package org.citrusframework.camel.integration; +import static org.citrusframework.camel.dsl.CamelSupport.camel; +import static org.citrusframework.container.Catch.Builder.catchException; +import static org.citrusframework.container.FinallySequence.Builder.doFinally; + import org.citrusframework.annotations.CitrusTest; import org.citrusframework.spi.Resources; import org.citrusframework.testng.TestNGCitrusSupport; +import org.citrusframework.util.TestUtils; +import org.testng.SkipException; import org.testng.annotations.Test; -import static org.citrusframework.camel.dsl.CamelSupport.camel; -import static org.citrusframework.container.Catch.Builder.catchException; -import static org.citrusframework.container.FinallySequence.Builder.doFinally; - public class CamelJBangIT extends TestNGCitrusSupport { @Test @CitrusTest(name = "RunIntegration_SourceCode_IT") public void runIntegrationWithSourceCodeIT() { + + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible."); + } + given(doFinally().actions( catchException().actions(camel().jbang().stop("hello")) )); @@ -58,6 +65,15 @@ public void runIntegrationWithSourceCodeIT() { @Test @CitrusTest(name = "RunIntegration_Resource_IT") public void runIntegrationWithResourceIT() { + + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible."); + } + + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible."); + } + given(doFinally().actions( catchException().actions(camel().jbang().stop("route")) )); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangTest.java index 789ca41cd7..e07645dbba 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangTest.java @@ -25,12 +25,22 @@ import org.citrusframework.camel.actions.CamelRunIntegrationAction; import org.citrusframework.camel.actions.CamelStopIntegrationAction; import org.citrusframework.camel.actions.CamelVerifyIntegrationAction; +import org.citrusframework.util.TestUtils; import org.citrusframework.xml.XmlTestLoader; import org.testng.Assert; +import org.testng.SkipException; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class JBangTest extends AbstractXmlActionTest { + @BeforeClass + public static void beforeEach() { + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible."); + } + } + @Test public void shouldLoadCamelActions() throws Exception { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/camel-jbang-test.xml"); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangTest.java index 53610b08eb..8bcb745d07 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangTest.java @@ -25,12 +25,22 @@ import org.citrusframework.camel.actions.CamelRunIntegrationAction; import org.citrusframework.camel.actions.CamelStopIntegrationAction; import org.citrusframework.camel.actions.CamelVerifyIntegrationAction; +import org.citrusframework.util.TestUtils; import org.citrusframework.yaml.YamlTestLoader; import org.testng.Assert; +import org.testng.SkipException; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class JBangTest extends AbstractYamlActionTest { + @BeforeClass + public static void beforeEach() { + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible."); + } + } + @Test public void shouldLoadCamelActions() throws Exception { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/camel-jbang-test.yaml"); diff --git a/runtime/citrus-groovy/src/test/java/org/citrusframework/groovy/dsl/container/WaitForTest.java b/runtime/citrus-groovy/src/test/java/org/citrusframework/groovy/dsl/container/WaitForTest.java index f47ff42fdb..2deedae134 100644 --- a/runtime/citrus-groovy/src/test/java/org/citrusframework/groovy/dsl/container/WaitForTest.java +++ b/runtime/citrus-groovy/src/test/java/org/citrusframework/groovy/dsl/container/WaitForTest.java @@ -16,6 +16,8 @@ package org.citrusframework.groovy.dsl.container; +import static org.citrusframework.util.TestUtils.HTTPS_CITRUSFRAMEWORK_ORG; + import org.citrusframework.TestCase; import org.citrusframework.TestCaseMetaInfo; import org.citrusframework.actions.EchoAction; @@ -30,7 +32,9 @@ import org.citrusframework.message.DefaultMessage; import org.citrusframework.message.DefaultMessageStore; import org.citrusframework.message.MessageStore; +import org.citrusframework.util.TestUtils; import org.testng.Assert; +import org.testng.SkipException; import org.testng.annotations.Test; public class WaitForTest extends AbstractGroovyActionDslTest { @@ -42,7 +46,11 @@ public class WaitForTest extends AbstractGroovyActionDslTest { @Test public void shouldLoadWaitFor() { - String httpUrl = "https://citrusframework.org"; + + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because citrus is not reachable. We are probably running behind a proxy."); + } + String filePath = "classpath:org/citrusframework/groovy/test-request-payload.xml"; MessageStore messageStore = new DefaultMessageStore(); @@ -70,11 +78,11 @@ public void shouldLoadWaitFor() { validateWaitAction(action, "10000", "2000", condition); action = (Wait) result.getTestAction(actionIndex++); - condition = getHttpCondition(httpUrl, DEFAULT_RESPONSE_CODE, DEFAULT_TIMEOUT); + condition = getHttpCondition(HTTPS_CITRUSFRAMEWORK_ORG, DEFAULT_RESPONSE_CODE, DEFAULT_TIMEOUT); validateWaitAction(action, DEFAULT_WAIT_TIME, DEFAULT_INTERVAL, condition); action = (Wait) result.getTestAction(actionIndex++); - condition = getHttpCondition(httpUrl + "/doesnotexist", "404", "2000"); + condition = getHttpCondition(HTTPS_CITRUSFRAMEWORK_ORG + "/doesnotexist", "404", "2000"); ((HttpCondition)condition).setMethod("GET"); validateWaitAction(action, "3000", DEFAULT_INTERVAL, condition); @@ -143,4 +151,7 @@ private void validateWaitAction(Wait action, String expectedMilliseconds, String Assert.assertEquals(((EchoAction) condition.getAction()).getMessage(), ((EchoAction)((ActionCondition) expectedCondition).getAction()).getMessage()); } } + + + } diff --git a/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGHelper.java b/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGHelper.java index f119dfea34..de2fcd364d 100644 --- a/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGHelper.java +++ b/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGHelper.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import java.util.Set; - import org.citrusframework.CitrusSettings; import org.citrusframework.DefaultTestCase; import org.citrusframework.TestCaseRunner; @@ -45,6 +44,7 @@ import org.slf4j.LoggerFactory; import org.testng.IHookCallBack; import org.testng.ITestResult; +import org.testng.SkipException; public final class TestNGHelper { @@ -71,10 +71,41 @@ private TestNGHelper() { */ public static void invokeTestMethod(Object target, ITestResult testResult, Method method, TestLoader testLoader, TestContext context, int invocationCount) { - Object[] params = TestNGParameterHelper.resolveParameter(target, testResult, method, context, invocationCount); - testLoader.configureTestCase(t -> TestNGParameterHelper.injectTestParameters(method, t, params)); - testLoader.doWithTestCase(t -> ReflectionHelper.invokeMethod(method, target, params)); - testLoader.load(); + + try { + Object[] params = TestNGParameterHelper.resolveParameter(target, testResult, method, + context, invocationCount); + testLoader.configureTestCase( + t -> TestNGParameterHelper.injectTestParameters(method, t, params)); + testLoader.doWithTestCase(t -> ReflectionHelper.invokeMethod(method, target, params)); + testLoader.load(); + } catch (CitrusRuntimeException e) { + SkipException skipException = getCauseOfType(e, SkipException.class); + if (skipException != null) { + throw skipException; + } + + throw e; + } + } + + /** + * Recursively checks if the cause of the given exception matches the target exception. + * + * @param exception The exception to check. + * @param targetCause The exception cause to search for. + * @return true if the target cause is found in the exception chain, false otherwise. + */ + public static T getCauseOfType(Throwable exception, Class targetCause) { + if (exception == null) { + return null; + } + + if (targetCause.isInstance(exception)) { + return targetCause.cast(exception); + } + + return getCauseOfType(exception.getCause(), targetCause); } /** diff --git a/runtime/citrus-xml/src/test/java/org/citrusframework/xml/container/WaitForTest.java b/runtime/citrus-xml/src/test/java/org/citrusframework/xml/container/WaitForTest.java index 40bea3f589..5869454777 100644 --- a/runtime/citrus-xml/src/test/java/org/citrusframework/xml/container/WaitForTest.java +++ b/runtime/citrus-xml/src/test/java/org/citrusframework/xml/container/WaitForTest.java @@ -16,6 +16,8 @@ package org.citrusframework.xml.container; +import static org.citrusframework.util.TestUtils.HTTPS_CITRUSFRAMEWORK_ORG; + import org.citrusframework.TestCase; import org.citrusframework.TestCaseMetaInfo; import org.citrusframework.actions.EchoAction; @@ -28,9 +30,11 @@ import org.citrusframework.message.DefaultMessage; import org.citrusframework.message.DefaultMessageStore; import org.citrusframework.message.MessageStore; +import org.citrusframework.util.TestUtils; import org.citrusframework.xml.XmlTestLoader; import org.citrusframework.xml.actions.AbstractXmlActionTest; import org.testng.Assert; +import org.testng.SkipException; import org.testng.annotations.Test; public class WaitForTest extends AbstractXmlActionTest { @@ -42,7 +46,11 @@ public class WaitForTest extends AbstractXmlActionTest { @Test public void shouldLoadWaitFor() { - String httpUrl = "https://citrusframework.org"; + + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because citrus is not reachable. We are probably running behind a proxy."); + } + String filePath = "classpath:org/citrusframework/xml/test-request-payload.xml"; MessageStore messageStore = new DefaultMessageStore(); @@ -70,11 +78,11 @@ public void shouldLoadWaitFor() { validateWaitAction(action, "10000", "2000", condition); action = (Wait) result.getTestAction(actionIndex++); - condition = getHttpCondition(httpUrl, DEFAULT_RESPONSE_CODE, DEFAULT_TIMEOUT); + condition = getHttpCondition(HTTPS_CITRUSFRAMEWORK_ORG, DEFAULT_RESPONSE_CODE, DEFAULT_TIMEOUT); validateWaitAction(action, DEFAULT_WAIT_TIME, DEFAULT_INTERVAL, condition); action = (Wait) result.getTestAction(actionIndex++); - condition = getHttpCondition(httpUrl + "/doesnotexist", "404", "2000"); + condition = getHttpCondition(HTTPS_CITRUSFRAMEWORK_ORG + "/doesnotexist", "404", "2000"); ((HttpCondition)condition).setMethod("GET"); validateWaitAction(action, "3000", DEFAULT_INTERVAL, condition); diff --git a/runtime/citrus-yaml/src/test/java/org/citrusframework/yaml/container/WaitForTest.java b/runtime/citrus-yaml/src/test/java/org/citrusframework/yaml/container/WaitForTest.java index 83933741b8..cb758c371d 100644 --- a/runtime/citrus-yaml/src/test/java/org/citrusframework/yaml/container/WaitForTest.java +++ b/runtime/citrus-yaml/src/test/java/org/citrusframework/yaml/container/WaitForTest.java @@ -16,6 +16,8 @@ package org.citrusframework.yaml.container; +import static org.citrusframework.util.TestUtils.HTTPS_CITRUSFRAMEWORK_ORG; + import org.citrusframework.TestCase; import org.citrusframework.TestCaseMetaInfo; import org.citrusframework.actions.EchoAction; @@ -28,9 +30,11 @@ import org.citrusframework.message.DefaultMessage; import org.citrusframework.message.DefaultMessageStore; import org.citrusframework.message.MessageStore; +import org.citrusframework.util.TestUtils; import org.citrusframework.yaml.YamlTestLoader; import org.citrusframework.yaml.actions.AbstractYamlActionTest; import org.testng.Assert; +import org.testng.SkipException; import org.testng.annotations.Test; public class WaitForTest extends AbstractYamlActionTest { @@ -42,7 +46,10 @@ public class WaitForTest extends AbstractYamlActionTest { @Test public void shouldLoadWaitFor() { - String httpUrl = "https://citrusframework.org"; + + if (!TestUtils.isNetworkReachable()) { + throw new SkipException("Test skipped because citrus is not reachable. We are probably running behind a proxy."); + } String filePath = "classpath:org/citrusframework/yaml/test-request-payload.xml"; MessageStore messageStore = new DefaultMessageStore(); @@ -70,11 +77,11 @@ public void shouldLoadWaitFor() { validateWaitAction(action, "10000", "2000", condition); action = (Wait) result.getTestAction(actionIndex++); - condition = getHttpCondition(httpUrl, DEFAULT_RESPONSE_CODE, DEFAULT_TIMEOUT); + condition = getHttpCondition(HTTPS_CITRUSFRAMEWORK_ORG, DEFAULT_RESPONSE_CODE, DEFAULT_TIMEOUT); validateWaitAction(action, DEFAULT_WAIT_TIME, DEFAULT_INTERVAL, condition); action = (Wait) result.getTestAction(actionIndex++); - condition = getHttpCondition(httpUrl + "/doesnotexist", "404", "2000"); + condition = getHttpCondition(HTTPS_CITRUSFRAMEWORK_ORG + "/doesnotexist", "404", "2000"); ((HttpCondition)condition).setMethod("GET"); validateWaitAction(action, "3000", DEFAULT_INTERVAL, condition); diff --git a/test-api-generator/citrus-test-api-generator-core/pom.xml b/test-api-generator/citrus-test-api-generator-core/pom.xml index f2de52ace1..5ea32baa45 100644 --- a/test-api-generator/citrus-test-api-generator-core/pom.xml +++ b/test-api-generator/citrus-test-api-generator-core/pom.xml @@ -234,7 +234,6 @@ ${project.basedir}/src/test/resources/apis/petstore-v3.yaml - rootContextPath=/api/v3 org.citrusframework.openapi.generator.rest.petstore org.citrusframework.openapi.generator.rest.petstore.request @@ -252,7 +251,6 @@ ${project.basedir}/src/test/resources/apis/petstore-extended-v3.yaml - rootContextPath=/api/v3/ext org.citrusframework.openapi.generator.rest.extpetstore org.citrusframework.openapi.generator.rest.extpetstore.request diff --git a/test-api-generator/citrus-test-api-generator-core/src/main/resources/java-citrus/api.mustache b/test-api-generator/citrus-test-api-generator-core/src/main/resources/java-citrus/api.mustache index 758f216a2c..441c05043b 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/main/resources/java-citrus/api.mustache +++ b/test-api-generator/citrus-test-api-generator-core/src/main/resources/java-citrus/api.mustache @@ -213,7 +213,7 @@ public class {{classname}} implements GeneratedApi private static final String METHOD = "{{httpMethod}}"; - private static final String ENDPOINT = "{{rootContextPath}}{{path}}"; + private static final String ENDPOINT = "{{#rootContextPath}}{{rootContextPath}}{{/rootContextPath}}{{^neglectBasePath}}{{basePathWithoutHost}}{{/neglectBasePath}}{{path}}"; private static final String OPERATION_NAME = "{{operationId}}"; {{#hasApiKeyAuth}} diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/apis/petstore-v3.yaml b/test-api-generator/citrus-test-api-generator-core/src/test/resources/apis/petstore-v3.yaml index 6e38ce59fc..8312d0e5a5 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/apis/petstore-v3.yaml +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/apis/petstore-v3.yaml @@ -21,7 +21,7 @@ externalDocs: description: Find out more about Swagger url: http://swagger.io servers: - - url: /api/v3 + - url: http://localhost:9000/api/v3 tags: - name: pet description: Everything about your Pets diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/ExtPetStoreOpenApi.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/ExtPetStoreOpenApi.java index 7b718ddf18..a170a880f7 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/ExtPetStoreOpenApi.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/ExtPetStoreOpenApi.java @@ -5,6 +5,6 @@ public class ExtPetStoreOpenApi { public static final OpenApiSpecification extPetStoreSpecification = OpenApiSpecification - .from(ExtPetStoreOpenApi.class.getResource("ExtPetStore_openApi.yaml")).withRootContext("/api/v3/ext"); + .from(ExtPetStoreOpenApi.class.getResource("ExtPetStore_openApi.yaml")); } diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Category.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Category.java index ab4d304e55..55049b07f8 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Category.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Category.java @@ -24,7 +24,7 @@ /** * Category */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-23T14:15:19.250811+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:56.748927500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class Category { private Long id; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/HistoricalData.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/HistoricalData.java index 3eae1cd296..f9e0df6955 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/HistoricalData.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/HistoricalData.java @@ -25,7 +25,7 @@ /** * Additional historical data for a vaccination report, not contained in internal storage. */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:24.834965400+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:56.748927500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class HistoricalData { private LocalDate lastVaccinationDate; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Pet.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Pet.java index efa1d0484f..e96c640952 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Pet.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Pet.java @@ -29,7 +29,7 @@ /** * Pet */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:24.834965400+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:56.748927500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class Pet { private Long id; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/PetIdentifier.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/PetIdentifier.java index a0d8d01f2b..c9e216c35d 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/PetIdentifier.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/PetIdentifier.java @@ -24,7 +24,7 @@ /** * PetIdentifier */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:24.834965400+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:56.748927500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class PetIdentifier { private String _name; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Tag.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Tag.java index fa1812d9d0..4a3d8ce7fc 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Tag.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/Tag.java @@ -24,7 +24,7 @@ /** * Tag */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:24.834965400+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:56.748927500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class Tag { private Long id; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/VaccinationDocumentResult.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/VaccinationDocumentResult.java index 429f6c4d71..9718fa1003 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/VaccinationDocumentResult.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/model/VaccinationDocumentResult.java @@ -24,7 +24,7 @@ /** * VaccinationDocumentResult */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:24.834965400+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:56.748927500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class VaccinationDocumentResult { private String documentId; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/request/ExtPetApi.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/request/ExtPetApi.java index 76084a33e5..c3b3a5f146 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/request/ExtPetApi.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/request/ExtPetApi.java @@ -42,7 +42,7 @@ import org.citrusframework.openapi.generator.rest.extpetstore.model.VaccinationDocumentResult; @SuppressWarnings("unused") -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-23T14:15:19.250811+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:56.748927500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class ExtPetApi implements GeneratedApi { diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/spring/ExtPetStoreBeanConfiguration.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/spring/ExtPetStoreBeanConfiguration.java index d7932a6512..1d2dd76533 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/spring/ExtPetStoreBeanConfiguration.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/spring/ExtPetStoreBeanConfiguration.java @@ -15,7 +15,7 @@ import org.citrusframework.openapi.generator.rest.extpetstore.ExtPetStoreOpenApi; @Configuration -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-23T14:15:19.250811+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:56.748927500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class ExtPetStoreBeanConfiguration { @Bean diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/spring/ExtPetStoreNamespaceHandler.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/spring/ExtPetStoreNamespaceHandler.java index 75087dba7b..5525418d45 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/spring/ExtPetStoreNamespaceHandler.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/extpetstore/spring/ExtPetStoreNamespaceHandler.java @@ -12,7 +12,7 @@ import org.citrusframework.openapi.testapi.GeneratedApi; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:24.834965400+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:56.748927500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class ExtPetStoreNamespaceHandler extends NamespaceHandlerSupport { @Override diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/PetStoreOpenApi.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/PetStoreOpenApi.java index 4ef8b2f372..5565d7b5e7 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/PetStoreOpenApi.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/PetStoreOpenApi.java @@ -5,6 +5,6 @@ public class PetStoreOpenApi { public static final OpenApiSpecification petStoreSpecification = OpenApiSpecification - .from(PetStoreOpenApi.class.getResource("petStore_openApi.yaml")).withRootContext("/api/v3"); + .from(PetStoreOpenApi.class.getResource("petStore_openApi.yaml")); } diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Address.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Address.java index 03ab005413..06800d5d54 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Address.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Address.java @@ -24,7 +24,7 @@ /** * Address */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-23T14:15:17.563204500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class Address { private String street; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Category.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Category.java index 4a11c5a39b..63614e1e3e 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Category.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Category.java @@ -24,7 +24,7 @@ /** * Category */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-23T14:15:17.563204500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class Category { private Long id; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Customer.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Customer.java index 7b97537cc5..c98b31df30 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Customer.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Customer.java @@ -28,7 +28,7 @@ /** * Customer */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-23T14:15:17.563204500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class Customer { private Long id; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/ModelApiResponse.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/ModelApiResponse.java index debf1914a1..15e666dfee 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/ModelApiResponse.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/ModelApiResponse.java @@ -24,7 +24,7 @@ /** * ModelApiResponse */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:22.933962900+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class ModelApiResponse { private Integer code; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Order.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Order.java index 7121812e9a..9d2db02a4f 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Order.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Order.java @@ -25,7 +25,7 @@ /** * Order */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:22.933962900+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class Order { private Long id; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Pet.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Pet.java index 6c559b7187..564342da9d 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Pet.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Pet.java @@ -29,7 +29,7 @@ /** * Pet */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:22.933962900+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class Pet { private Long id; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Tag.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Tag.java index 9ea1673749..d55bbfc147 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Tag.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/Tag.java @@ -24,7 +24,7 @@ /** * Tag */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:22.933962900+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class Tag { private Long id; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/User.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/User.java index 5f8a707919..c351448931 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/User.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/model/User.java @@ -24,7 +24,7 @@ /** * User */ -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:22.933962900+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class User { private Long id; diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/PetApi.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/PetApi.java index 7b8ff5ddb0..f4a0df5fab 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/PetApi.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/PetApi.java @@ -37,7 +37,7 @@ import org.citrusframework.openapi.generator.rest.petstore.model.Pet; @SuppressWarnings("unused") -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:22.933962900+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class PetApi implements GeneratedApi { diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/StoreApi.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/StoreApi.java index 0cc32fcbf3..1f82bc08ab 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/StoreApi.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/StoreApi.java @@ -36,7 +36,7 @@ import org.citrusframework.openapi.generator.rest.petstore.model.Order; @SuppressWarnings("unused") -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:22.933962900+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class StoreApi implements GeneratedApi { diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/UserApi.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/UserApi.java index 3d95fb5f83..ea7bd796db 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/UserApi.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/request/UserApi.java @@ -37,7 +37,7 @@ import org.citrusframework.openapi.generator.rest.petstore.model.User; @SuppressWarnings("unused") -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:22.933962900+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class UserApi implements GeneratedApi { diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/spring/PetStoreBeanConfiguration.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/spring/PetStoreBeanConfiguration.java index d0977edc57..41ac4c33c5 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/spring/PetStoreBeanConfiguration.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/spring/PetStoreBeanConfiguration.java @@ -17,7 +17,7 @@ import org.citrusframework.openapi.generator.rest.petstore.PetStoreOpenApi; @Configuration -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:22.933962900+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class PetStoreBeanConfiguration { @Bean diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/spring/PetStoreNamespaceHandler.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/spring/PetStoreNamespaceHandler.java index ab552013cf..acc353b014 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/spring/PetStoreNamespaceHandler.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/rest/petstore/spring/PetStoreNamespaceHandler.java @@ -14,7 +14,7 @@ import org.citrusframework.openapi.testapi.GeneratedApi; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-19T06:57:22.933962900+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:55.767401300+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class PetStoreNamespaceHandler extends NamespaceHandlerSupport { @Override diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/request/BookServiceSoapApi.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/request/BookServiceSoapApi.java index 8c03fdf46f..787fac3f6a 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/request/BookServiceSoapApi.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/request/BookServiceSoapApi.java @@ -15,7 +15,7 @@ import org.citrusframework.openapi.testapi.SoapApiSendMessageActionBuilder; @SuppressWarnings("unused") -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-23T14:15:20.169378200+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:57.221987500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class BookServiceSoapApi implements GeneratedApi { diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/spring/BookServiceBeanConfiguration.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/spring/BookServiceBeanConfiguration.java index 04921c434c..013ba6bad6 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/spring/BookServiceBeanConfiguration.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/spring/BookServiceBeanConfiguration.java @@ -15,7 +15,7 @@ import org.citrusframework.openapi.generator.soap.bookservice.BookServiceOpenApi; @Configuration -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-23T14:15:20.169378200+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:57.221987500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class BookServiceBeanConfiguration { @Bean diff --git a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/spring/BookServiceNamespaceHandler.java b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/spring/BookServiceNamespaceHandler.java index 79dab026da..4a3c422f8e 100644 --- a/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/spring/BookServiceNamespaceHandler.java +++ b/test-api-generator/citrus-test-api-generator-core/src/test/resources/org/citrusframework/openapi/generator/ExpectedCodeGenIT/expectedgen/soap/bookservice/spring/BookServiceNamespaceHandler.java @@ -10,7 +10,7 @@ import org.citrusframework.openapi.testapi.GeneratedApi; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; -@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-23T14:15:20.169378200+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") +@jakarta.annotation.Generated(value = "org.citrusframework.openapi.generator.CitrusJavaCodegen", date = "2024-11-25T13:12:57.221987500+01:00[Europe/Zurich]", comments = "Generator version: 7.9.0") public class BookServiceNamespaceHandler extends NamespaceHandlerSupport { @Override diff --git a/test-api-generator/citrus-test-api-generator-maven-plugin/src/main/java/org/citrusframework/maven/plugin/TestApiGeneratorMojo.java b/test-api-generator/citrus-test-api-generator-maven-plugin/src/main/java/org/citrusframework/maven/plugin/TestApiGeneratorMojo.java index 4e82c50f6c..655d0dcba1 100644 --- a/test-api-generator/citrus-test-api-generator-maven-plugin/src/main/java/org/citrusframework/maven/plugin/TestApiGeneratorMojo.java +++ b/test-api-generator/citrus-test-api-generator-maven-plugin/src/main/java/org/citrusframework/maven/plugin/TestApiGeneratorMojo.java @@ -22,6 +22,7 @@ import static org.citrusframework.openapi.generator.CitrusJavaCodegen.API_ENDPOINT; import static org.citrusframework.openapi.generator.CitrusJavaCodegen.API_TYPE; import static org.citrusframework.openapi.generator.CitrusJavaCodegen.PREFIX; +import static org.citrusframework.openapi.generator.CitrusJavaCodegen.ROOT_CONTEXT_PATH; import static org.citrusframework.openapi.generator.CitrusJavaCodegen.TARGET_XMLNS_NAMESPACE; import static org.springframework.util.ReflectionUtils.findField; import static org.springframework.util.ReflectionUtils.makeAccessible; @@ -262,7 +263,7 @@ CodeGenMojo configureCodeGenMojo(ApiConfig apiConfig) throws MojoExecutionExcept properties.addAll(apiConfig.additionalProperties); } apiConfig.additionalProperties = properties; - apiConfig.additionalProperties.add(String.format("%s=%s",CodeGenMojoWrapper.ROOT_CONTEXT_PATH, apiConfig.rootContextPath)); + apiConfig.additionalProperties.add(String.format("%s=%s", ROOT_CONTEXT_PATH, apiConfig.rootContextPath)); } propagateBuildContext(codeGenMojo); diff --git a/test-api-generator/citrus-test-api-generator-maven-plugin/src/test/java/org/citrusframework/maven/plugin/SpringMetaFileGeneratorTest.java b/test-api-generator/citrus-test-api-generator-maven-plugin/src/test/java/org/citrusframework/maven/plugin/SpringMetaFileGeneratorTest.java index 5288bb40e2..7208ddeae7 100644 --- a/test-api-generator/citrus-test-api-generator-maven-plugin/src/test/java/org/citrusframework/maven/plugin/SpringMetaFileGeneratorTest.java +++ b/test-api-generator/citrus-test-api-generator-maven-plugin/src/test/java/org/citrusframework/maven/plugin/SpringMetaFileGeneratorTest.java @@ -13,7 +13,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) @@ -39,7 +38,7 @@ void generateMetaFiles() throws MojoExecutionException { MavenProject mavenProject = mock(); doReturn(new File(userDir)).when(mavenProject).getBasedir(); doReturn(mavenProject).when(testApiGeneratorMojo).getMavenProject(); - doReturn("SpringMetaFileGeneratorTest/META-INF").when(testApiGeneratorMojo).metaInfFolder(); + doReturn("/test-classes/SpringMetaFileGeneratorTest/META-INF").when(testApiGeneratorMojo).metaInfFolder(); ApiConfig apiConfig = new ApiConfig(); apiConfig.setPrefix("PrefixA");