use of org.apache.camel.component.platform.http.PlatformHttpComponent in project camel-quarkus by apache.
the class PlatformHttpRecorder method createComponent.
public RuntimeValue<PlatformHttpComponent> createComponent(RuntimeValue<PlatformHttpEngine> engine) {
PlatformHttpComponent component = new PlatformHttpComponent();
component.setEngine(engine.getValue());
return new RuntimeValue<>(component);
}
use of org.apache.camel.component.platform.http.PlatformHttpComponent in project camel-spring-boot by apache.
the class PlatformHttpTest method testPost.
@Test
public void testPost() {
RequestSpecification request = RestAssured.given();
request.port(port);
request.body("test");
Response response = request.get("/post");
int statusCode = response.getStatusCode();
assertEquals(200, statusCode);
assertEquals("TEST", response.body().asString().trim());
PlatformHttpComponent phc = context.getComponent("platform-http", PlatformHttpComponent.class);
assertEquals(2, phc.getHttpEndpoints().size());
Iterator<String> it = phc.getHttpEndpoints().iterator();
assertEquals("/get", it.next());
assertEquals("/post", it.next());
}
Aggregations