diff --git a/bin/configs/java-helidon-se-server.yaml b/bin/configs/java-helidon-se-server.yaml new file mode 100644 index 000000000000..56a76dc64d3d --- /dev/null +++ b/bin/configs/java-helidon-se-server.yaml @@ -0,0 +1,8 @@ +generatorName: java-helidon-server +library: se +outputDir: samples/server/petstore/helidon/se-default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/java-helidon/server +additionalProperties: + artifactId: petstore-helidon-se-server + hideGenerationTimestamp: "true" \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/mainTest.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/mainTest.mustache index ff32d68638dd..8e1db8cbd49d 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/mainTest.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/mainTest.mustache @@ -12,8 +12,10 @@ import io.helidon.webserver.WebServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public class MainTest { private static WebServer webServer; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java new file mode 100644 index 000000000000..634f59931991 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.java.helidon.functional; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +public class FunctionalHelidonSeServerTest extends FunctionalBase { + + @BeforeClass + public void setup() { + library("se"); + generatorName("java-helidon-server"); + } + + @Test + void buildPetstoreWithDefaultOptions() { + generate("src/test/resources/3_0/petstore.yaml"); + buildAndVerify("target/openapi-java-server.jar"); + } + + @Test + void buildPetstoreWithInterfaceOnly() { + inputSpec("src/test/resources/3_0/petstore.yaml"); + generate(createConfigurator().addAdditionalProperty(FunctionalBase.INTERFACE_ONLY, "true")); + buildAndVerify("target/openapi-java-server.jar"); + } + + @Test + void buildPetstoreWithFullProject() { + inputSpec("src/test/resources/3_0/petstore.yaml"); + generate(createConfigurator().addAdditionalProperty("fullProject", "true")); + buildAndVerify("target/openapi-java-server.jar"); + } +}