use of co.cask.cdap.security.authentication.client.AuthenticationClient in project cdap-ingest by caskdata.
the class RestStreamClientTest method testSuccessAuthCreate.
@Test
public void testSuccessAuthCreate() throws IOException {
AuthenticationClient authClient = Mockito.mock(AuthenticationClient.class);
AccessToken accessToken = Mockito.mock(AccessToken.class);
Mockito.when(authClient.getAccessToken()).thenReturn(accessToken);
Mockito.when(accessToken.getValue()).thenReturn(AUTH_TOKEN);
Mockito.when(accessToken.getTokenType()).thenReturn("Bearer");
streamClient = RestStreamClient.builder(testServerHost, testServerPort).authClient(authClient).build();
streamClient.create(TestUtils.SUCCESS_STREAM_NAME);
}
Aggregations