Questions tagged [camel-test]
35 questions
1
vote
1 answer
Camel testing - java.lang.IllegalArgumentException: defaultEndpoint must be specified
I am trying to create testcases for my camel route using http://camel.apache.org/mock.html . I need to verify the the processors in the route. But the simple test is not working for me.
public class CamelRouteTest extends CamelTestSupport {
…

Gangaraju
- 4,406
- 9
- 45
- 77
1
vote
1 answer
Camel : Mock and return value from component in route
I have the following route in my service:
public void configure() {
/*
* Scheduled Camel route to produce a monthly report from the audit table.
* This is scheduled to run the first day of every month.
*/
// @formatter:off
…

jbailie1991
- 1,305
- 2
- 21
- 42
0
votes
0 answers
How do I test that a node was executed in a Camel route?
I have a Camel route defined as follows:
@Component
public class MyRoute extends RouteBuilder {
@Override
public void configure() {
onException(BeanValidationException.class)
.setBody(simple("${exception}"))
…

James
- 2,876
- 18
- 72
- 116
0
votes
0 answers
how to add add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" in CamelTestSupport
I am creating a test that extends of CamelTestSupport. I am using Apache Camel 3.10. I have tried to set JavaTimeModule() in the test inside the createRouteBuilder, with
public ObjectMapper produceObjectMapper() {
ObjectMapper objectMapper =…

kahonmlg
- 3,839
- 3
- 17
- 21
0
votes
1 answer
Camel Testing: get Expected String of Header with parameters
I have a route
from("sql:classpath:sql/selectAccounts.sql?outputClass=Account&delay={{EXEC_INTVAL_MS:60000}}&useIterator=false")
.routeId(ROUTE_MIGRATE_ACCOUNTS)
.to("log:accounts?showAll=true&level=DEBUG")
…
0
votes
1 answer
How to mock a response to some expected object using CamelTestSupport?
There's a DTO created on a builder method (assume it has only a "name" attribute with some random value) and I want to check if the returned object has the same value, but the response is null.
Unit test code:
class GetProductByIdRouteBuilderTest…

Rasshu
- 1,764
- 6
- 22
- 53
0
votes
1 answer
Why is my Camel JUnit test case producer template not able to send a body?
I am trying to test a route which is like this:
from("s3://bucketName")
.process(exchange -> {exchange.getIn().setHeader(Exchange.FILE_NAME,MY_FILE_NAME);})
.log("File download Successful")
.to("file:" + FILE_PATH).routeId("mys3Route");
I have…

The Dark Knight
- 5,455
- 11
- 54
- 95
0
votes
2 answers
org.apache.camel.FailedToCreateConsumerException: Failed to create Consumer for endpoint: direct://validateFile
I'm getting Failed to create consumer endpoint issue, while asserting against the headers. Can someone help me on this ?
I have this file watcher route which consumes files and validate the file. If its valid file will update the headers and send it…

TechGeek
- 480
- 1
- 8
- 22
0
votes
2 answers
Mock the body of an intermediate route executed in Camel Tests
Available examples of the usage of the Camel Test component show how to test the expectations of a route:
However what I need to do is mock the body (manually setting it) of an intermediate route, e.g.:

codependent
- 23,193
- 31
- 166
- 308
0
votes
2 answers
No camel consumer available for routes of type direct-vm when testing
I'm working with unit tests using Camel and, When I execute this test from Camel In Action repository it works perfectly but when I change the route type from SEDA to direct-vm it fails with the following message:
Caused by:…

Joselo
- 127
- 1
- 10
0
votes
1 answer
Apache Camel test and assert the JSON body field value with JSON Path Expression
I'm trying to check the field value of the body which is a JSON string with JsonPathExpression.
In the example below, the JsonPathExpression checks whether or not the root JSON object has the field named as "type". What I want to achieve is, to…

Levent Divilioglu
- 11,198
- 5
- 59
- 106
0
votes
1 answer
Apache Camel | Spring Testing | Intercept Route is not working
I am new to apache camel so I am still struggling to write camel test cases.
I have below route defined
from("direct:routeToTest")
.id(ROUTE_ID)
.to(LOOK_UP_ROUTE)
.choice()
.when(some-condition)
…

Himanshu Arora
- 688
- 1
- 9
- 20
0
votes
1 answer
Apache camel with spring DSL and Junit Coverage
I am completely new to apache camel.
I got some basic understanding about it.
Now I am going through some videos and documents to get some ideas for implementing junit test cases for apache camel spring DSL based spring boot application but it's not…

Ravikumar
- 413
- 1
- 7
- 18
0
votes
1 answer
Testing camel 2.24.x routes in Karaf 4.2.7 with CamelTestSupport
I want to test Camel 2.24.x routes in Karaf 4.2.x. I use Pax-Exam 4.13.1 to run Karaf. The Camel Testing Manual does not cover Karaf testing. For older Karaf and Camel versions there are blog articles which demonstrate how to do that by extending a…

dschulten
- 2,994
- 1
- 27
- 44
0
votes
1 answer
Mocking OSGi reference in CamelBlueprintTest does not work
I'm currently setting up tests with CamelBlueprintTestSupport.
In my blueprint.xml, I tried the following implementation:
Mocking FooInterface in my test class with
protected void…

ian_eve
- 97
- 2
- 8