### Question:
AppInfoCollector { void storeLastBundles(final File outputDir, int numBundles, int maxChildActions) { if (numBundles == 0) { return; } try { final List<BundleJob> jobs = client.getBundleJobsInfo(null, 0, numBundles); for (BundleJob job : jobs) { getBundleJob(outputDir, job.getId(), maxChildActions); } } catch (OozieClientException e) { System.err.printf("Exception occurred during the retrieval of information on the last %d bundle(s): %s.%n", numBundles, e.getMessage()); } } AppInfoCollector(final Configuration hadoopConfig, final DiagOozieClient client);   }### Answer:
@Test public void testStoreLastBundles() throws Exception { final List<BundleJob> bundleJobs = Arrays.asList(bundleJob); doReturn(bundleJobs).when(mockOozieClient).getBundleJobsInfo(null, 0, 1); final String bundleId = "0000027-110322105610515-oozie-chao-B"; doReturn(bundleId).when(bundleJob).getId(); doReturn(Job.Status.RUNNING).when(bundleJob).getStatus(); doReturn(bundleJob).when(mockOozieClient).getBundleJobInfo(anyString()); appInfoCollector.storeLastBundles(testFolder,1,1); final File bundleInfoOut = new File(testFolder, bundleId + Path.SEPARATOR + "info.txt"); assertTrue(bundleInfoOut.exists()); assertFileContains(bundleInfoOut, bundleId); }