Skip to content

Commit 19a5de2

Browse files
committed
add noop channel primer test
Change-Id: I2a11cd44ddd9caaea4db918f66aa7313a31a0057
1 parent 40d8c6c commit 19a5de2

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.cloud.bigtable.data.v2.stub;
17+
18+
import static org.mockito.Mockito.mock;
19+
import static org.mockito.Mockito.verifyNoInteractions;
20+
21+
import io.grpc.ManagedChannel;
22+
import org.junit.Test;
23+
import org.junit.runner.RunWith;
24+
import org.junit.runners.JUnit4;
25+
26+
@RunWith(JUnit4.class)
27+
public class NoOpChannelPrimerTest {
28+
@Test
29+
public void primeChannelDoesNothing() {
30+
// Create an instance of NoOpChannelPrimer
31+
NoOpChannelPrimer primer = NoOpChannelPrimer.create();
32+
33+
// Create a mock ManagedChannel
34+
ManagedChannel mockChannel = mock(ManagedChannel.class);
35+
36+
// Call the primeChannel method
37+
primer.primeChannel(mockChannel);
38+
39+
// Verify that no interactions occurred with the mock channel.
40+
// This confirms the "no-op" behavior.
41+
verifyNoInteractions(mockChannel);
42+
}
43+
}

0 commit comments

Comments
 (0)