[
https://issues.apache.org/jira/browse/CAMEL-7963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14272652#comment-14272652
]
Chris Love edited comment on CAMEL-7963 at 1/10/15 7:13 PM:
------------------------------------------------------------
I am having some issues with using @EndpointInject in unit tests. Can you add
an example of this? I working on an example this weekend and I may be able to
get it to you. I am uncertain if I can get a 'working' sample to you :)
Not sure what combination of these I should be using:
{code:title=FooTest.java|borderStyle=solid}
@EnableAutoConfiguration
@SpringApplicationConfiguration(classes = {FooTest.class,Application.class})
@RunWith(CamelSpringJUnit4ClassRunner.class) // this creates a second camel
context
@BootstrapWith(CamelTestContextBootstrapper.class)
@MockEndpoints("activemq:*") // this is not firing
@IntegrationTest
@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
public class CrawlSiteMapTest extends Assert {
// This works
@Autowired
CamelContext camelContext;
// This is not autowiring / injecting properly
@EndpointInject(uri = "activemq:queue-myqueue")
protected MockEndpoint myQueue;
// This is null
@Produce(uri = "direct://myproducer", context="camelContext2")
protected ProducerTemplate template;
///....
}
{code}
was (Author: chrislovecnm):
I am having some issues with using @EndpointInject in unit tests. Can you add
an example of this? I working on an example this weekend and I may be able to
get it to you. I am uncertain if I can get a 'working' sample to you :)
Not sure what combination of these I should be using:
{code:title=FooTest.java|borderStyle=solid}
@EnableAutoConfiguration
@SpringApplicationConfiguration(classes = {FooTest.class,Application.class})
@RunWith(CamelSpringJUnit4ClassRunner.class) // this creates a second camel
context
@BootstrapWith(CamelTestContextBootstrapper.class)
@MockEndpoints("activemq:*") // this is not firing
@IntegrationTest
@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
public class CrawlSiteMapTest extends Assert {
// This works
@Autowired
CamelContext camelContext;
// This is not autowiring / injecting properly
@EndpointInject(uri = "activemq:queue-myqueue")
protected MockEndpoint myQueue;
// This is null
@Produce(uri = "direct://getSiteMap", context="camelContext2")
protected ProducerTemplate template;
///....
}
{code}
> Add Spring Boot support
> -----------------------
>
> Key: CAMEL-7963
> URL: https://issues.apache.org/jira/browse/CAMEL-7963
> Project: Camel
> Issue Type: New Feature
> Reporter: Henryk Konsek
> Assignee: Henryk Konsek
> Fix For: 2.15.0
>
>
> We need Spring Boot autoconfiguration for Camel. I created one under Fabric8
> umbrella (1), but I don't believe that is the proper place to keep and
> develop Camel integration, as this is pure Camel stuff. We can just use Camel
> stuff in the Fabric8 instead.
> I will continue to develop Camel Spring Boot integration under Camel umbrella.
> (1)
> https://github.com/fabric8io/fabric8/tree/master/process/process-spring-boot/process-spring-boot-starter-camel
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)