use of org.raml.jaxrs.generator.GAbstractionFactory in project raml-for-jax-rs by mulesoft-labs.
the class ResourceHandler method handle.
public void handle(Set<String> globalSchemas, V08TypeRegistry registry, final org.raml.v2.api.model.v08.resources.Resource resource) {
GAbstractionFactory factory = new GAbstractionFactory();
ResourceBuilder rg = new ResourceBuilder(build, factory.newResource(globalSchemas, registry, resource), resource.displayName(), resource.relativeUri().value());
build.newResource(rg);
}
use of org.raml.jaxrs.generator.GAbstractionFactory in project raml-for-jax-rs by mulesoft-labs.
the class V10GResourceTest method simpleResponse.
@Test
public void simpleResponse() throws Exception {
Api api = RamlV10.buildApiV10(this, "resource-response-simple.raml");
GAbstractionFactory fac = new GAbstractionFactory();
V10GResource gr = new V10GResource(new CurrentBuild(api, null), fac, api.resources().get(0));
GResponseType resp = gr.methods().get(0).responses().get(0).body().get(0);
assertEquals("application/json", resp.mediaType());
assertEquals("ObjectBase", resp.type().type());
assertEquals("ObjectBase", resp.type().name());
}
use of org.raml.jaxrs.generator.GAbstractionFactory in project raml-for-jax-rs by mulesoft-labs.
the class V10GResourceTest method extendingResponse.
@Test
public void extendingResponse() throws Exception {
Api api = RamlV10.buildApiV10(this, "resource-response-extending.raml");
GAbstractionFactory fac = new GAbstractionFactory();
V10GResource gr = new V10GResource(new CurrentBuild(api, null), fac, api.resources().get(0));
GResponseType req = gr.methods().get(0).responses().get(0).body().get(0);
assertEquals("application/json", req.mediaType());
assertEquals("ObjectBase", req.type().type());
assertEquals("FunPut200ApplicationJson", req.type().name());
assertEquals("model.FunPut200ApplicationJson", req.type().defaultJavaTypeName("").toString());
}
Aggregations