Class TestEmailSubscription

All Implemented Interfaces:
FunctTestConstants

public class TestEmailSubscription extends AbstractSubscriptionEmailTest
Test email subscriptions in JIRA.

The test data in 'TestSubscription.xml' contains three projects. 'ProjectOne' (KEY: ONE) contains 210 issues. All of these issues can be returned using the global 'FilterOne' or 'FredFilterOne' saved search. 'ProjectTwo' (KEY: TWO) contains 2 issues. All of these issues can be returned using the global 'FilterTwo' or 'FredFilterTwo' saved search. Finally, there are global filters called 'ZeroFilter' and 'FredZeroFilter' that returns no issues.

The test data also contains three users. Admin is the administrator and expects text e-mails. Bob is not an administrator but also expects text e-mails. Fred is not an administrator and expects HTML e-mails.

Since:
v3.13
  • Field Details

  • Constructor Details

    • TestEmailSubscription

      public TestEmailSubscription()
  • Method Details

    • setUpMailServer

      public void setUpMailServer()
    • setUpNotificationTypes

      public void setUpNotificationTypes()
    • testGroupZeroResults

      public void testGroupZeroResults() throws Exception
      Check e-mail subscription with no issues.
      Throws:
      Exception - test just throws exception when unexpected error occurs to fail the test.
    • testGroupCompleteResults

      public void testGroupCompleteResults() throws Exception
      Check for subscription e-mail that contains all issue matches.
      Throws:
      Exception - test just throws exception when unexpected error occurs to fail the test.
    • testMessageShouldContainAttachedIssueTypeAndPriorityIcons

      public void testMessageShouldContainAttachedIssueTypeAndPriorityIcons() throws Exception
      Throws:
      Exception
    • testGroupPartialResults

      public void testGroupPartialResults() throws Exception
      Check the subscription of an e-mail that only contains some of the results. There should be a link to the filter in these e-mails.
      Throws:
      Exception - test just throws exception when unexpected error occurs to fail the test.
    • testPersonalZeroResults

      public void testPersonalZeroResults() throws Exception
      Check e-mail subscription with no issues for an unprivileged user.
      Throws:
      Exception - test just throws exception when unexpected error occurs to fail the test.
    • testPersonalCompleteResults

      public void testPersonalCompleteResults() throws Exception
      Check for subscription e-mail that contains all issue matches for an unprivileged user.
      Throws:
      Exception - test just throws exception when unexpected error occurs to fail the test.
    • testPersonalPartialResults

      public void testPersonalPartialResults() throws Exception
      Check the subscription of an e-mail that only contains some of the results for an unprivieleged user. There should be a link to the filter in these e-mails.
      Throws:
      Exception - test just throws exception when unexpected error occurs to fail the test.
    • testSubscriptionIsHtmlEncoded

      public void testSubscriptionIsHtmlEncoded() throws Exception
      For JRA-17595
      Throws:
      Exception
    • testUserNameIsEncodedInHtml

      public void testUserNameIsEncodedInHtml() throws InterruptedException, jakarta.mail.MessagingException
      Asserts that the user name is also XSS encoded. But seriously why call any one xss??

      For JRA-17595

      Throws:
      InterruptedException - if stuff goes wrong
      jakarta.mail.MessagingException - if the shit hits the fan