public abstract class

AbstractSubscriptionEmailTest

extends EmailBaseFuncTestCase
java.lang.Object
   ↳ com.atlassian.jira.functest.framework.BaseJiraFuncTest
     ↳ com.atlassian.jira.webtests.EmailBaseFuncTestCase
       ↳ com.atlassian.jira.webtests.AbstractSubscriptionEmailTest

Class Overview

An abstract class for tests that check the integrity of subscription e-mails.

Summary

Nested Classes
class AbstractSubscriptionEmailTest.CountingIterator Iterator that can be used to return a sequence of numbers. 
class AbstractSubscriptionEmailTest.FilterConfig Holds the configuration for a filter that can be used to create a subscription. 
[Expand]
Inherited Constants
From class com.atlassian.jira.webtests.EmailBaseFuncTestCase
From interface com.atlassian.jira.functest.framework.FunctTestConstants
[Expand]
Inherited Fields
From class com.atlassian.jira.webtests.EmailBaseFuncTestCase
From class com.atlassian.jira.functest.framework.BaseJiraFuncTest
From interface com.atlassian.jira.functest.framework.FunctTestConstants
Public Constructors
AbstractSubscriptionEmailTest()
Protected Methods
static String assertEditLinkHtml(String body)
Ensure that the message has a link to edit the subscription.
static String assertEditLinkText(String body)
Ensure that the message has a link to edit the subscription.
String assertHtmlMessageValid(MimeMessage message, AbstractSubscriptionEmailTest.FilterConfig config, String from, String to, String userName)
Assert that a html subscription has the correct header, start and issue content.
static void assertNotEditLink(String body)
Ensure that the message does not have a link to edit the subscription.
static void assertNotPartialLink(String body)
Ensure that the passed message does not have a link to see full seach results as all issues can be seen in the e-mail.
static String assertPartialLinkHtml(AbstractSubscriptionEmailTest.FilterConfig filterConfig, String body)
Ensure that the passed message has a link to display the full results of the search.
static String assertPartialLinkText(AbstractSubscriptionEmailTest.FilterConfig filterConfig, String body)
Ensure that the passed message has a link to display the full results of the search.
String assertTextMessageValid(MimeMessage message, AbstractSubscriptionEmailTest.FilterConfig config, String from, String to, String userName)
void subscribeToFilterAndRun(AbstractSubscriptionEmailTest.FilterConfig config, String group)
Subscribe the current user to a filter and then run it.
[Expand]
Inherited Methods
From class com.atlassian.jira.webtests.EmailBaseFuncTestCase
From class com.atlassian.jira.functest.framework.BaseJiraFuncTest
From class java.lang.Object

Public Constructors

public AbstractSubscriptionEmailTest ()

Protected Methods

protected static String assertEditLinkHtml (String body)

Ensure that the message has a link to edit the subscription.

Parameters
body the body of the html message to check.
Returns
  • a string of the message minus the edit link.

protected static String assertEditLinkText (String body)

Ensure that the message has a link to edit the subscription.

Parameters
body the body of the text message to check.
Returns
  • a string of the message minus the edit link.

protected String assertHtmlMessageValid (MimeMessage message, AbstractSubscriptionEmailTest.FilterConfig config, String from, String to, String userName)

Assert that a html subscription has the correct header, start and issue content. The optional content at the end of the e-mail will also need to be validated.

Parameters
message the message to validate.
config the filter that generated the subscription e-mail.
from the expected location where the e-mail should be from.
to the expected location where the e-mail should be delivered to.
userName the username to associated with the e-mail. This is the person who created the subscroption (not the filter).
Returns
  • the passed string minus all the content at the top of the email that has already been validated.
Throws
Exception test just throws exception when unexpected error occurs to fail the test.

protected static void assertNotEditLink (String body)

Ensure that the message does not have a link to edit the subscription.

Parameters
body the string of the message minus the edit link.

protected static void assertNotPartialLink (String body)

Ensure that the passed message does not have a link to see full seach results as all issues can be seen in the e-mail.

Parameters
body the body of the e-mail to search.

protected static String assertPartialLinkHtml (AbstractSubscriptionEmailTest.FilterConfig filterConfig, String body)

Ensure that the passed message has a link to display the full results of the search.

Parameters
filterConfig the filter that produced the e-mail.
body the body of the html e-mail.
Returns
  • a string of the message minus the partial link.

protected static String assertPartialLinkText (AbstractSubscriptionEmailTest.FilterConfig filterConfig, String body)

Ensure that the passed message has a link to display the full results of the search.

Parameters
filterConfig the filter that produced the e-mail.
body the body of the text e-mail.
Returns
  • a string of the message minus the partial link.

protected String assertTextMessageValid (MimeMessage message, AbstractSubscriptionEmailTest.FilterConfig config, String from, String to, String userName)

Throws
Exception

protected void subscribeToFilterAndRun (AbstractSubscriptionEmailTest.FilterConfig config, String group)

Subscribe the current user to a filter and then run it.

Parameters
config the configuration for the filter to subscribe to.
group the group to subscribe to the filter for. This can be left null to indicate that a personal subscription should be made.