JobListenerAdvice { public void jobAfter(JoinPoint joinPoint) { if (collectionDriverManager == null) { return; } CollectionDriver driver = collectionDriverManager.getDriver(); if (driver != null) { String datacollectionEnable = new PropertiesUtil( CollectionDriverManager.getConfigurationFile()) .getProperty(driver.getCollectionSwitchName()); if (datacollectionEnable.trim().equalsIgnoreCase("true")) { logger.debug("jobAfter() of JobListenerAdvice is running!"); logger.debug("hijacked : " + joinPoint.getSignature().getName()); Object[] args = joinPoint.getArgs(); if (args != null) { JobExecution jobExecution = (JobExecution) args[0]; if (jobExecution != null) { String id = CollectionConstants.ASYNCHRONIZATION_PREFIX + jobExecution.getId(); dataContainer.push(id, CollectionConstants.OPERATION_END_TIME, System.currentTimeMillis(), true); ExitStatus exitStatus = jobExecution.getExitStatus(); if (exitStatus != null) { dataContainer.push(id, CollectionConstants.OPERATION_STATUS, exitStatus.getExitCode(), true); } } } } } }  void jobAfter(JoinPoint joinPoint); CollectionDriverManager getCollectionDriverManager(); void setCollectionDriverManager(
         CollectionDriverManager collectionDriverManager); DataContainer getDataContainer(); void setDataContainer(DataContainer dataContainer);  }
@Test(groups = { "TestJobListenerAdvice" }) public void testJobAfter() { dataContainer.setMaxLength(1); jobListenerAdvice.jobAfter(joinPoint); Map<String, Map<String, Object>> data = dataContainer.pop(); assertEquals(data.get("asynchronization_1000").size(), 2); assertNotNull(data.get("asynchronization_1000").get("end_time")); assertEquals(data.get("asynchronization_1000").get("operation_status"), "COMPLETED"); }