com.google.common.collect.testing.Helpers Java Examples

The following examples show how to use com.google.common.collect.testing.Helpers. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KotlinSpringServerCodegenTest.java    From openapi-generator with Apache License 2.0 6 votes vote down vote up
@Test(description = "test delegate with tags")
public void delegateWithTags() throws Exception {
    File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); //may be move to /build
    KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
    codegen.setOutputDir(output.getAbsolutePath());
    codegen.additionalProperties().put(KotlinSpringServerCodegen.DELEGATE_PATTERN, true);
    codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_TAGS, true);

    List<File> files = new DefaultGenerator()
        .opts(
            new ClientOptInput()
                .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue5497-use-tags-kotlin.yaml"))
                .config(codegen)
        )
        .generate();

    Helpers.assertContainsAllOf(files,
        new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"),
        new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"),
        new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiController.kt"),
        new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt")
    );
}
 
Example #2
Source File: MapTestFactory.java    From caffeine with Apache License 2.0 5 votes vote down vote up
@Override
public SampleElements<Map.Entry<String, CompletableFuture<String>>> samples() {
  return new SampleElements<>(
      Helpers.mapEntry("one", JAN),
      Helpers.mapEntry("two", FEB),
      Helpers.mapEntry("three", MARCH),
      Helpers.mapEntry("four", APRIL),
      Helpers.mapEntry("five", MAY));
}