Search in sources :

Example 1 with GetVerbDefinition

use of org.apache.camel.model.rest.GetVerbDefinition in project camel by apache.

the class XmlRestParseTest method testParseSimpleRestXml.

public void testParseSimpleRestXml() throws Exception {
    RestDefinition rest = assertOneRest("simpleRest.xml");
    assertEquals("/users", rest.getPath());
    assertEquals(1, rest.getVerbs().size());
    GetVerbDefinition get = (GetVerbDefinition) rest.getVerbs().get(0);
    assertEquals("/view/{id}", get.getUri());
    assertEquals("direct:getUser", get.getTo().getUri());
}
Also used : RestDefinition(org.apache.camel.model.rest.RestDefinition) GetVerbDefinition(org.apache.camel.model.rest.GetVerbDefinition)

Example 2 with GetVerbDefinition

use of org.apache.camel.model.rest.GetVerbDefinition in project camel by apache.

the class XmlRestParseToDTest method testParseSimpleRestXml.

public void testParseSimpleRestXml() throws Exception {
    RestDefinition rest = assertOneRest("simpleRestToD.xml");
    assertEquals("/users", rest.getPath());
    assertEquals(1, rest.getVerbs().size());
    GetVerbDefinition get = (GetVerbDefinition) rest.getVerbs().get(0);
    assertEquals("/view/{id}", get.getUri());
    assertEquals("bean:getUser?id=${header.id}", get.getToD().getUri());
}
Also used : RestDefinition(org.apache.camel.model.rest.RestDefinition) GetVerbDefinition(org.apache.camel.model.rest.GetVerbDefinition)

Aggregations

GetVerbDefinition (org.apache.camel.model.rest.GetVerbDefinition)2 RestDefinition (org.apache.camel.model.rest.RestDefinition)2