@Test
public void testGetCronExpression() throws ParseException
{

    // Build a list of system jobs to be scheduled.
    Map<String, AbstractSystemJob> systemJobs = applicationContext.getBeansOfType(AbstractSystemJob.class);
    // Validate that we located the expected number of system job.
    assertEquals(7, CollectionUtils.size(systemJobs));
    // Validate cron expression configured in the system for each system job.
    for (Map.Entry<String, AbstractSystemJob> entry : systemJobs.entrySet())
    {
        // Get the name and the system job implementation.
        String jobName = entry.getKey();
        AbstractSystemJob systemJob = entry.getValue();
        // Get the cron expression configured in the system for the job.
        String cronExpressionAsText = systemJob.getCronExpression();
        LOGGER.info(String.format("Testing cron expression \"%s\" specified for \"%s\" system job...", cronExpressionAsText, jobName));
        // Validate the cron expression.
        if (CronExpression.isValidExpression(cronExpressionAsText))
        {
            CronExpression cronExpression = new CronExpression(cronExpressionAsText);
            LOGGER.info(String.format("Next valid time for \"%s\" cron expression after now is \"%s\".", cronExpressionAsText,
                cronExpression.getNextValidTimeAfter(new Date())));
        }
        else
        {
            fail(String.format("Cron expression \"%s\" specified for \"%s\" system job is not valid.", cronExpressionAsText, jobName));
        }
    }
}