Hi ,
I'm faced to a strange problem. The following code does not execute my test
method (testMarshallMessage) but only (i presume because this is a value by
default) testMocksAreValid :
package org.apache.camel.bindy.csv;
import org.apache.camel.EndpointInject;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.config.java.annotation.Bean;
import org.springframework.config.java.annotation.Configuration;
import org.springframework.config.java.test.JavaConfigContextLoader;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@ContextConfiguration(locations =
"org.apache.camel.spring.javaconfig.patterns.FilterTest$ContextConfig",
loader = JavaConfigContextLoader.class)
public class BindyCSVUnmarshallTest extends AbstractJUnit4SpringContextTests
{
private static final transient Log LOG = LogFactory
.getLog(BindyCSVUnmarshallTest.class);
String record = "01,A,Albert,Cartier,BE12345678,Belgacom Ventage
10/10,1500,EUR,08-01-2009";
@EndpointInject(uri = "mock:result")
protected MockEndpoint resultEndpoint;
@Produce(uri = "direct:start")
protected ProducerTemplate template;
@DirtiesContext
public void testMarshallMessage() throws Exception {
template.sendBody(record);
resultEndpoint.expectedBodiesReceived(record);
}
@Configuration
public static class ContextConfig extends SingleRouteCamelConfiguration
{
CamelDataFormat camelDataFormat = new
CamelDataFormat("org.apache.camel.bindy.model");
@Bean
public RouteBuilder route() {
return new RouteBuilder() {
public void configure() {
from("direct:start")
//from("file://src/test/data/")
.unmarshal(camelDataFormat)
.to("mock:result");
}
};
}
}
}
question : Why testMarshallMessage is not executed ?
-----
Charles Moulliard
SOA Architect
My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
--
View this message in context:
http://www.nabble.com/only-testMocksAreValid-is-executed-by-Camel-Spring-unit-test-%21%21-tp21436628s22882p21436628.html
Sent from the Camel - Users mailing list archive at Nabble.com.