You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by meenakshisekar <me...@imaginea.com> on 2015/02/26 08:15:51 UTC
JUnit json
Hi,
I'm starting with camel on Junit for my sample code. Would like to
understand how to implement it for Json based case.
My class looks like this,
@Override
public void configure() throws Exception {
from("jetty:http://0.0.0.0:8080/content")
.choice()
.when(header("service").isEqualTo("XXXXX"))
.to("http://localhost:4567/test.json?bridgeEndpoint=true&throwExceptionOnFailure=false")
.otherwise()
.to("http://localhost:5000/order?bridgeEndpoint=true&throwExceptionOnFailure=false");
}
the structure of my Junit class looks like this, let me know on what has to
be tested in test(testSendMatchingMessage)
method.
public class GLEndpointTest extends CamelTestSupport{
@EndpointInject(uri = "mock:result")
protected MockEndpoint resultEndpoint;
@Produce(uri = "direct:start")
protected ProducerTemplate template;
@Before
public void setup() throws Exception {
super.setUp();
context.addRoutes(new ContentBased());
}
@Override
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
from("http://localhost:8080/content?service=customer").to("mock:result");
}
};
}
* @Test
public void testSendMatchingMessage() throws Exception {
???????
}*
}
--
View this message in context: http://camel.465427.n5.nabble.com/JUnit-json-tp5763189.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: JUnit json
Posted by Christian Müller <ch...@gmail.com>.
Please use the users mailing list for such questions.
Best,
Christian
-----------------
Software Integration Specialist
Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member
https://www.linkedin.com/pub/christian-mueller/11/551/642
On Thu, Feb 26, 2015 at 8:15 AM, meenakshisekar <
meenakshi.chandrasekar@imaginea.com> wrote:
> Hi,
>
> I'm starting with camel on Junit for my sample code. Would like to
> understand how to implement it for Json based case.
>
> My class looks like this,
>
> @Override
> public void configure() throws Exception {
> from("jetty:http://0.0.0.0:8080/content")
> .choice()
> .when(header("service").isEqualTo("XXXXX"))
>
> .to("
> http://localhost:4567/test.json?bridgeEndpoint=true&throwExceptionOnFailure=false
> ")
> .otherwise()
>
> .to("
> http://localhost:5000/order?bridgeEndpoint=true&throwExceptionOnFailure=false
> ");
>
> }
>
> the structure of my Junit class looks like this, let me know on what has to
> be tested in test(testSendMatchingMessage)
>
> method.
>
> public class GLEndpointTest extends CamelTestSupport{
>
>
> @EndpointInject(uri = "mock:result")
> protected MockEndpoint resultEndpoint;
>
> @Produce(uri = "direct:start")
> protected ProducerTemplate template;
>
> @Before
> public void setup() throws Exception {
> super.setUp();
> context.addRoutes(new ContentBased());
> }
>
>
> @Override
> protected RouteBuilder createRouteBuilder() {
> return new RouteBuilder() {
> public void configure() {
>
> from("http://localhost:8080/content?service=customer").to("mock:result");
>
> }
> };
> }
>
>
> * @Test
> public void testSendMatchingMessage() throws Exception {
> ???????
> }*
>
> }
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/JUnit-json-tp5763189.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>