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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit da860b57d58451b7098a9a23d9e4fda69061e426
Author: Benoit Tellier <btell...@linagora.com>
AuthorDate: Fri Mar 6 21:34:44 2020 +0700

    JAMES-3103 Add a test showing message are dispatched to registered keys 
qfter outage
---
 .../james/mailbox/events/RabbitMQEventBusTest.java   | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git 
a/mailbox/event/event-rabbitmq/src/test/java/org/apache/james/mailbox/events/RabbitMQEventBusTest.java
 
b/mailbox/event/event-rabbitmq/src/test/java/org/apache/james/mailbox/events/RabbitMQEventBusTest.java
index f47a63b..0425320 100644
--- 
a/mailbox/event/event-rabbitmq/src/test/java/org/apache/james/mailbox/events/RabbitMQEventBusTest.java
+++ 
b/mailbox/event/event-rabbitmq/src/test/java/org/apache/james/mailbox/events/RabbitMQEventBusTest.java
@@ -76,6 +76,8 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 import org.mockito.stubbing.Answer;
 
+import com.google.common.collect.ImmutableSet;
+
 import reactor.core.publisher.Mono;
 import reactor.rabbitmq.BindingSpecification;
 import reactor.rabbitmq.ExchangeSpecification;
@@ -353,6 +355,24 @@ class RabbitMQEventBusTest implements 
GroupContract.SingleEventBusGroupContract,
                     rabbitMQEventBusWithNetWorkIssue.dispatch(EVENT, 
NO_KEYS).block();
                     assertThatListenerReceiveOneEvent(listener);
                 }
+
+                @Test
+                void 
dispatchShouldWorkAfterNetworkIssuesForOldRegistrationAndKey() {
+                    rabbitMQEventBusWithNetWorkIssue.start();
+                    MailboxListener listener = newListener();
+                    rabbitMQEventBusWithNetWorkIssue.register(listener, KEY_1);
+
+                    rabbitMQNetWorkIssueExtension.getRabbitMQ().pause();
+
+                    assertThatThrownBy(() -> 
rabbitMQEventBusWithNetWorkIssue.dispatch(EVENT, NO_KEYS).block())
+                        .isInstanceOf(IllegalStateException.class)
+                        .hasMessageContaining("Retries exhausted");
+
+                    rabbitMQNetWorkIssueExtension.getRabbitMQ().unpause();
+
+                    rabbitMQEventBusWithNetWorkIssue.dispatch(EVENT, 
ImmutableSet.of(KEY_1)).block();
+                    assertThatListenerReceiveOneEvent(listener);
+                }
             }
 
             @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to