MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / channelConnected94Secure

Method channelConnected94Secure

test/TestRegionClient.java:299–322  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297 }
298
299 @Test
300 public void channelConnected94Secure() throws Exception {
301 RegionClient rclient = mock(RegionClient.class, Mockito.RETURNS_DEEP_STUBS);
302 Config config = new Config();
303 config.overrideConfig("hbase.security.auth.enable", "true");
304 config.overrideConfig("hbase.security.auth.94", "true");
305 when(hbase_client.getConfig()).thenReturn(config);
306 SecureRpcHelper94 helper = mock(SecureRpcHelper94.class);
307 PowerMockito.whenNew(SecureRpcHelper94.class).withAnyArguments()
308 .thenReturn(helper);
309
310 hbase_client.has_root = false;
311 when(cse.getChannel()).thenReturn(chan);
312 PowerMockito.field(RegionClient.class, "hbase_client")
313 .set(rclient, hbase_client);
314 PowerMockito.when(rclient, "channelConnected", ctx, cse).thenCallRealMethod();
315
316 rclient.channelConnected(ctx, cse);
317
318 verify(helper, times(1)).sendHello(chan);
319 verifyPrivate(rclient, never()).invoke("helloRpc", eq(chan), any(byte[].class));
320 verifyPrivate(rclient, never()).invoke("becomeReady", chan,
321 RegionClient.SERVER_VERSION_095_OR_ABOVE);
322 }
323
324 @Test
325 public void channelConnected96Secure() throws Exception {

Callers

nothing calls this directly

Calls 6

overrideConfigMethod · 0.95
channelConnectedMethod · 0.95
getConfigMethod · 0.80
getChannelMethod · 0.80
setMethod · 0.45
sendHelloMethod · 0.45

Tested by

no test coverage detected