Search in sources :

Example 6 with JerseyServiceGenerator

use of com.palantir.conjure.java.services.JerseyServiceGenerator 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 7 with JerseyServiceGenerator

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

the class JerseyServiceGeneratorTests method testServiceGeneration.

private void testServiceGeneration(String conjureFile) throws IOException {
    ConjureDefinition def = Conjure.parse(ImmutableList.of(new File("src/test/resources/" + conjureFile + ".yml")));
    List<Path> files = new GenerationCoordinator(MoreExecutors.directExecutor(), ImmutableSet.of(new JerseyServiceGenerator(Options.builder().requireNotNullAuthAndBodyParams(true).build()))).emit(def, folder);
    validateGeneratorOutput(files, Paths.get("src/test/resources/test/api"), ".jersey");
}
Also used : Path(java.nio.file.Path) JerseyServiceGenerator(com.palantir.conjure.java.services.JerseyServiceGenerator) ConjureDefinition(com.palantir.conjure.spec.ConjureDefinition) File(java.io.File)

Example 8 with JerseyServiceGenerator

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

the class JerseyServiceGeneratorTests method testBinaryReturnResponse.

@Test
public void testBinaryReturnResponse() 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 JerseyServiceGenerator(Options.builder().jerseyBinaryAsResponse(true).build()))).emit(def, folder);
    validateGeneratorOutput(files, Paths.get("src/test/resources/test/api"), ".jersey.binary_as_response");
}
Also used : Path(java.nio.file.Path) JerseyServiceGenerator(com.palantir.conjure.java.services.JerseyServiceGenerator) ConjureDefinition(com.palantir.conjure.spec.ConjureDefinition) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 9 with JerseyServiceGenerator

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

the class JerseyServiceGeneratorTests 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 JerseyServiceGenerator(Options.empty()))).emit(def, folder);
    validateGeneratorOutput(files, Paths.get("src/test/resources/test/api"), ".jersey.binary");
}
Also used : Path(java.nio.file.Path) JerseyServiceGenerator(com.palantir.conjure.java.services.JerseyServiceGenerator) ConjureDefinition(com.palantir.conjure.spec.ConjureDefinition) File(java.io.File) Test(org.junit.jupiter.api.Test)

Aggregations

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