Search in sources :

Example 16 with ObjectStorageMetadataRequest

use of com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageMetadataRequest in project cloudbreak by hortonworks.

the class AwsObjectStorageConnectorTest method getObjectStorageMetadata.

@Test
public void getObjectStorageMetadata() {
    when(s3Client.getBucketLocation(BUCKET_NAME)).thenReturn(REGION_NAME);
    ObjectStorageMetadataRequest request = ObjectStorageMetadataRequest.builder().withObjectStoragePath(BUCKET_NAME).build();
    ObjectStorageMetadataResponse result = underTest.getObjectStorageMetadata(request);
    verify(s3Client).getBucketLocation(BUCKET_NAME);
    assertEquals(REGION_NAME, result.getRegion());
    assertEquals(ResponseStatus.OK, result.getStatus());
}
Also used : ObjectStorageMetadataResponse(com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageMetadataResponse) ObjectStorageMetadataRequest(com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageMetadataRequest) Test(org.junit.Test)

Aggregations

ObjectStorageMetadataRequest (com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageMetadataRequest)16 ObjectStorageMetadataResponse (com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageMetadataResponse)15 ValidationResultBuilder (com.sequenceiq.cloudbreak.validation.ValidationResult.ValidationResultBuilder)10 Test (org.junit.jupiter.api.Test)10 CloudCredential (com.sequenceiq.cloudbreak.cloud.model.CloudCredential)3 Test (org.junit.Test)3 AmazonS3Exception (com.amazonaws.services.s3.model.AmazonS3Exception)2 ValidationResult (com.sequenceiq.cloudbreak.validation.ValidationResult)2 FileSystemType (com.sequenceiq.common.model.FileSystemType)2 Credential (com.sequenceiq.datalake.entity.Credential)1 EnvironmentServiceException (com.sequenceiq.environment.exception.EnvironmentServiceException)1