Search in sources :

Example 1 with PhpGapicCodePathMapper

use of com.google.api.codegen.php.PhpGapicCodePathMapper in project toolkit by googleapis.

the class PhpGapicCodePathMapperTest method getOutputPathTest.

@Test
public void getOutputPathTest() {
    PhpGapicCodePathMapper pathMapper = PhpGapicCodePathMapper.newBuilder().setPrefix("prefix").setSuffix("suffix").build();
    GapicProductConfig configWithGoogleCloud = GapicProductConfig.createDummyInstance(ImmutableMap.<String, InterfaceConfig>of(), "Google\\Cloud\\Sample\\Package\\V1", "", null);
    Truth.assertThat(pathMapper.getOutputPath(null, configWithGoogleCloud)).isEqualTo("prefix/Sample/Package/V1/suffix");
    GapicProductConfig configWithGoogleNonCloud = GapicProductConfig.createDummyInstance(ImmutableMap.<String, InterfaceConfig>of(), "Google\\NonCloud\\Sample\\Package\\V1", "", null);
    Truth.assertThat(pathMapper.getOutputPath(null, configWithGoogleNonCloud)).isEqualTo("prefix/NonCloud/Sample/Package/V1/suffix");
    GapicProductConfig configWithAlphabet = GapicProductConfig.createDummyInstance(ImmutableMap.<String, InterfaceConfig>of(), "Alphabet\\Google\\Cloud\\Sample\\Package\\V1", "", null);
    Truth.assertThat(pathMapper.getOutputPath(null, configWithAlphabet)).isEqualTo("prefix/Alphabet/Google/Cloud/Sample/Package/V1/suffix");
}
Also used : GapicProductConfig(com.google.api.codegen.config.GapicProductConfig) PhpGapicCodePathMapper(com.google.api.codegen.php.PhpGapicCodePathMapper) Test(org.junit.Test)

Aggregations

GapicProductConfig (com.google.api.codegen.config.GapicProductConfig)1 PhpGapicCodePathMapper (com.google.api.codegen.php.PhpGapicCodePathMapper)1 Test (org.junit.Test)1