divijvaidya commented on code in PR #12777:
URL: https://github.com/apache/kafka/pull/12777#discussion_r1006648492


##########
streams/src/test/java/org/apache/kafka/streams/state/internals/TimeOrderedWindowStoreTest.java:
##########
@@ -1166,58 +1164,43 @@ public void 
shouldNotThrowInvalidBackwardRangeExceptionWithNegativeFromKey() {
     @Test
     public void shouldCloseCacheAndWrappedStoreAfterErrorDuringCacheFlush() {
         setUpCloseTests();
-        EasyMock.reset(cache);
-        cache.flush(CACHE_NAMESPACE);
-        EasyMock.expectLastCall().andThrow(new RuntimeException("Simulating an 
error on flush"));
-        cache.close(CACHE_NAMESPACE);
-        EasyMock.replay(cache);
-        EasyMock.reset(underlyingStore);
-        underlyingStore.close();
-        EasyMock.replay(underlyingStore);
+        doThrow(new RuntimeException(
+                "Simulating an error on flush"))
+                .when(cache).flush(CACHE_NAMESPACE);
+        reset(underlyingStore);
 
         assertThrows(RuntimeException.class, cachingStore::close);
-        EasyMock.verify(cache, underlyingStore);
+        verifyAndTearDownCloseTests();
     }
 
     @Test
     public void shouldCloseWrappedStoreAfterErrorDuringCacheClose() {
         setUpCloseTests();
-        EasyMock.reset(cache);
-        cache.flush(CACHE_NAMESPACE);
-        cache.close(CACHE_NAMESPACE);
-        EasyMock.expectLastCall().andThrow(new RuntimeException("Simulating an 
error on close"));
-        EasyMock.replay(cache);
-        EasyMock.reset(underlyingStore);
-        underlyingStore.close();
-        EasyMock.replay(underlyingStore);
+        doThrow(new RuntimeException("Simulating an error on close"))
+                .when(cache).close(CACHE_NAMESPACE);
 
+        reset(underlyingStore);

Review Comment:
   do we need this?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to