Search in sources :

Example 1 with TrialResourceMethodExtension

use of org.raml.jaxrs.generator.builders.extensions.resources.TrialResourceMethodExtension in project raml-for-jax-rs by mulesoft-labs.

the class AnnotationsTest method getExtensionClass.

@Test
public void getExtensionClass() throws Exception {
    Api type = buildApi(this, "annotations.raml");
    when(currentBuild.createExtensions("org.raml.jaxrs.generator.builders.extensions.resources.TrialResourceClassExtension")).thenReturn(Collections.<Object>singletonList(new TrialResourceClassExtension()));
    when(currentBuild.createExtensions("org.raml.jaxrs.generator.builders.extensions.resources.TrialResourceMethodExtension")).thenReturn(Collections.<Object>singletonList(new TrialResourceMethodExtension()));
    when(currentBuild.createExtensions("org.raml.jaxrs.generator.builders.extensions.resources.TrialResponseClassExtension")).thenReturn(Collections.<Object>singletonList(new TrialResponseClassExtension()));
    when(currentBuild.createExtensions("org.raml.jaxrs.generator.builders.extensions.resources.TrialResponseMethodExtension")).thenReturn(Collections.<Object>singletonList(new TrialResponseMethodExtension()));
/*
     * assertTrue(((AbstractCompositeExtension) Annotations.ON_RESOURCE_CLASS_CREATION.getWithContext(currentBuild,
     * type.resources() .get(0))).getElements().get(0) instanceof TrialResourceClassExtension);
     * assertTrue(((AbstractCompositeExtension) Annotations.ON_METHOD_CREATION.getWithContext(currentBuild,
     * type.resources().get(0) .methods().get(0))).getElements().get(0) instanceof TrialResourceMethodExtension);
     * assertTrue(((AbstractCompositeExtension) Annotations.ON_RESPONSE_CLASS_CREATION.getWithContext(currentBuild,
     * type.resources() .get(0).methods().get(0))).getElements().get(0) instanceof TrialResponseClassExtension);
     * assertTrue(((AbstractCompositeExtension) Annotations.ON_RESPONSE_METHOD_CREATION.getWithContext(currentBuild,
     * type.resources().get(0) .methods() .get(0) .responses().get(0)))
     * 
     * .getElements().get(0) instanceof TrialResponseMethodExtension);
     */
}
Also used : TrialResourceClassExtension(org.raml.jaxrs.generator.builders.extensions.resources.TrialResourceClassExtension) TrialResponseMethodExtension(org.raml.jaxrs.generator.builders.extensions.resources.TrialResponseMethodExtension) Api(org.raml.v2.api.model.v10.api.Api) TrialResponseClassExtension(org.raml.jaxrs.generator.builders.extensions.resources.TrialResponseClassExtension) TrialResourceMethodExtension(org.raml.jaxrs.generator.builders.extensions.resources.TrialResourceMethodExtension) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 TrialResourceClassExtension (org.raml.jaxrs.generator.builders.extensions.resources.TrialResourceClassExtension)1 TrialResourceMethodExtension (org.raml.jaxrs.generator.builders.extensions.resources.TrialResourceMethodExtension)1 TrialResponseClassExtension (org.raml.jaxrs.generator.builders.extensions.resources.TrialResponseClassExtension)1 TrialResponseMethodExtension (org.raml.jaxrs.generator.builders.extensions.resources.TrialResponseMethodExtension)1 Api (org.raml.v2.api.model.v10.api.Api)1