Search in sources :

Example 11 with ConsumerTemplate

use of org.apache.camel.ConsumerTemplate in project camel by apache.

the class ConsumerTemplateHasTwoTemplatesTest method testHasTwoTemplates.

@Test
public void testHasTwoTemplates() {
    ConsumerTemplate lookup = context.getRegistry().lookupByNameAndType("myTemplate", ConsumerTemplate.class);
    assertNotNull("Should lookup producer template", lookup);
    ConsumerTemplate lookup2 = context.getRegistry().lookupByNameAndType("myOtherTemplate", ConsumerTemplate.class);
    assertNotNull("Should lookup producer template", lookup2);
    assertNotSame("Should not be same", lookup, lookup2);
}
Also used : ConsumerTemplate(org.apache.camel.ConsumerTemplate) Test(org.junit.Test)

Example 12 with ConsumerTemplate

use of org.apache.camel.ConsumerTemplate in project camel by apache.

the class ProducerTemplateAutoRegisterTwoCamelContextsTest method testHasNoConsumerTemplateCamel1.

@Test
public void testHasNoConsumerTemplateCamel1() {
    ConsumerTemplate lookup = context1.getRegistry().lookupByNameAndType("consumerTemplate", ConsumerTemplate.class);
    assertNull("Should NOT lookup consumer template", lookup);
}
Also used : ConsumerTemplate(org.apache.camel.ConsumerTemplate) Test(org.junit.Test)

Example 13 with ConsumerTemplate

use of org.apache.camel.ConsumerTemplate in project camel by apache.

the class ProducerTemplateAutoRegisterTwoCamelContextsTest method testHasNoConsumerTemplateCamel2.

@Test
public void testHasNoConsumerTemplateCamel2() {
    ConsumerTemplate lookup = context2.getRegistry().lookupByNameAndType("consumerTemplate", ConsumerTemplate.class);
    assertNull("Should NOT lookup consumer template", lookup);
}
Also used : ConsumerTemplate(org.apache.camel.ConsumerTemplate) Test(org.junit.Test)

Example 14 with ConsumerTemplate

use of org.apache.camel.ConsumerTemplate in project camel by apache.

the class ProducerTemplateMixedAutoRegisterTwoCamelContextsTest method testHasNoConsumerTemplateCamel2.

@Test
public void testHasNoConsumerTemplateCamel2() {
    ConsumerTemplate lookup = context2.getRegistry().lookupByNameAndType("consumerTemplate", ConsumerTemplate.class);
    assertNull("Should NOT lookup consumer template", lookup);
}
Also used : ConsumerTemplate(org.apache.camel.ConsumerTemplate) Test(org.junit.Test)

Example 15 with ConsumerTemplate

use of org.apache.camel.ConsumerTemplate in project camel by apache.

the class CamelSpringBootTemplateShutdownTest method setupApplicationContext.

@Before
public void setupApplicationContext() {
    applicationContext = new AnnotationConfigApplicationContext(CamelAutoConfiguration.class);
    camelContext = applicationContext.getBean(CamelContext.class);
    consumerTemplate = applicationContext.getBean(ConsumerTemplate.class);
    producerTemplate = applicationContext.getBean(ProducerTemplate.class);
}
Also used : CamelContext(org.apache.camel.CamelContext) ConsumerTemplate(org.apache.camel.ConsumerTemplate) ProducerTemplate(org.apache.camel.ProducerTemplate) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Before(org.junit.Before)

Aggregations

ConsumerTemplate (org.apache.camel.ConsumerTemplate)17 Test (org.junit.Test)11 Endpoint (org.apache.camel.Endpoint)4 ProducerTemplate (org.apache.camel.ProducerTemplate)3 Exchange (org.apache.camel.Exchange)2 CamelContext (org.apache.camel.CamelContext)1 CamelExchangeException (org.apache.camel.CamelExchangeException)1 Processor (org.apache.camel.Processor)1 RouteBuilder (org.apache.camel.builder.RouteBuilder)1 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)1 DefaultConsumerTemplate (org.apache.camel.impl.DefaultConsumerTemplate)1 Before (org.junit.Before)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1 Bean (org.springframework.context.annotation.Bean)1