Package com.atlassian.jira.webtests
Class AbstractSubscriptionEmailTest
java.lang.Object
com.atlassian.jira.functest.framework.BaseJiraFuncTest
com.atlassian.jira.webtests.EmailBaseFuncTestCase
com.atlassian.jira.webtests.AbstractSubscriptionEmailTest
- All Implemented Interfaces:
FunctTestConstants
- Direct Known Subclasses:
TestEmailSubscription,TestSharedEmailSubscription,TestSubscriptionsWithTimeZones
An abstract class for tests that check the integrity of subscription e-mails.
- Since:
- v3.13
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classIterator that can be used to return a sequence of numbers.static classHolds the configuration for a filter that can be used to create a subscription.Nested classes/interfaces inherited from class com.atlassian.jira.webtests.EmailBaseFuncTestCase
EmailBaseFuncTestCase.MailBox -
Field Summary
Fields inherited from class com.atlassian.jira.webtests.EmailBaseFuncTestCase
DEFAULT_FROM_ADDRESS, DEFAULT_SUBJECT_PREFIX, HTML_FORMAT_REGEX, mailService, newlineFields inherited from class com.atlassian.jira.functest.framework.BaseJiraFuncTest
backdoor, environmentData, initClass, navigation, tester, testRuleFields inherited from interface com.atlassian.jira.functest.framework.FunctTestConstants
ADMIN_EMAIL, ADMIN_FULLNAME, ADMIN_PASSWORD, ADMIN_USERKEY, ADMIN_USERNAME, ADMINISTER, ADMINS_CAN_EDIT_PRIVATE_FILTERS_AND_DASHBOARDS, ADMINS_CAN_SHARE_FILTERS_AND_DASHBOARDS_WITH_ALL_GROUPS_AND_ROLES, AFFECTS_VERSIONS_FIELD_ID, AFFECTS_VERSIONS_FIELD_NAME, ANYONE, APPLINKS_BASE_ENDPOINT, APPLINKS_ENDPOINT, ASSIGN_FIELD_SCREEN, ASSIGN_FIELD_SCREEN_NAME, ASSIGN_ISSUE, ASSIGN_ISSUES_PERMISSION, ASSIGNABLE_USER, ASSIGNEE_FIELD_ID, ASSIGNEE_FIELD_NAME, ATTACHMENT_FIELD_ID, ATTACHMENT_FIELD_NAME, AUTHENTICATION_OAUTH, AUTHENTICATION_OAUTH_IMPERSONATION, AUTOMATIC_ERROR_MESSAGE, BOB_EMAIL, BOB_FULLNAME, BOB_PASSWORD, BOB_USERNAME, BRAZIL_LOCALE_ID, BROWSE, BROWSE_PROJECT_PERMISSION, BUILT_IN_CUSTOM_FIELD_KEY, BULK_CHANGE, BUTTON_CANCEL, BUTTON_CLONE_ISSUE_ID, BUTTON_CONFIRM, BUTTON_NAME_NEXT, BUTTON_NEXT, CHANGE_HISTORY, CHINA_LOCALE_ID, CLONERS_INWARD_LINK_NAME, CLONERS_LINK_TYPE_NAME, CLONERS_OUTWARD_LINK_NAME, CLOSE_ISSUE, COMMENT_DELETE_ALL, COMMENT_DELETE_OWN, COMMENT_EDIT_ALL, COMMENT_EDIT_OWN, COMMENT_ISSUE, COMMENT_REACTIONS, COMPONENT_NAME_FOUR, COMPONENT_NAME_ONE, COMPONENT_NAME_THREE, COMPONENT_NAME_TWO, COMPONENTS_FIELD_ID, COMPONENTS_FIELD_NAME, CREATE_ATTACHMENT, CREATE_ISSUE, CREATE_ISSUE_OPERATION_SCREEN, CREATE_SHARED_OBJECTS, CURRENT_USER, CUSTOM_FIELD_CASCADING_SELECT_SEARCHER, CUSTOM_FIELD_CHECKBOX_SEARCHER, CUSTOM_FIELD_CONFIGURATION, CUSTOM_FIELD_DATE_RANGE, CUSTOM_FIELD_EXACT_NUMBER, CUSTOM_FIELD_EXACT_TEXT_SEARCHER, CUSTOM_FIELD_GROUP_PICKER_SEARCHER, CUSTOM_FIELD_LABEL_SEARCHER, CUSTOM_FIELD_MULTI_SELECT_SEARCHER, CUSTOM_FIELD_NUMBER_RANGE, CUSTOM_FIELD_PREFIX, CUSTOM_FIELD_PROJECT_SEARCHER, CUSTOM_FIELD_RADIO_SEARCHER, CUSTOM_FIELD_SELECT_SEARCHER, CUSTOM_FIELD_TEXT_SEARCHER, CUSTOM_FIELD_TYPE_CASCADINGSELECT, CUSTOM_FIELD_TYPE_CHECKBOX, CUSTOM_FIELD_TYPE_DATEPICKER, CUSTOM_FIELD_TYPE_DATETIME, CUSTOM_FIELD_TYPE_FLOAT, CUSTOM_FIELD_TYPE_FREETEXT, CUSTOM_FIELD_TYPE_GROUPPICKER, CUSTOM_FIELD_TYPE_LABELS, CUSTOM_FIELD_TYPE_MULTICHECKBOXES, CUSTOM_FIELD_TYPE_MULTIGROUPPICKER, CUSTOM_FIELD_TYPE_MULTISELECT, CUSTOM_FIELD_TYPE_MULTIUSERPICKER, CUSTOM_FIELD_TYPE_PROJECT, CUSTOM_FIELD_TYPE_RADIO, CUSTOM_FIELD_TYPE_READONLYTEXT, CUSTOM_FIELD_TYPE_SELECT, CUSTOM_FIELD_TYPE_TEXTFIELD, CUSTOM_FIELD_TYPE_URL, CUSTOM_FIELD_TYPE_USERPICKER, CUSTOM_FIELD_TYPE_VERSION, CUSTOM_FIELD_USER_PICKER_GROUP_SEARCHER, CUSTOM_FIELD_USER_PICKER_SEARCHER, CUSTOM_FIELD_VERSION_SEARCHER, CUSTOM_SUB_TASK_SUMMARY, CUSTOM_SUB_TASK_TYPE_DESCRIPTION, CUSTOM_SUB_TASK_TYPE_NAME, CZECH_LOCALE_ID, DARK_FEATURE_DISABLE_LANDING_PAGE_REDIRECT_FLAG, DEFAULT_ASSIGNEE_ERROR_MESSAGE, DEFAULT_FIELD_CONFIGURATION, DEFAULT_FIELD_CONFIGURATION_ID, DEFAULT_FIELD_SCREEN_NAME, DEFAULT_ISSUE_TYPE_SCHEME, DEFAULT_ISSUE_TYPE_SCREEN_SCHEME, DEFAULT_OPERATION_SCREEN, DEFAULT_PERM_SCHEME, DEFAULT_PERM_SCHEME_ID, DEFAULT_SCREEN_SCHEME, DEFAULT_TEXT_RENDERER, DELETE_ISSUE, DENMARK_LOCALE_ID, DISABLE_LAZY_LOAD_ACTIVITY_TABS_FLAG, DUE_DATE_FIELD_ID, DUE_DATE_FIELD_NAME, EDIT_ISSUE, EDIT_ISSUE_OPERATION_SCREEN, ENABLE_LEGACY_MODE_SYSTEM_PROPERTY, EVENT_TYPE_ACTIVE_STATUS, EVENT_TYPE_INACTIVE_STATUS, FIELD_ASSIGNEE, FIELD_COMMENT, FIELD_COMPONENTS, FIELD_FIX_VERSIONS, FIELD_OPERATION, FIELD_PRIORITY, FIELD_SCHEME_DESC, FIELD_SCHEME_NAME, FIELD_TABLE_ID, FIELD_VERSIONS, FIELD_WORKFLOW, FIX_VERSIONS_FIELD_ID, FIX_VERSIONS_FIELD_NAME, FORMAT_DAYS, FORMAT_HOURS, FORMAT_PRETTY, FRANCE_LOCALE_ID, FRED_EMAIL, FRED_FULLNAME, FRED_PASSWORD, FRED_USERKEY, FRED_USERNAME, FRENCH_LOCALISED, FS, FUNC_TEST_PLUGIN_KEY, FUNC_TEST_PLUGIN_REST_PATH, FUNCTEST_CUSTOM_FIELD_KEY, FUNCTEST_CUSTOM_FIELD_TYPE_TEXTAREA, GERMAN_LOCALISED, GERMANY_LOCALE_ID, GLOBAL_ADMIN, GROUP_LABEL_ADMIN, GROUP_LABEL_FUNC_TEST, GROUP_LABEL_JIRA_CORE, GROUP_LABEL_MULTI, HSP_ADMIN_PASSWORD, HSP_ADMIN_USERKEY, HSP_ADMIN_USERNAME, HSP_EMAIL, HSP_FULLNAME, HTM, HUNGARY_LOCALE_ID, ISSUE_ALL, ISSUE_BUG, ISSUE_IMAGE_BUG, ISSUE_IMAGE_GENERIC, ISSUE_IMAGE_IMPROVEMENT, ISSUE_IMAGE_NEWFEATURE, ISSUE_IMAGE_SUB_TASK, ISSUE_IMAGE_TASK, ISSUE_IMPROVEMENT, ISSUE_MKY_ONE_KEY, ISSUE_MKY_THREE_KEY, ISSUE_MKY_TWO_KEY, ISSUE_NEWFEATURE, ISSUE_STATUS_CLOSED_ID, ISSUE_STATUS_IN_PROGRESS_ID, ISSUE_STATUS_OPEN_ID, ISSUE_STATUS_REOPENED_ID, ISSUE_STATUS_RESOLVED_ID, ISSUE_TAB_ALL, ISSUE_TAB_CHANGE_HISTORY, ISSUE_TAB_COMMENTS, ISSUE_TAB_WORK_LOG, ISSUE_TASK, ISSUE_TYPE_ALL, ISSUE_TYPE_ALL_SUB_TASK, ISSUE_TYPE_ANY, ISSUE_TYPE_BUG, ISSUE_TYPE_IMPROVEMENT, ISSUE_TYPE_NEWFEATURE, ISSUE_TYPE_SUB_TASK, ISSUE_TYPE_TASK, ISSUETABLE_EDIT_ROW, ISSUETABLE_HEADER_ROW, ISSUETABLE_ID, ITALY_LOCALE_ID, JAPAN_LOCALE_ID, JIRA_ADMIN_GROUP, JIRA_ADMIN_ROLE, JIRA_ADMIN_ROLE_ID, JIRA_DEV_GROUP, JIRA_DEV_ROLE, JIRA_DEV_ROLE_ID, JIRA_FORM_NAME, JIRA_USERS_GROUP, JIRA_USERS_ROLE, JIRA_USERS_ROLE_ID, JIRADEV_EMAIL, JIRADEV_FULLNAME, JIRADEV_PASSWORD, JIRADEV_USERKEY, JIRADEV_USERNAME, KOREA_LOCALE_ID, LABEL_ISSUE_NAVIGATOR, LINK_ASSIGN_ISSUE, LINK_BULK_CHANGE_ALL, LINK_BULK_CHANGE_CURR_PG, LINK_CLONE_ISSUE, LINK_DELETE_ISSUE, LINK_EDIT_ISSUE, LINK_ISSUE, LINK_NEXT_PG, LUCENE_SEARCH_LIMIT, MANAGE_GROUP_FILTER_SUBSCRIPTIONS, MANAGE_WATCHER_LIST, minorPriority, MODIFY_REPORTER, MOON_LOCALE, MOVE_DOWN, MOVE_ISSUE, MOVE_TO_FIRST, MOVE_TO_LAST, MOVE_UP, NETHERLANDS_LOCALE_ID, NORWAY_LOCALE_ID, PERM_SCHEME_DESC, PERM_SCHEME_ID, PERM_SCHEME_NAME, POLAND_LOCALE_ID, PRIORITY_BLOCKER, PRIORITY_CRITICAL, PRIORITY_FIELD_ID, PRIORITY_FIELD_NAME, PRIORITY_IMAGE_BLOCKER, PRIORITY_IMAGE_CRITICAL, PRIORITY_IMAGE_MAJOR, PRIORITY_IMAGE_MINOR, PRIORITY_IMAGE_TRIVIAL, PRIORITY_MAJOR, PRIORITY_MINOR, PRIORITY_TRIVIAL, PROJECT_ADMIN, PROJECT_HOMOSAP, PROJECT_HOMOSAP_ID, PROJECT_HOMOSAP_KEY, PROJECT_MKY_DESCRIPTION_MESSAGE, PROJECT_MKY_KEY_MESSAGE, PROJECT_MKY_TYPE_MESSAGE, PROJECT_MONKEY, PROJECT_MONKEY_ID, PROJECT_MONKEY_KEY, PROJECT_NEO, PROJECT_NEO_KEY, PROJECT_TAB_CHANGE_LOG, PROJECT_TAB_COMPONENTS, PROJECT_TAB_OPEN_ISSUES, PROJECT_TAB_ROAD_MAP, PROJECT_TAB_VERSIONS, PROJECT_TEMPLATE_KEY_PROCESS_MANAGEMENT, PROJECT_TEMPLATE_KEY_PROJECT_MANAGEMENT, PROJECT_TEMPLATE_KEY_TASK_MANAGEMENT, PROJECT_TYPE_BUSINESS, PROJECT_TYPE_SOFTWARE, RADIO_OPERATION_DELETE, RADIO_OPERATION_EDIT, RADIO_OPERATION_MOVE, RADIO_OPERATION_WORKFLOW, REPORTER_FIELD_ID, REPORTER_FIELD_NAME, RESOLUTION_FIELD_ID, RESOLUTION_FIELD_NAME, RESOLVE_FIELD_SCREEN_NAME, RESOLVE_ISSUE, RUSSIA_LOCALE_ID, SCHEDULE_ISSUE, SCREEN_TABLE_NAME_COLUMN_INDEX, SECURITY_LEVEL_FIELD_ID, SECURITY_LEVEL_FIELD_NAME, SECURITY_LEVEL_ONE_DESC, SECURITY_LEVEL_ONE_NAME, SECURITY_LEVEL_THREE_DESC, SECURITY_LEVEL_THREE_NAME, SECURITY_LEVEL_TWO_DESC, SECURITY_LEVEL_TWO_NAME, SECURITY_SCHEME_DESC, SECURITY_SCHEME_NAME, SER_ALLOW_SHARE_WITH_NON_MEMBER, SET_ISSUE_SECURITY, SLOVAKIA_LOCALE_ID, SPAIN_LOCALE_ID, STATUS_IN_PROGRESS, STATUS_NAME, STATUS_OPEN, STATUS_RESOLVED, STEP_CHOOSE_ISSUES, STEP_CHOOSE_OPERATION, STEP_CONFIRMATION, STEP_NAME, STEP_OPERATION_DETAILS, STEP_PREFIX, SUB_TASK_DEFAULT_TYPE, SUB_TASK_SUMMARY, Summary, SWEDEN_LOCALE_ID, SYS_ADMIN_FULLNAME, SYS_ADMIN_PASSWORD, SYS_ADMIN_USERNAME, SYSTEM_ADMINISTER, TEST_FIELD_SCREEN, THEME_SWITCHER, TIME_TRACKING_FIELD_ID, TRANSIION_NAME_APPROVE, TRANSIION_NAME_CLOSE, TRANSIION_NAME_REOPEN, TRANSIION_NAME_RESOLVE, TRANSIION_NAME_START_PROGRESS, TRANSIION_NAME_STOP_PROGRESS, TRANSITION_ID_STATUS_APPROVED_ACTION_REOPEN, TRANSITION_ID_STATUS_CLOSED_ACTION_REOPEN, TRANSITION_ID_STATUS_IN_PROGRESS_ACTION_STOP_PROGRESS, TRANSITION_ID_STATUS_OPEN_ACTION_CLOSE, TRANSITION_ID_STATUS_OPEN_ACTION_RESOLVE, TRANSITION_ID_STATUS_OPEN_ACTION_START_PROGRESS, TRANSITION_ID_STATUS_RESOLVED_ACTION_APPROVE, TRANSITION_ISSUES_PERMISSION, UK_LOCALE_ID, UNKNOWN, UNKNOWN_ID, US_LOCALE_ID, USE, USER_PICKER, VERSION_NAME_FIVE, VERSION_NAME_FOUR, VERSION_NAME_ONE, VERSION_NAME_THREE, VERSION_NAME_TWO, VERSIONS_FIELD_NAME, VIEW_ISSUE_OPERATION_SCREEN, VIEW_VERSION_CONTROL, VIEW_VOTERS_AND_WATCHERS, WIKI_STYLE_RENDERER, WORK_ISSUE, WORKFLOW_ADDED, WORKFLOW_COPIED, WORKFLOW_SCHEME, XSRF_NO_CHECK_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringassertEditLinkHtml(String body) Ensure that the message has a link to edit the subscription.protected static StringassertEditLinkText(String body) Ensure that the message has a link to edit the subscription.protected StringassertHtmlMessageValid(jakarta.mail.internet.MimeMessage message, AbstractSubscriptionEmailTest.FilterConfig config, String from, String to, String userName) Assert that a html subscription has the correct header, start and issue content.protected static voidassertNotEditLink(String body) Ensure that the message does not have a link to edit the subscription.protected static voidassertNotPartialLink(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.protected static StringassertPartialLinkHtml(AbstractSubscriptionEmailTest.FilterConfig filterConfig, String body) Ensure that the passed message has a link to display the full results of the search.protected static StringassertPartialLinkText(AbstractSubscriptionEmailTest.FilterConfig filterConfig, String body) Ensure that the passed message has a link to display the full results of the search.protected StringassertTextMessageValid(jakarta.mail.internet.MimeMessage message, AbstractSubscriptionEmailTest.FilterConfig config, String from, String to, String userName) Assert that a text subscription has the correct header, start and issue content.protected voidSubscribe the current user to a filter and then run it.Methods inherited from class com.atlassian.jira.webtests.EmailBaseFuncTestCase
assertCorrectNumberEmailsSent, assertEmailBodyContains, assertEmailBodyContains, assertEmailBodyContainsLine, assertEmailBodyDoesntContain, assertEmailCcEquals, assertEmailFromEquals, assertEmailHasNumberOfParts, assertEmailReceivedWithBodyContainingLine, assertEmailSent, assertEmailSubjectEquals, assertEmailToEquals, assertEmailToEquals, assertMessageAndType, assertNotMessageAndType, assertRecipientsHaveMessages, assertSendingMailIsEnabled, configureAndStartImapServer, configureAndStartMailServers, configureAndStartSmtpServer, configureAndStartSmtpServer, configureAndStartSmtpServerWithNotify, createMailService, flushMailQueue, flushMailQueueAndWait, flushMailQueueAndWait, flushMailQueueAndWaitForRecipients, getMailBox, getMessagesForRecipient, hasBody, parseEmailAddresses, setupImapService, setupImapService, setupImapService, setupPopService, setupPopService, startMailService, stopMailService, waitForMailMethods inherited from class com.atlassian.jira.functest.framework.BaseJiraFuncTest
getAssertions, getBackdoor, getEnvironmentData, getTester
-
Constructor Details
-
AbstractSubscriptionEmailTest
public AbstractSubscriptionEmailTest()
-
-
Method Details
-
assertTextMessageValid
protected String assertTextMessageValid(jakarta.mail.internet.MimeMessage message, AbstractSubscriptionEmailTest.FilterConfig config, String from, String to, String userName) throws Exception Assert that a text 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.
-
assertHtmlMessageValid
protected String assertHtmlMessageValid(jakarta.mail.internet.MimeMessage message, AbstractSubscriptionEmailTest.FilterConfig config, String from, String to, String userName) throws Exception 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.
-
assertPartialLinkText
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.
-
assertPartialLinkHtml
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.
-
assertNotPartialLink
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.
-
assertEditLinkText
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.
-
assertEditLinkHtml
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.
-
assertNotEditLink
Ensure that the message does not have a link to edit the subscription.- Parameters:
body- the string of the message minus the edit link.
-
subscribeToFilterAndRun
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.
-