### Question:
BucketManagerImpl implements BucketManager { @Override public OmBucketInfo getBucketInfo(String volumeName, String bucketName) throws IOException { Preconditions.checkNotNull(volumeName); Preconditions.checkNotNull(bucketName); metadataManager.getLock().acquireReadLock(BUCKET_LOCK, volumeName, bucketName); try { String bucketKey = metadataManager.getBucketKey(volumeName, bucketName); OmBucketInfo value = metadataManager.getBucketTable().get(bucketKey); if (value == null) { LOG.debug("bucket: {} not found in volume: {}.", bucketName, volumeName); throw new OMException("Bucket not found", BUCKET_NOT_FOUND); } return value; } catch (IOException | DBException ex) { if (!(ex instanceof OMException)) { LOG.error("Exception while getting bucket info for bucket: {}", bucketName, ex); } throw ex; } finally { metadataManager.getLock().releaseReadLock(BUCKET_LOCK, volumeName, bucketName); } } BucketManagerImpl(OMMetadataManager metadataManager);  BucketManagerImpl(OMMetadataManager metadataManager,
                           KeyProviderCryptoExtension kmsProvider);  BucketManagerImpl(OMMetadataManager metadataManager,
      KeyProviderCryptoExtension kmsProvider, boolean isRatisEnabled); @Override void createBucket(OmBucketInfo bucketInfo); @Nullable BucketEncryptionKeyInfo.Builder createBucketEncryptionKeyInfoBuilder(
      BucketEncryptionKeyInfo bek); @Override OmBucketInfo getBucketInfo(String volumeName, String bucketName); @Override void setBucketProperty(OmBucketArgs args); @Override void deleteBucket(String volumeName, String bucketName); @Override List<OmBucketInfo> listBuckets(String volumeName,
      String startBucket, String bucketPrefix, int maxNumOfBuckets); @Override boolean addAcl(OzoneObj obj, OzoneAcl acl); @Override boolean removeAcl(OzoneObj obj, OzoneAcl acl); @Override boolean setAcl(OzoneObj obj, List<OzoneAcl> acls); @Override List<OzoneAcl> getAcl(OzoneObj obj); @Override boolean checkAccess(OzoneObj ozObject, RequestContext context);  }### Answer:
@Test public void testGetBucketInfoForInvalidBucket() throws Exception { thrown.expectMessage("Bucket not found"); OmMetadataManagerImpl metaMgr = createSampleVol(); try { BucketManager bucketManager = new BucketManagerImpl(metaMgr); bucketManager.getBucketInfo("sampleVol", "bucketOne"); } catch (OMException omEx) { Assert.assertEquals(ResultCodes.BUCKET_NOT_FOUND, omEx.getResult()); throw omEx; } finally { metaMgr.getStore().close(); } }
@Test public void testGetBucketInfo() throws Exception { OmMetadataManagerImpl metaMgr = createSampleVol(); BucketManager bucketManager = new BucketManagerImpl(metaMgr); OmBucketInfo bucketInfo = OmBucketInfo.newBuilder() .setVolumeName("sampleVol") .setBucketName("bucketOne") .setStorageType(StorageType.DISK) .setIsVersionEnabled(false) .build(); createBucket(metaMgr, bucketInfo); OmBucketInfo result = bucketManager.getBucketInfo( "sampleVol", "bucketOne"); Assert.assertEquals("sampleVol", result.getVolumeName()); Assert.assertEquals("bucketOne", result.getBucketName()); Assert.assertEquals(StorageType.DISK, result.getStorageType()); Assert.assertEquals(false, result.getIsVersionEnabled()); metaMgr.getStore().close(); }