Search in sources :

Example 1 with S3MultipartUploadCompleteRequest

use of org.apache.hadoop.ozone.om.request.s3.multipart.S3MultipartUploadCompleteRequest in project ozone by apache.

the class TestOzoneManagerRatisRequest method testRequestWithNonExistentBucket.

@Test(timeout = 300_000)
public void testRequestWithNonExistentBucket() throws Exception {
    ozoneManager = Mockito.mock(OzoneManager.class);
    ozoneConfiguration.set(OMConfigKeys.OZONE_OM_DB_DIRS, folder.newFolder().getAbsolutePath());
    omMetadataManager = new OmMetadataManagerImpl(ozoneConfiguration);
    when(ozoneManager.getMetadataManager()).thenReturn(omMetadataManager);
    String volumeName = "vol1";
    String bucketName = "invalidBuck";
    OzoneManagerProtocolProtos.OMRequest omRequest = OMRequestTestUtils.createCompleteMPURequest(volumeName, bucketName, "mpuKey", "mpuKeyID", new ArrayList<>());
    OMClientRequest req = OzoneManagerRatisUtils.createClientRequest(omRequest, ozoneManager);
    Assert.assertNotNull(req);
    Assert.assertTrue("Unexpected request on invalid bucket", req instanceof S3MultipartUploadCompleteRequest);
}
Also used : OmMetadataManagerImpl(org.apache.hadoop.ozone.om.OmMetadataManagerImpl) OMClientRequest(org.apache.hadoop.ozone.om.request.OMClientRequest) S3MultipartUploadCompleteRequest(org.apache.hadoop.ozone.om.request.s3.multipart.S3MultipartUploadCompleteRequest) OzoneManager(org.apache.hadoop.ozone.om.OzoneManager) OzoneManagerProtocolProtos(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos) Test(org.junit.Test)

Aggregations

OmMetadataManagerImpl (org.apache.hadoop.ozone.om.OmMetadataManagerImpl)1 OzoneManager (org.apache.hadoop.ozone.om.OzoneManager)1 OMClientRequest (org.apache.hadoop.ozone.om.request.OMClientRequest)1 S3MultipartUploadCompleteRequest (org.apache.hadoop.ozone.om.request.s3.multipart.S3MultipartUploadCompleteRequest)1 OzoneManagerProtocolProtos (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos)1 Test (org.junit.Test)1