jinmeiliao commented on code in PR #7556:
URL: https://github.com/apache/geode/pull/7556#discussion_r845456095


##########
geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/MessageDispatcherTest.java:
##########
@@ -173,6 +174,32 @@ public void 
oldClientWillNotGetClientReAuthenticateMessage() throws Exception {
     verify(dispatcher, never()).dispatchResidualMessages();
   }
 
+
+  @Test
+  public void oldClientWillContinueToDeliverMessageIfNotified() throws 
Exception {
+    doReturn(false, false, true).when(dispatcher).isStopped();
+    // make sure wait time is short
+    
doReturn(10000L).when(dispatcher).getSystemProperty(eq(RE_AUTHENTICATE_WAIT_TIME),
 anyLong());
+    
doThrow(AuthenticationExpiredException.class).when(dispatcher).dispatchMessage(any());
+    when(messageQueue.peek()).thenReturn(message);
+    when(proxy.getVersion()).thenReturn(KnownVersion.GEODE_1_14_0);
+
+    Thread dispatcherThread = new Thread(() -> dispatcher.runDispatcher());
+    Thread notifyThread = new Thread(() -> 
dispatcher.notifyReAuthentication());
+
+    dispatcherThread.start();
+    await().until(() -> dispatcher.isWaitingForReAuthentication());
+    notifyThread.start();
+
+    dispatcherThread.join();
+    notifyThread.join();

Review Comment:
   Yeah, if it's junit4, I would use that. Not sure how to use that in Junit5.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to