use of com.palantir.conjure.spec.ConjureDefinition 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.spec.ConjureDefinition in project conjure-java by palantir.
the class ObjectGeneratorTests method testObjectGenerator_allExamples.
@Test
public void testObjectGenerator_allExamples() throws IOException {
ConjureDefinition def = Conjure.parse(ImmutableList.of(new File("src/test/resources/example-types.yml")));
List<Path> files = new GenerationCoordinator(MoreExecutors.directExecutor(), ImmutableSet.of(new ObjectGenerator(Options.builder().useImmutableBytes(true).strictObjects(true).nonNullCollections(true).excludeEmptyOptionals(true).unionsWithUnknownValues(true).build()))).emit(def, tempDir);
assertThatFilesAreTheSame(files, REFERENCE_FILES_FOLDER);
}
use of com.palantir.conjure.spec.ConjureDefinition in project conjure-java by palantir.
the class ObjectGeneratorTests method testObjectGenerator_allExamples_with_prefix.
@Test
public void testObjectGenerator_allExamples_with_prefix() throws IOException {
ConjureDefinition def = Conjure.parse(ImmutableList.of(new File("src/test/resources/example-types.yml")));
List<Path> files = new GenerationCoordinator(MoreExecutors.directExecutor(), ImmutableSet.of(new ObjectGenerator(Options.builder().packagePrefix("test.prefix").excludeEmptyOptionals(true).build()))).emit(def, tempDir);
assertThatFilesAreTheSame(files, REFERENCE_FILES_FOLDER);
}
use of com.palantir.conjure.spec.ConjureDefinition in project conjure-java by palantir.
the class DialogueServiceGeneratorTests 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 DialogueServiceGenerator(Options.builder().packagePrefix("test.prefix").build()))).emit(def, folder);
validateGeneratorOutput(files, Paths.get("src/test/resources/test/api"), ".dialogue.prefix");
}
use of com.palantir.conjure.spec.ConjureDefinition in project conjure-java by palantir.
the class DialogueServiceGeneratorTests 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 DialogueServiceGenerator(Options.empty()))).emit(def, folder);
validateGeneratorOutput(files, Paths.get("src/test/resources/test/api"), ".dialogue");
}
Aggregations