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);
}
Aggregations