Skip to content

Commit

Permalink
Functional tests and sample for Helidon SE Server (OpenAPITools#44)
Browse files Browse the repository at this point in the history
Signed-off-by: aserkes <andrii.serkes@oracle.com>
  • Loading branch information
aserkes authored Aug 22, 2022
1 parent 664f331 commit a6e18e9
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/configs/java-helidon-se-server.yaml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
}
}

0 comments on commit a6e18e9

Please sign in to comment.