Class TestOptimisedUserSearch

java.lang.Object
com.atlassian.jira.functest.framework.BaseJiraFuncTest
com.atlassian.jira.webtests.ztests.project.security.TestOptimisedUserSearch
Direct Known Subclasses:
TestOptimisedUserSearchInAssignees, TestOptimisedUserSearchInMentions

public abstract class TestOptimisedUserSearch extends BaseJiraFuncTest
  • Field Details

    • USER_ALICE

      protected static final String USER_ALICE
    • USER_BOB

      protected static final String USER_BOB
    • USER_ALBERT

      protected static final String USER_ALBERT
    • USER_ANNA

      protected static final String USER_ANNA
    • PROJECT_KEY

      protected static final String PROJECT_KEY
      See Also:
    • PROJECT_ID

      protected static final long PROJECT_ID
      See Also:
    • permissionSchemesControl

      protected com.atlassian.jira.testkit.client.PermissionSchemesControl permissionSchemesControl
    • watchersClient

      protected com.atlassian.jira.testkit.client.restclient.WatchersClient watchersClient
    • userAnonymizeControl

      protected UserAnonymizeControl userAnonymizeControl
    • issueKey

      protected String issueKey
    • permissionSchemeId

      protected Long permissionSchemeId
    • maxResults

      protected int maxResults
    • MULTI_SELECT_CUSTOM_FIELD

      protected static final String MULTI_SELECT_CUSTOM_FIELD
      See Also:
    • multiSelectCustomFieldId

      protected String multiSelectCustomFieldId
    • multiUserPickerCustomFieldId

      protected String multiUserPickerCustomFieldId
    • logger

      protected static final com.atlassian.jira.testkit.client.log.FuncTestLogger logger
    • name

      public org.junit.rules.TestName name
  • Constructor Details

    • TestOptimisedUserSearch

      public TestOptimisedUserSearch()
  • Method Details

    • setUp

      public void setUp()
    • tearDown

      public void tearDown()
    • printResults

      public static void printResults()
    • issueAlreadyExists

      protected abstract boolean issueAlreadyExists()
    • getUserSearchResults

      protected abstract TestOptimisedUserSearch.UserSearchResults getUserSearchResults()
    • getUserSearchResults

      protected abstract TestOptimisedUserSearch.UserSearchResults getUserSearchResults(String query)
    • getPermission

      protected abstract ProjectPermissionKey getPermission()
    • testSearchPerformanceWithUsers

      public void testSearchPerformanceWithUsers()
    • testSearchPerformanceWithGroup

      public void testSearchPerformanceWithGroup()
    • testSearchPerformanceWithFiveExplicitUsersAndEveryone

      public void testSearchPerformanceWithFiveExplicitUsersAndEveryone()
    • testSearchPerformanceWithApplicationRole

      public void testSearchPerformanceWithApplicationRole()
    • testSearchPerformanceWithProjectRoleUsers

      public void testSearchPerformanceWithProjectRoleUsers()
    • testSearchPerformanceWithProjectRoleGroup

      public void testSearchPerformanceWithProjectRoleGroup()
    • testSearchPerformanceWithProjectLeadUser

      public void testSearchPerformanceWithProjectLeadUser()
    • testSearchPerformanceWithProjectLeadUserButNoPermissions

      public void testSearchPerformanceWithProjectLeadUserButNoPermissions()
    • testSearchPerformanceWithGroupPickerCustomField

      public void testSearchPerformanceWithGroupPickerCustomField()
    • testSearchPerformanceWithMultiGroupPickerCustomFieldId

      public void testSearchPerformanceWithMultiGroupPickerCustomFieldId()
    • testSearchPerformanceWithSelectCustomField

      public void testSearchPerformanceWithSelectCustomField()
    • testSearchPerformanceWithMultiSelectCustomField

      public void testSearchPerformanceWithMultiSelectCustomField()
    • testSearchPerformanceWithMultiSelectCustomFieldHavingSelectedOptionsThatAreNotAGroup

      public void testSearchPerformanceWithMultiSelectCustomFieldHavingSelectedOptionsThatAreNotAGroup()
    • testSearchPerformanceWithUserPickerCustomField

      public void testSearchPerformanceWithUserPickerCustomField()
    • testSearchPerformanceWithMultiUserPickerCustomField

      public void testSearchPerformanceWithMultiUserPickerCustomField()
    • testSearchPerformanceWithGroupThatHasSixNestedGroups

      public void testSearchPerformanceWithGroupThatHasSixNestedGroups()
    • testSearchPerformanceWithGroupThatHasManyGroups

      public void testSearchPerformanceWithGroupThatHasManyGroups()
    • testSearchCorrectnessCaseSensitiveOrder

      public void testSearchCorrectnessCaseSensitiveOrder()
    • testSearchCorrectnessCaseSensitiveOrderWithLimitedQueriesUserPermissions

      public void testSearchCorrectnessCaseSensitiveOrderWithLimitedQueriesUserPermissions()
      We return values ordered case sensitive, but we limit them beforehand case insensitive o_O. So, when we get 5 results, we get admin, Anna, Zuzanna, albert, zachary, but when we get 3 results, we get admin, Anna, albert.
    • testSearchCorrectnessCaseSensitiveOrderUserAndGroupPermissions

      public void testSearchCorrectnessCaseSensitiveOrderUserAndGroupPermissions()
    • testSearchCorrectnessCaseSensitiveOrderWithLimitedQueriesUserAndGroupPermissions

      public void testSearchCorrectnessCaseSensitiveOrderWithLimitedQueriesUserAndGroupPermissions()
    • testSearchCorrectnessDifferentFields

      public void testSearchCorrectnessDifferentFields()
    • testSearchCorrectnessDifferentPartOfDisplayName

      public void testSearchCorrectnessDifferentPartOfDisplayName()
    • testSearchPerformanceWithManyResults

      public void testSearchPerformanceWithManyResults()
    • searchPerformanceWithManyResultsAssertion

      protected abstract void searchPerformanceWithManyResultsAssertion(List<String> firstNJiraUsers, int expectedMentionsCount)
    • testSearchPerformanceWithThreeLetterQuery

      public void testSearchPerformanceWithThreeLetterQuery()
    • testSearchPerformanceWithThreeLetterQueryButAllJiraUsersAllowed

      public void testSearchPerformanceWithThreeLetterQueryButAllJiraUsersAllowed()
      This test shows the greatest regression of the new mentions mechanism. It takes <40ms for the old one and >400ms for the new one. https://bulldog.internal.atlassian.com/browse/UCACHE-71
    • testSearchPerformanceWithGroupAny

      public void testSearchPerformanceWithGroupAny()
    • testSearchPerformanceWithApplicationRoleAnyLoggedInUser

      public void testSearchPerformanceWithApplicationRoleAnyLoggedInUser()
    • testMultiplePermissionsCorrectOrdering

      public void testMultiplePermissionsCorrectOrdering()
    • multiplePermissionsCorrectOrderingAssertion

      protected void multiplePermissionsCorrectOrderingAssertion(String admin, String userAndrzej, String userAnkit, String userAntoni, String userDaria, String userJakub, String userKamil, String userKarol, String userMaciej, String userSzymonG, String userSzymonK)
    • testAnonymizedUserDoesNotAppearInSearch

      public void testAnonymizedUserDoesNotAppearInSearch()
    • testInactiveUserDoesNotAppearInSearch

      public void testInactiveUserDoesNotAppearInSearch()
    • testDeletedUserDoesNotAppearInSearch

      public void testDeletedUserDoesNotAppearInSearch()
    • testUsersFromDeletedGroupDoesNotAppearInSearch

      public void testUsersFromDeletedGroupDoesNotAppearInSearch()
    • testSearchPerformanceWhenIssueIsUnassigned

      public void testSearchPerformanceWhenIssueIsUnassigned()
    • searchPerformanceWhenIssueIsUnassignedAssertion

      protected void searchPerformanceWhenIssueIsUnassignedAssertion()
    • testSearchPerformanceWhenReporterIsNotSet

      public void testSearchPerformanceWhenReporterIsNotSet()
    • searchPerformanceWhenReporterIsNotSetAssertion

      protected void searchPerformanceWhenReporterIsNotSetAssertion()
    • testSearchPerformanceWhenUserPickerCustomFieldHasNoValue

      public void testSearchPerformanceWhenUserPickerCustomFieldHasNoValue()
    • testSearchPerformanceWhenGroupPickerCustomFieldHasNoValue

      public void testSearchPerformanceWhenGroupPickerCustomFieldHasNoValue()
    • testSearchPerformanceAfterAssigneeIsAnonymized

      public void testSearchPerformanceAfterAssigneeIsAnonymized()
    • searchPerformanceAfterAssigneeIsAnonymizedAssertion

      protected void searchPerformanceAfterAssigneeIsAnonymizedAssertion()
    • testSearchPerformanceAfterUserInCustomFieldIsAnonymized

      public void testSearchPerformanceAfterUserInCustomFieldIsAnonymized()
    • testSearchPerformanceAfterReporterIsAnonymized

      public void testSearchPerformanceAfterReporterIsAnonymized()
    • searchPerformanceAfterReporterIsAnonymizedAssertion

      protected void searchPerformanceAfterReporterIsAnonymizedAssertion()
    • testSearchPerformanceForUserWithNoApplicationAccess

      public void testSearchPerformanceForUserWithNoApplicationAccess()
    • testSearchPerformanceWithManyBigGroups

      public void testSearchPerformanceWithManyBigGroups()
    • testSearchPerformanceWithManyUserPermissions

      public void testSearchPerformanceWithManyUserPermissions()
      The following two tests are very slow, hence we don't run them automatically. We must add some issue key, because Jira Metrics build is allergic to ignores without a key.
    • testSearchPerformanceWithManyUserPermissionsWithPrefix

      public void testSearchPerformanceWithManyUserPermissionsWithPrefix()
    • testSearchPerformance

      protected void testSearchPerformance(TestOptimisedUserSearch.TestType testType, org.hamcrest.Matcher expectedUsers)
      Parameters:
      expectedUsers - raw Matcher, because sometimes we need Matchers.contains(org.hamcrest.Matcher<? super E>...), while at other times we need Matchers.hasSize(int).
    • setCustomFieldValue

      protected void setCustomFieldValue(String issueKey, String customFieldType, String customFieldId, String... values)
    • setReporter

      protected void setReporter(String issueKey, String username)
    • setAssignee

      protected void setAssignee(String issueKey, String username)
    • getCfIdAsLong

      protected Long getCfIdAsLong(String cfIdAsString)
    • ldapUser

      protected static String ldapUser(String username)
    • getAverage

      protected static long getAverage(List<Long> values)
    • getMin

      protected static long getMin(List<Long> values)
    • getMax

      protected static long getMax(List<Long> values)
    • getMedian

      protected static long getMedian(List<Long> values)
    • filterOutColdCacheMeasures

      protected static Stream<Long> filterOutColdCacheMeasures(List<Long> value)