use of bio.terra.buffer.client.ApiClient in project terra-workspace-manager by DataBiosphere.
the class BufferService method getApiClient.
private ApiClient getApiClient(String accessToken) {
ApiClient client = new ApiClient().setHttpClient(commonHttpClient);
client.setAccessToken(accessToken);
return client;
}
use of bio.terra.buffer.client.ApiClient in project terra-resource-buffer by DataBiosphere.
the class HandoutResource method userJourney.
@Override
public void userJourney(TestUserSpecification testUser) throws Exception {
ApiClient apiClient = BufferServiceUtils.getClient(server);
BufferApi bufferApi = new BufferApi(apiClient);
String handoutRequestId = UUID.randomUUID().toString();
logger.info("Generated handoutRequestId: {}", handoutRequestId);
String projectId = retryHandout(bufferApi, handoutRequestId);
successCount++;
logger.info("project Id: {} for handoutRequestId: {}", projectId, handoutRequestId);
}
use of bio.terra.buffer.client.ApiClient in project terra-resource-buffer by DataBiosphere.
the class HandoutResource method setup.
@Override
public void setup(List<TestUserSpecification> testUsers) throws Exception {
// Verify pool is full before the test. If pool is not empty, poll until it is full.
ApiClient apiClient = BufferServiceUtils.getClient(server);
BufferApi bufferApi = new BufferApi(apiClient);
poolSize = bufferApi.getPoolInfo(POOL_ID).getPoolConfig().getSize();
// Poll until pool is full.
pollUntilResourceCountExceeds(server, Duration.ofMinutes(30), poolSize);
assertThat(bufferApi.getPoolInfo(POOL_ID).getResourceStateCount().get("READY"), greaterThanOrEqualTo(poolSize));
beforeCount = bufferApi.getPoolInfo(POOL_ID).getResourceStateCount().get("READY");
}
use of bio.terra.buffer.client.ApiClient in project terra-resource-buffer by DataBiosphere.
the class ServiceStatus method userJourney.
@Override
public void userJourney(TestUserSpecification testUser) throws Exception {
ApiClient apiClient = BufferServiceUtils.getClient(server);
UnauthenticatedApi unauthenticatedApi = new UnauthenticatedApi(apiClient);
SystemStatus systemStatus = unauthenticatedApi.serviceStatus();
logger.info("systemStatus: {}", systemStatus);
int httpCode = unauthenticatedApi.getApiClient().getStatusCode();
logger.info("Service status HTTP code: {}", httpCode);
}
use of bio.terra.buffer.client.ApiClient in project terra-resource-buffer by DataBiosphere.
the class UnauthorizedAccess method userJourney.
@Override
public void userJourney(TestUserSpecification testUser) throws Exception {
ApiClient apiClient = BufferServiceUtils.getClient(server);
BufferApi bufferApi = new BufferApi(apiClient);
try {
retryHandout(bufferApi, UUID.randomUUID().toString());
assertThat("Invalid SA account access not throwing exception", false);
} catch (ApiException apiEx) {
assertThat(apiEx.getCode(), equalTo(401));
}
}
Aggregations