use of io.cdap.cdap.security.authentication.client.AccessToken in project cdap by caskdata.
the class RESTClientTest method testPutSuccessWithAccessToken.
@Test
public void testPutSuccessWithAccessToken() throws Exception {
URL url = getBaseURI().resolve("/api/testPutAuth").toURL();
HttpRequest request = HttpRequest.put(url).build();
HttpResponse response = restClient.execute(request, new AccessToken(ACCESS_TOKEN, 82000L, "Bearer"));
verifyResponse(response, only(200), any(), only("Access token received: " + ACCESS_TOKEN));
}
use of io.cdap.cdap.security.authentication.client.AccessToken in project cdap by caskdata.
the class RESTClientTest method testUnavailableLimit.
@Test
public void testUnavailableLimit() throws Exception {
URL url = getBaseURI().resolve("/api/testUnavail").toURL();
HttpRequest request = HttpRequest.get(url).build();
HttpResponse response = restClient.execute(request, new AccessToken(ACCESS_TOKEN, 82000L, "Bearer"));
verifyResponse(response, only(200), any(), any());
}
use of io.cdap.cdap.security.authentication.client.AccessToken in project cdap by caskdata.
the class RESTClientTest method testPostSuccessWithAccessToken.
@Test
public void testPostSuccessWithAccessToken() throws Exception {
URL url = getBaseURI().resolve("/api/testPostAuth").toURL();
HttpRequest request = HttpRequest.post(url).build();
HttpResponse response = restClient.execute(request, new AccessToken(ACCESS_TOKEN, 82000L, "Bearer"));
verifyResponse(response, only(200), any(), only("Access token received: " + ACCESS_TOKEN));
}
Aggregations