agave-jobs/jobs-core/src/test/java/org/iplantc/service/notification/events/JobNotificationEventTest.java
/**
	 * Test that job status events properly process their notification template
	 * variables.
	 * 
	 * @throws Exception
	 */
Test that job status events properly process their notification template
variables.

@throws Exception
Test that job status events properly process their notification template variables . @throws Exception
@Test(dataProvider="processJobStatusEventsProvider")
	public void processJobStatusEvents(JobStatusType status) 
	throws Exception 
	{
		Software software = createSoftware();
		Job job = createJob(status, software);
		Notification notification = createNotification(job);
		JobNotificationEvent event = (JobNotificationEvent) EventFilterFactory.getInstance(new AgaveUUID(job.getUuid()), notification, status.name(), job.getOwner());
		event.setCustomNotificationMessageContextData(job.toJSON());
		String resolvedTemplate = event.getEmailBody();
		Assert.assertFalse(resolvedTemplate.contains("${"), "No template variables should be found in the plain text email template body");
		Assert.assertTrue(resolvedTemplate.contains("Execution System: " + job.getSystem()), "Execution system should be resolved in email body.");
		resolvedTemplate = event.getHtmlEmailBody();
		Assert.assertFalse(resolvedTemplate.contains("${"), "No template variables should be found in the html email template body");
		Assert.assertTrue(resolvedTemplate.contains("<strong>Execution System:</strong> " + job.getSystem()), "Execution system should be resolved in email body.");
		resolvedTemplate = event.getEmailSubject();
		Assert.assertFalse(resolvedTemplate.contains("${"), "No template variables should be found in the email subject");
	}
@ Test ( dataProvider = "processJobStatusEventsProvider" ) public void processJobStatusEvents ( JobStatusType status ) throws Exception { Software software = createSoftware ( ) ; Job job = createJob ( status , software ) ; Notification notification = createNotification ( job ) ; JobNotificationEvent event = ( JobNotificationEvent ) EventFilterFactory . getInstance ( new AgaveUUID ( job . getUuid ( ) ) , notification , status . name ( ) , job . getOwner ( ) ) ; event . setCustomNotificationMessageContextData ( job . toJSON ( ) ) ; String resolvedTemplate = event . getEmailBody ( ) ; Assert . assertFalse ( resolvedTemplate . contains ( "${" ) , "No template variables should be found in the plain text email template body" ) ; Assert . assertTrue ( resolvedTemplate . contains ( "Execution System: " + job . getSystem ( ) ) , "Execution system should be resolved in email body." ) ; resolvedTemplate = event . getHtmlEmailBody ( ) ; Assert . assertFalse ( resolvedTemplate . contains ( "${" ) , "No template variables should be found in the html email template body" ) ; Assert . assertTrue ( resolvedTemplate . contains ( "<strong>Execution System:</strong> " + job . getSystem ( ) ) , "Execution system should be resolved in email body." ) ; resolvedTemplate = event . getEmailSubject ( ) ; Assert . assertFalse ( resolvedTemplate . contains ( "${" ) , "No template variables should be found in the email subject" ) ; }
Test that job status events properly process their notification template
 variables.
Test that job status events properly process their notification template variables .