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

Method beforeLocal

test/TestSecureRpcHelper96.java:84–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82 private SecureRpcHelper96 helper;
83
84 @Before
85 public void beforeLocal() throws Exception {
86 channel = mock(Channel.class);
87
88 when(kerberos_provider.getAuthMethodCode())
89 .thenReturn(ClientAuthProvider.KEBEROS_CLIENT_AUTH_CODE);
90 when(kerberos_provider.getClientUsername()).thenReturn("Eskarina");
91
92 when(sasl_client.hasInitialResponse()).thenReturn(true);
93
94 PowerMockito.mockStatic(Channels.class);
95 PowerMockito.doAnswer(new Answer<Void>() {
96 @Override
97 public Void answer(final InvocationOnMock invocation) throws Throwable {
98 if (buffers == null) {
99 buffers = new ArrayList<ChannelBuffer>(2);
100 }
101 buffers.add((ChannelBuffer)invocation.getArguments()[1]);
102 return null;
103 }
104 }).when(Channels.class);
105 Channels.write(any(Channel.class), any(ChannelBuffer.class));
106
107 config.overrideConfig(SecureRpcHelper.SECURITY_AUTHENTICATION_KEY,
108 "kerberos");
109 helper = new SecureRpcHelper96(client, region_client, remote_endpoint);
110 }
111
112 @Test
113 public void ctorKerberos() throws Exception {

Callers

nothing calls this directly

Calls 3

getAuthMethodCodeMethod · 0.45
getClientUsernameMethod · 0.45
overrideConfigMethod · 0.45

Tested by

no test coverage detected