### Question:
OzoneManagerServiceProviderImpl implements OzoneManagerServiceProvider { @VisibleForTesting DBCheckpoint getOzoneManagerDBSnapshot() { String snapshotFileName = RECON_OM_SNAPSHOT_DB + "_" + System.currentTimeMillis(); File targetFile = new File(omSnapshotDBParentDir, snapshotFileName + ".tar.gz"); try { SecurityUtil.doAsLoginUser(() -> { try (InputStream inputStream = reconUtils.makeHttpCall( connectionFactory, getOzoneManagerSnapshotUrl(), isOmSpengoEnabled()).getInputStream()) { FileUtils.copyInputStreamToFile(inputStream, targetFile); } return null; }); Path untarredDbDir = Paths.get(omSnapshotDBParentDir.getAbsolutePath(), snapshotFileName); reconUtils.untarCheckpointFile(targetFile, untarredDbDir); FileUtils.deleteQuietly(targetFile); return new RocksDBCheckpoint(untarredDbDir); } catch (IOException e) { LOG.error("Unable to obtain Ozone Manager DB Snapshot. ", e); } return null; } @Inject  OzoneManagerServiceProviderImpl(
      OzoneConfiguration configuration,
      ReconOMMetadataManager omMetadataManager,
      ReconTaskController reconTaskController,
      ReconUtils reconUtils,
      OzoneManagerProtocol ozoneManagerClient); void registerOMDBTasks(); @Override OMMetadataManager getOMMetadataManagerInstance(); @Override void start(); @Override void stop(); @VisibleForTesting String getOzoneManagerSnapshotUrl(); @VisibleForTesting void syncDataFromOM(); OzoneManagerSyncMetrics getMetrics();  }### Answer:
@Test public void testGetOzoneManagerDBSnapshot() throws Exception { File reconOmSnapshotDbDir = temporaryFolder.newFolder(); File checkpointDir = Paths.get(reconOmSnapshotDbDir.getAbsolutePath(), "testGetOzoneManagerDBSnapshot").toFile(); checkpointDir.mkdir(); File file1 = Paths.get(checkpointDir.getAbsolutePath(), "file1") .toFile(); String str = "File1 Contents"; BufferedWriter writer = new BufferedWriter(new FileWriter( file1.getAbsolutePath())); writer.write(str); writer.close(); File file2 = Paths.get(checkpointDir.getAbsolutePath(), "file2") .toFile(); str = "File2 Contents"; writer = new BufferedWriter(new FileWriter(file2.getAbsolutePath())); writer.write(str); writer.close(); File tarFile = createTarFile(checkpointDir.toPath()); InputStream fileInputStream = new FileInputStream(tarFile); ReconUtils reconUtilsMock = getMockReconUtils(); HttpURLConnection httpURLConnectionMock = mock(HttpURLConnection.class); when(httpURLConnectionMock.getInputStream()).thenReturn(fileInputStream); when(reconUtilsMock.makeHttpCall(any(), anyString(), anyBoolean())) .thenReturn(httpURLConnectionMock); ReconOMMetadataManager reconOMMetadataManager = mock(ReconOMMetadataManager.class); ReconTaskController reconTaskController = getMockTaskController(); OzoneManagerServiceProviderImpl ozoneManagerServiceProvider = new OzoneManagerServiceProviderImpl(configuration, reconOMMetadataManager, reconTaskController, reconUtilsMock, ozoneManagerProtocol); DBCheckpoint checkpoint = ozoneManagerServiceProvider .getOzoneManagerDBSnapshot(); assertNotNull(checkpoint); assertTrue(checkpoint.getCheckpointLocation().toFile().isDirectory()); assertTrue(checkpoint.getCheckpointLocation().toFile() .listFiles().length == 2); }