OozieResourceSensitivityDataJoiner { public List<OozieResourceEntity> joinOozieResourceSensitivity(String site, List<CoordinatorJob> coordinatorJobs) { OozieSensitivityMetadataDAO oozieSensitivityMetadataDAO = new OozieSensitivityMetadataDAOImpl(); Map<String, String> sensitivityMap = oozieSensitivityMetadataDAO.getOozieSensitivityMap(site); LOG.info("Joining Resource with Sensitivity data .."); List<OozieResourceEntity> result = new ArrayList<>(); for (CoordinatorJob eachJob : coordinatorJobs) { OozieResourceEntity entity = new OozieResourceEntity(eachJob.getId(), eachJob.getAppName(), sensitivityMap.get(eachJob.getId())); result.add(entity); } return result; }  List<OozieResourceEntity> joinOozieResourceSensitivity(String site, List<CoordinatorJob> coordinatorJobs);  }
@Test public void testOozieResourceSensitivityDataJoiner() throws Exception { List<CoordinatorJob> coordinatorJobs = getCoordinatorJobs(); mockGetOozieSensitivityMap(); OozieResourceSensitivityDataJoiner joiner = new OozieResourceSensitivityDataJoiner(); List<OozieResourceEntity> oozieResourceEntitys = joiner.joinOozieResourceSensitivity("test", coordinatorJobs); Assert.assertEquals(3, oozieResourceEntitys.size()); Assert.assertEquals("0007197-160509174709457-oozie-oozi-C", oozieResourceEntitys.get(0).getJobId()); Assert.assertEquals("co_pms_ods_adv_click_log", oozieResourceEntitys.get(0).getName()); Assert.assertEquals("pms job", oozieResourceEntitys.get(0).getSensitiveType()); Assert.assertEquals("0007189-160509174709457-oozie-oozi-C", oozieResourceEntitys.get(1).getJobId()); Assert.assertEquals("co_tandem_ods_adv_click_log", oozieResourceEntitys.get(1).getName()); Assert.assertEquals("tandem job", oozieResourceEntitys.get(1).getSensitiveType()); Assert.assertEquals("0007188-160509174709457-oozie-oozi-C", oozieResourceEntitys.get(2).getJobId()); Assert.assertEquals("co_cpc_new_custorm", oozieResourceEntitys.get(2).getName()); Assert.assertEquals(null, oozieResourceEntitys.get(2).getSensitiveType()); }