use of com.palantir.conjure.java.services.dialogue.DialogueServiceGenerator 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.java.services.dialogue.DialogueServiceGenerator 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");
}
use of com.palantir.conjure.java.services.dialogue.DialogueServiceGenerator in project conjure-java by palantir.
the class DialogueServiceGeneratorTests method generateEteServices.
@Test
public void generateEteServices() throws IOException {
ConjureDefinition def = Conjure.parse(ImmutableList.of(new File("src/test/resources/cookie-service.yml"), new File("src/test/resources/ete-service.yml"), new File("src/test/resources/ete-binary.yml")));
List<Path> files = new GenerationCoordinator(MoreExecutors.directExecutor(), ImmutableSet.of(new DialogueServiceGenerator(Options.builder().apiVersion("1.2.3").build()))).emit(def, folder);
validateGeneratorOutput(files, Paths.get("src/integrationInput/java/com/palantir/product"));
}
use of com.palantir.conjure.java.services.dialogue.DialogueServiceGenerator in project conjure-java by palantir.
the class DialogueServiceGeneratorTests method testConjureImports.
@Test
public void testConjureImports() throws IOException {
ConjureDefinition conjure = Conjure.parse(ImmutableList.of(new File("src/test/resources/example-conjure-imports.yml"), new File("src/test/resources/example-types.yml"), new File("src/test/resources/example-service.yml")));
File src = Files.createDirectory(folder.toPath().resolve("src")).toFile();
new GenerationCoordinator(MoreExecutors.directExecutor(), ImmutableSet.of(new DialogueServiceGenerator(Options.empty()))).emit(conjure, src);
// Generated files contain imports
assertThat(compiledFileContent(src, "test/api/with/imports/ImportServiceBlocking.java")).contains("import com.palantir.product.StringExample;");
}
Aggregations