Search in sources :

Example 6 with UndertowServiceGenerator

use of com.palantir.conjure.java.services.UndertowServiceGenerator in project conjure-java by palantir.

the class UndertowServiceGeneratorTests method testPrefixedServices.

@Test
void testPrefixedServices() throws IOException {
    ConjureDefinition def = Conjure.parse(ImmutableList.of(new File("src/test/resources/example-service.yml")));
    List<Path> files = new GenerationCoordinator(MoreExecutors.directExecutor(), ImmutableSet.of(new UndertowServiceGenerator(Options.builder().packagePrefix("test.prefix").build()))).emit(def, tempDir);
    validateGeneratorOutput(files, Paths.get("src/test/resources/test/api"), ".undertow.prefix");
}
Also used : Path(java.nio.file.Path) ConjureDefinition(com.palantir.conjure.spec.ConjureDefinition) File(java.io.File) UndertowServiceGenerator(com.palantir.conjure.java.services.UndertowServiceGenerator) Test(org.junit.jupiter.api.Test)

Example 7 with UndertowServiceGenerator

use of com.palantir.conjure.java.services.UndertowServiceGenerator in project conjure-java by palantir.

the class AsyncRequestProcessingTest method beforeClass.

@BeforeAll
public static void beforeClass() throws IOException {
    ConjureDefinition def = Conjure.parse(ImmutableList.of(new File("src/test/resources/async-request-processing-test.yml")));
    List<Path> files = new GenerationCoordinator(MoreExecutors.directExecutor(), ImmutableSet.of(new UndertowServiceGenerator(Options.builder().undertowServicePrefix(true).undertowListenableFutures(true).build()), new JerseyServiceGenerator(Options.empty()))).emit(def, folder);
    validateGeneratorOutput(files, Paths.get("src/integrationInput/java/com/palantir/product"));
}
Also used : Path(java.nio.file.Path) JerseyServiceGenerator(com.palantir.conjure.java.services.JerseyServiceGenerator) ConjureDefinition(com.palantir.conjure.spec.ConjureDefinition) File(java.io.File) UndertowServiceGenerator(com.palantir.conjure.java.services.UndertowServiceGenerator) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 8 with UndertowServiceGenerator

use of com.palantir.conjure.java.services.UndertowServiceGenerator in project conjure-java by palantir.

the class UndertowServiceGeneratorTests method testEndpointWithNameCollisions.

@Test
public void testEndpointWithNameCollisions() throws IOException {
    ConjureDefinition def = Conjure.parse(ImmutableList.of(new File("src/test/resources/dangerous-name-service.yml")));
    File src = Files.createDirectory(tempDir.toPath().resolve("src")).toFile();
    List<Path> files = new GenerationCoordinator(MoreExecutors.directExecutor(), ImmutableSet.of(new UndertowServiceGenerator(Options.builder().undertowServicePrefix(true).build()))).emit(def, src);
    validateGeneratorOutput(files, Paths.get("src/integrationInput/java/com/palantir/product"));
}
Also used : Path(java.nio.file.Path) ConjureDefinition(com.palantir.conjure.spec.ConjureDefinition) File(java.io.File) UndertowServiceGenerator(com.palantir.conjure.java.services.UndertowServiceGenerator) Test(org.junit.jupiter.api.Test)

Example 9 with UndertowServiceGenerator

use of com.palantir.conjure.java.services.UndertowServiceGenerator in project conjure-java by palantir.

the class UndertowServiceGeneratorTests method testBinaryReturnInputStream.

@Test
public void testBinaryReturnInputStream() throws IOException {
    ConjureDefinition def = Conjure.parse(ImmutableList.of(new File("src/test/resources/example-binary.yml")));
    List<Path> files = new GenerationCoordinator(MoreExecutors.directExecutor(), ImmutableSet.of(new UndertowServiceGenerator(Options.empty()))).emit(def, tempDir);
    validateGeneratorOutput(files, Paths.get("src/test/resources/test/api"), ".undertow.binary");
}
Also used : Path(java.nio.file.Path) ConjureDefinition(com.palantir.conjure.spec.ConjureDefinition) File(java.io.File) UndertowServiceGenerator(com.palantir.conjure.java.services.UndertowServiceGenerator) Test(org.junit.jupiter.api.Test)

Aggregations

UndertowServiceGenerator (com.palantir.conjure.java.services.UndertowServiceGenerator)9 ConjureDefinition (com.palantir.conjure.spec.ConjureDefinition)9 File (java.io.File)9 Path (java.nio.file.Path)8 Test (org.junit.jupiter.api.Test)6 BeforeAll (org.junit.jupiter.api.BeforeAll)2 JerseyServiceGenerator (com.palantir.conjure.java.services.JerseyServiceGenerator)1 ObjectGenerator (com.palantir.conjure.java.types.ObjectGenerator)1 UndertowOptions (io.undertow.UndertowOptions)1