Search in sources :

Example 1 with RawDocSpec

use of com.spectralogic.ds3autogen.models.xml.docspec.RawDocSpec in project ds3_autogen by SpectraLogic.

the class DocSpecConverter_Test method toDs3DocSpec_Test.

@Test
public void toDs3DocSpec_Test() throws IOException {
    final NameMapper nameMapper = new NameMapper(TEST_NAME_MAPPER_FILE);
    final RawDocSpec rawDocSpec = new RawDocSpec();
    rawDocSpec.setRequestDescriptors(ImmutableList.of(createAmazonRequestDescriptor(), createSpectraRequestDescriptor()));
    rawDocSpec.setParamDescriptors(ImmutableList.of(createParamDescriptor("1"), createParamDescriptor("2")));
    final Ds3DocSpec result = toDs3DocSpec(rawDocSpec, nameMapper);
    assertThat(result.getRequestDocumentation(AMAZON_NAME_AFTER).get(), is(AMAZON_DESCRIPTOR));
    assertThat(result.getRequestDocumentation(SPECTRA_NAME_AFTER).get(), is(SPECTRA_DESCRIPTOR));
    assertThat(result.getParamDocumentation("Name1").get(), is("Description1"));
    assertThat(result.getParamDocumentation("Name2").get(), is("Description2"));
    assertThat(result.getRequestDocumentation("DoesNotExistRequest").isPresent(), is(false));
    assertThat(result.getParamDocumentation("DoesNotExistParam").isPresent(), is(false));
}
Also used : RawDocSpec(com.spectralogic.ds3autogen.models.xml.docspec.RawDocSpec) Ds3DocSpec(com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec) NameMapper(com.spectralogic.ds3autogen.NameMapper) Test(org.junit.Test)

Aggregations

NameMapper (com.spectralogic.ds3autogen.NameMapper)1 Ds3DocSpec (com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec)1 RawDocSpec (com.spectralogic.ds3autogen.models.xml.docspec.RawDocSpec)1 Test (org.junit.Test)1