diff --git a/driver/src/test/java/org/neo4j/driver/internal/async/inbound/InboundMessageDispatcherTest.java b/driver/src/test/java/org/neo4j/driver/internal/async/inbound/InboundMessageDispatcherTest.java
index <HASH>..<HASH> 100644
--- a/driver/src/test/java/org/neo4j/driver/internal/async/inbound/InboundMessageDispatcherTest.java
+++ b/driver/src/test/java/org/neo4j/driver/internal/async/inbound/InboundMessageDispatcherTest.java
@@ -67,7 +67,7 @@ class InboundMessageDispatcherTest
     @Test
     void shouldFailWhenCreatedWithNullLogging()
     {
-        assertThrows( NullPointerException.class, () -> new InboundMessageDispatcher( mock( Channel.class ), null ) );
+        assertThrows( NullPointerException.class, () -> new InboundMessageDispatcher( newChannelMock(), null ) );
     }
 
     @Test
@@ -109,7 +109,7 @@ class InboundMessageDispatcherTest
     @Test
     void shouldSendResetOnFailure()
     {
-        Channel channel = mock( Channel.class );
+        Channel channel = newChannelMock();
         InboundMessageDispatcher dispatcher = newDispatcher( channel );
 
         dispatcher.enqueue( mock( ResponseHandler.class ) );
Fix mocking in a unit test