Validation of custom issue event configuration

An additional test in the example repository is EventListenerWithCustomTemplateSetTest which a cut and paste from JEMH product integration tests.  It does a lot:

  • deploy a Profile

  • deploy a Test Case

  • deploy a Template Set

  • deploy a notification Inhibition script for JEMH Event Listener (solving the problem of JEMH doing Jira user notifications, and not duplicating them for interactive users by checking for the presence of a custom field set by JEMH in order to enable ISSUE_CREATED events to be handled rather than the custom event fired by JEMH).

  • setup Jira to use localhost:3025 as a default SMTP Server, which is the Greenmail SMTP Server we packaged int he test, and which was booted automatically via:

    @Rule public final GreenMailRule greenMail = new GreenMailRule(ServerSetupTest.SMTP);



  • enables JEMH Event Lsitener

  • enables JEMH Auditing

  • sets up default TEXT single line custom fields for "Email Sender Address", "Email Sender Name" and multi-line field "Email Participants"



10 associateJiraMailServerWithLocalSmtpServerTest()

setup Jira to deliver SMTP mail to the local Greenmail SMTP server

20 setupForEventListenerTest()

just sets up the JEMH Event Listener, uploads Profile (this bootstraps creation of all referred fields and Projects!), custom TemplateSet, creates an Event Listener Project Mapping for the custom issue event, updates permission scheme to grant MANAGE_WATCHERS and EDIT_OWN_COMMENTS

30 sendCustomCreatedEvent()

  • runs the test case, makes some assertions that an issue was created etc

  • asserts that notification emails pulled from the Greenmail SMTP queue were in fact generated by JEMH and did in fact only total the expected number (1 for the email user recipient, one for the Jira assignee)