### Question:
OMVolumeCreateResponse extends OMClientResponse { @Override protected void addToDBBatch(OMMetadataManager omMetadataManager, BatchOperation batchOperation) throws IOException { String dbVolumeKey = omMetadataManager.getVolumeKey(omVolumeArgs.getVolume()); String dbUserKey = omMetadataManager.getUserKey(omVolumeArgs.getOwnerName()); omMetadataManager.getVolumeTable().putWithBatch(batchOperation, dbVolumeKey, omVolumeArgs); omMetadataManager.getUserTable().putWithBatch(batchOperation, dbUserKey, userVolumeInfo); } OMVolumeCreateResponse(@Nonnull OMResponse omResponse,
      @Nonnull OmVolumeArgs omVolumeArgs,
      @Nonnull UserVolumeInfo userVolumeInfo);  OMVolumeCreateResponse(@Nonnull OMResponse omResponse); @VisibleForTesting OmVolumeArgs getOmVolumeArgs();  }### Answer:
@Test public void testAddToDBBatch() throws Exception { String volumeName = UUID.randomUUID().toString(); String userName = "user1"; UserVolumeInfo volumeList = UserVolumeInfo.newBuilder() .setObjectID(1).setUpdateID(1) .addVolumeNames(volumeName).build(); OMResponse omResponse = OMResponse.newBuilder() .setCmdType(OzoneManagerProtocolProtos.Type.CreateVolume) .setStatus(OzoneManagerProtocolProtos.Status.OK) .setSuccess(true) .setCreateVolumeResponse(CreateVolumeResponse.getDefaultInstance()) .build(); OmVolumeArgs omVolumeArgs = OmVolumeArgs.newBuilder() .setOwnerName(userName).setAdminName(userName) .setVolume(volumeName).setCreationTime(Time.now()).build(); OMVolumeCreateResponse omVolumeCreateResponse = new OMVolumeCreateResponse(omResponse, omVolumeArgs, volumeList); omVolumeCreateResponse.addToDBBatch(omMetadataManager, batchOperation); omMetadataManager.getStore().commitBatchOperation(batchOperation); Assert.assertEquals(1, omMetadataManager.countRowsInTable(omMetadataManager.getVolumeTable())); Assert.assertEquals(omVolumeArgs, omMetadataManager.getVolumeTable().iterator().next().getValue()); Assert.assertEquals(volumeList, omMetadataManager.getUserTable().get( omMetadataManager.getUserKey(userName))); }