()
| 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 { |
nothing calls this directly
no test coverage detected