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");
}
Aggregations