Skip to content

Commit 5a97bc1

Browse files
committed
Fix test after TrafficListener introduction
References #411 (cherry picked from commit a45019c)
1 parent f613c67 commit 5a97bc1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/main/java/com/rabbitmq/client/impl/AMQConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ public boolean willCheckRpcResponseType() {
11281128
return channelShouldCheckRpcResponseType;
11291129
}
11301130

1131-
TrafficListener getTrafficListener() {
1131+
public TrafficListener getTrafficListener() {
11321132
return trafficListener;
11331133
}
11341134
}

src/test/java/com/rabbitmq/client/test/AMQChannelTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.rabbitmq.client.ChannelContinuationTimeoutException;
1919
import com.rabbitmq.client.Command;
2020
import com.rabbitmq.client.Method;
21+
import com.rabbitmq.client.TrafficListener;
2122
import com.rabbitmq.client.impl.AMQChannel;
2223
import com.rabbitmq.client.impl.AMQCommand;
2324
import com.rabbitmq.client.impl.AMQConnection;
@@ -52,6 +53,7 @@ public class AMQChannelTest {
5253
int rpcTimeout = 100;
5354
AMQConnection connection = mock(AMQConnection.class);
5455
when(connection.getChannelRpcTimeout()).thenReturn(rpcTimeout);
56+
when(connection.getTrafficListener()).thenReturn(TrafficListener.NO_OP);
5557

5658
DummyAmqChannel channel = new DummyAmqChannel(connection, 1);
5759
Method method = new AMQImpl.Queue.Declare.Builder()
@@ -78,6 +80,7 @@ public class AMQChannelTest {
7880
int rpcTimeout = 1000;
7981
AMQConnection connection = mock(AMQConnection.class);
8082
when(connection.getChannelRpcTimeout()).thenReturn(rpcTimeout);
83+
when(connection.getTrafficListener()).thenReturn(TrafficListener.NO_OP);
8184

8285
final DummyAmqChannel channel = new DummyAmqChannel(connection, 1);
8386
Method method = new AMQImpl.Queue.Declare.Builder()
@@ -111,6 +114,7 @@ public void testRpcTimeoutReplyComesDuringNexRpc() throws Exception {
111114
AMQConnection connection = mock(AMQConnection.class);
112115
when(connection.getChannelRpcTimeout()).thenReturn(rpcTimeout);
113116
when(connection.willCheckRpcResponseType()).thenReturn(Boolean.TRUE);
117+
when(connection.getTrafficListener()).thenReturn(TrafficListener.NO_OP);
114118

115119
final DummyAmqChannel channel = new DummyAmqChannel(connection, 1);
116120
Method method = new AMQImpl.Queue.Declare.Builder()

0 commit comments

Comments
 (0)