Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-3650

unit test of blockAuditorRoleUser in RANGER-2095 commit is meaningless.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0, 2.3.0
    • None
    • admin
    • None

    Description

      The old commit is buggy and meaningless.

      • testBlockAuditorRoleUserThrowsErrorForAuditKeyAdmin
      • testBlockAuditorRoleUserThrowsErrorForAuditUserAdmin
      • testBlockAuditorRoleUserSuccess

      The 3 tests should test behavior of RangerBizUtil::blockAuditorRoleUser.
      But it constructs a mocked RangerBizUtil, and stub blockAuditorRoleUser. The real RangerBizUtil::blockAuditorRoleUser is never being tested.

      These @Mock annotated class members are invalid.

      • currentUserSession
      • vXResponse
      • context
      • contextUtil

      These members are not member of RangerBizUtil, so can not be injected into rangerBizUtil, we should not use it as class member.

       

      New Patch is here https://reviews.apache.org/r/73879/

      Attachments

        Activity

          People

            Unassigned Unassigned
            kirbyzhou kirby zhou
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: