Search in sources :

Example 1 with PlatformHttpComponent

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);
}
Also used : PlatformHttpComponent(org.apache.camel.component.platform.http.PlatformHttpComponent) RuntimeValue(io.quarkus.runtime.RuntimeValue)

Example 2 with PlatformHttpComponent

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());
}
Also used : Response(io.restassured.response.Response) RequestSpecification(io.restassured.specification.RequestSpecification) PlatformHttpComponent(org.apache.camel.component.platform.http.PlatformHttpComponent) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) CamelSpringBootTest(org.apache.camel.test.spring.junit5.CamelSpringBootTest)

Aggregations

PlatformHttpComponent (org.apache.camel.component.platform.http.PlatformHttpComponent)2 RuntimeValue (io.quarkus.runtime.RuntimeValue)1 Response (io.restassured.response.Response)1 RequestSpecification (io.restassured.specification.RequestSpecification)1 CamelSpringBootTest (org.apache.camel.test.spring.junit5.CamelSpringBootTest)1 Test (org.junit.jupiter.api.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1