use of org.raml.jaxrs.generator.ramltypes.GRequest in project raml-for-jax-rs by mulesoft-labs.
the class V10GResourceTest method simpleRequest.
@Test
public void simpleRequest() throws Exception {
Api api = RamlV10.buildApiV10(this, "resource-simple.raml");
GAbstractionFactory fac = new GAbstractionFactory();
V10GResource gr = new V10GResource(new CurrentBuild(api, null), fac, api.resources().get(0));
GRequest req = gr.methods().get(0).body().get(0);
assertEquals("application/json", req.mediaType());
assertEquals("ObjectBase", req.type().type());
assertEquals("ObjectBase", req.type().name());
}
use of org.raml.jaxrs.generator.ramltypes.GRequest in project raml-for-jax-rs by mulesoft-labs.
the class V10GResourceTest method extendingRequest.
@Test
public void extendingRequest() throws Exception {
Api api = RamlV10.buildApiV10(this, "resource-extending-request.raml");
GAbstractionFactory fac = new GAbstractionFactory();
V10GResource gr = new V10GResource(new CurrentBuild(api, null), fac, api.resources().get(0));
GRequest req = gr.methods().get(0).body().get(0);
assertEquals("application/json", req.mediaType());
assertEquals("ObjectBase", req.type().type());
assertEquals("FunPutApplicationJson", req.type().name());
assertEquals("model.FunPutApplicationJson", req.type().defaultJavaTypeName("").toString());
}
Aggregations