use of io.grpc.internal.TestUtils.NoopChannelLogger in project grpc-java by grpc.
the class AltsTsiHandshakerTest method setUp.
@Before
public void setUp() throws Exception {
mockClient = mock(AltsHandshakerClient.class);
mockServer = mock(AltsHandshakerClient.class);
NoopChannelLogger channelLogger = new NoopChannelLogger();
handshakerClient = new AltsTsiHandshaker(true, mockClient, channelLogger);
handshakerServer = new AltsTsiHandshaker(false, mockServer, channelLogger);
}
use of io.grpc.internal.TestUtils.NoopChannelLogger in project grpc-java by grpc.
the class AltsTsiTest method setUp.
@Before
public void setUp() throws Exception {
ResourceLeakDetector.setLevel(Level.PARANOID);
// Use MockAltsHandshakerStub for all the tests.
AltsHandshakerOptions handshakerOptions = new AltsHandshakerOptions(null);
MockAltsHandshakerStub clientStub = new MockAltsHandshakerStub();
MockAltsHandshakerStub serverStub = new MockAltsHandshakerStub();
NoopChannelLogger channelLogger = new NoopChannelLogger();
client = new AltsHandshakerClient(clientStub, handshakerOptions, channelLogger);
server = new AltsHandshakerClient(serverStub, handshakerOptions, channelLogger);
}
use of io.grpc.internal.TestUtils.NoopChannelLogger in project grpc-java by grpc.
the class AltsTsiTest method newHandshakers.
private Handshakers newHandshakers() {
NoopChannelLogger channelLogger = new NoopChannelLogger();
TsiHandshaker clientHandshaker = new AltsTsiHandshaker(true, client, channelLogger);
TsiHandshaker serverHandshaker = new AltsTsiHandshaker(false, server, channelLogger);
return new Handshakers(clientHandshaker, serverHandshaker);
}
use of io.grpc.internal.TestUtils.NoopChannelLogger in project grpc-java by grpc.
the class AltsHandshakerClientTest method setRpcVersions.
@Test
public void setRpcVersions() throws Exception {
when(mockStub.send(ArgumentMatchers.<HandshakerReq>any())).thenReturn(MockAltsHandshakerResp.getOkResponse(0));
RpcProtocolVersions rpcVersions = RpcProtocolVersions.newBuilder().setMinRpcVersion(RpcProtocolVersions.Version.newBuilder().setMajor(3).setMinor(4).build()).setMaxRpcVersion(RpcProtocolVersions.Version.newBuilder().setMajor(5).setMinor(6).build()).build();
clientOptions = new AltsClientOptions.Builder().setTargetName(TEST_TARGET_NAME).setTargetServiceAccounts(ImmutableList.of(TEST_TARGET_SERVICE_ACCOUNT)).setRpcProtocolVersions(rpcVersions).build();
NoopChannelLogger channelLogger = new NoopChannelLogger();
handshaker = new AltsHandshakerClient(mockStub, clientOptions, channelLogger);
handshaker.startClientHandshake();
ArgumentCaptor<HandshakerReq> reqCaptor = ArgumentCaptor.forClass(HandshakerReq.class);
verify(mockStub).send(reqCaptor.capture());
assertEquals(rpcVersions, reqCaptor.getValue().getClientStart().getRpcVersions());
}
use of io.grpc.internal.TestUtils.NoopChannelLogger in project grpc-java by grpc.
the class AltsHandshakerClientTest method setUp.
@Before
public void setUp() {
mockStub = mock(AltsHandshakerStub.class);
clientOptions = new AltsClientOptions.Builder().setTargetName(TEST_TARGET_NAME).setTargetServiceAccounts(ImmutableList.of(TEST_TARGET_SERVICE_ACCOUNT)).build();
NoopChannelLogger channelLogger = new NoopChannelLogger();
handshaker = new AltsHandshakerClient(mockStub, clientOptions, channelLogger);
}
Aggregations