This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch exchange-factory
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/exchange-factory by this push:
     new 7a0f58b  CAMEL-16222: PooledExchangeFactory experiment
7a0f58b is described below

commit 7a0f58b64b317c809a8a8e131be59e631a95d15d
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon Feb 22 19:22:32 2021 +0100

    CAMEL-16222: PooledExchangeFactory experiment
---
 .../java/org/apache/camel/component/irc/IrcConsumerTest.java | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git 
a/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcConsumerTest.java
 
b/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcConsumerTest.java
index cfcb1da..13851b7 100644
--- 
a/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcConsumerTest.java
+++ 
b/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcConsumerTest.java
@@ -19,18 +19,23 @@ package org.apache.camel.component.irc;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.Processor;
+import org.apache.camel.spi.ExchangeFactory;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.schwering.irc.lib.IRCConnection;
 import org.schwering.irc.lib.IRCEventAdapter;
 
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 public class IrcConsumerTest {
 
+    private ExtendedCamelContext context;
+    private ExchangeFactory exchangeFactory;
     private IRCConnection connection;
     private Processor processor;
     private IrcEndpoint endpoint;
@@ -45,6 +50,8 @@ public class IrcConsumerTest {
         processor = mock(Processor.class);
         configuration = mock(IrcConfiguration.class);
         listener = mock(IRCEventAdapter.class);
+        context = mock(ExtendedCamelContext.class);
+        exchangeFactory = mock(ExchangeFactory.class);
 
         List<IrcChannel> channels = new ArrayList<>();
         channels.add(new IrcChannel("#chan1", null));
@@ -53,6 +60,11 @@ public class IrcConsumerTest {
         when(configuration.getChannelList()).thenReturn(channels);
         when(endpoint.getConfiguration()).thenReturn(configuration);
 
+        when(endpoint.getCamelContext()).thenReturn(context);
+        when(context.adapt(ExtendedCamelContext.class)).thenReturn(context);
+        when(context.getExchangeFactory()).thenReturn(exchangeFactory);
+        
when(exchangeFactory.newExchangeFactory(any())).thenReturn(exchangeFactory);
+
         consumer = new IrcConsumer(endpoint, processor, connection);
         consumer.setListener(listener);
     }

Reply via email to