bbejeck commented on code in PR #22311:
URL: https://github.com/apache/kafka/pull/22311#discussion_r3313696755


##########
streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingSessionBytesStoreTest.java:
##########
@@ -189,4 +194,20 @@ public void shouldCloseUnderlyingStore() {
 
         verify(inner).close();
     }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void shouldDelegateReadOnlyUncommittedToInner() {
+        final ReadOnlySessionStore<Bytes, byte[]> view = 
mock(ReadOnlySessionStore.class);

Review Comment:
   Maybe create the `mock` in a `beforeEach` method?



##########
streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingWindowBytesStoreTest.java:
##########
@@ -124,6 +129,22 @@ public void 
shouldDelegateToUnderlyingStoreWhenBackwardFetchingRange() {
         }
     }
 
+    @SuppressWarnings("unchecked")
+    @Test
+    public void shouldDelegateReadOnlyUncommittedToInner() {
+        final ReadOnlyWindowStore<Bytes, byte[]> view = 
mock(ReadOnlyWindowStore.class);

Review Comment:
   same



##########
streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingWindowBytesStoreTest.java:
##########
@@ -124,6 +129,22 @@ public void 
shouldDelegateToUnderlyingStoreWhenBackwardFetchingRange() {
         }
     }
 
+    @SuppressWarnings("unchecked")
+    @Test
+    public void shouldDelegateReadOnlyUncommittedToInner() {
+        final ReadOnlyWindowStore<Bytes, byte[]> view = 
mock(ReadOnlyWindowStore.class);
+        when(inner.readOnly(IsolationLevel.READ_UNCOMMITTED)).thenReturn(view);
+        assertThat(store.readOnly(IsolationLevel.READ_UNCOMMITTED), 
sameInstance(view));
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void shouldDelegateReadOnlyCommittedToInner() {
+        final ReadOnlyWindowStore<Bytes, byte[]> view = 
mock(ReadOnlyWindowStore.class);

Review Comment:
   ditto



##########
streams/src/test/java/org/apache/kafka/streams/state/internals/ChangeLoggingSessionBytesStoreTest.java:
##########
@@ -189,4 +194,20 @@ public void shouldCloseUnderlyingStore() {
 
         verify(inner).close();
     }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void shouldDelegateReadOnlyUncommittedToInner() {
+        final ReadOnlySessionStore<Bytes, byte[]> view = 
mock(ReadOnlySessionStore.class);
+        when(inner.readOnly(IsolationLevel.READ_UNCOMMITTED)).thenReturn(view);
+        assertThat(store.readOnly(IsolationLevel.READ_UNCOMMITTED), 
sameInstance(view));
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void shouldDelegateReadOnlyCommittedToInner() {
+        final ReadOnlySessionStore<Bytes, byte[]> view = 
mock(ReadOnlySessionStore.class);

Review Comment:
   same here



-- 
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