Skip to content

Commit

Permalink
Merge pull request #134 from ppalaga/i133
Browse files Browse the repository at this point in the history
Fix #133 Test netty4-http as a producer
  • Loading branch information
oscerd committed Oct 6, 2019
2 parents 092d855 + 3821fca commit 8100e8c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Expand Up @@ -19,10 +19,15 @@
import org.apache.camel.builder.RouteBuilder;

public class CamelRoute extends RouteBuilder {

@Override
public void configure() {
from("netty-http:http://0.0.0.0:8999/foo")
.transform().constant("Netty Hello World");

/* /producer proxying /foo */
from("netty-http:http://0.0.0.0:8999/producer")
.to("netty-http:http://localhost:8999/foo");

}
}
Expand Up @@ -16,18 +16,27 @@
*/
package org.apache.camel.quarkus.component.netty.http;

import static org.hamcrest.Matchers.is;

import java.net.URI;

import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.junit.jupiter.api.Test;

import static org.hamcrest.Matchers.is;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;

@QuarkusTest
public class CamelTest {

@Test
public void testNetty4Http() throws Exception {
RestAssured.when().get(new URI("http://localhost:8999/foo")).then().body(is("Netty Hello World"));
}

@Test
public void netty4HttpProducer() throws Exception {
RestAssured.when().get(new URI("http://localhost:8999/producer")) //
.then().statusCode(200).body(is("Netty Hello World"));
}

}

0 comments on commit 8100e8c

Please sign in to comment.