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");
}
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"));
}
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"));
}
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");
}
Aggregations