kirby zhou created RANGER-3650:
----------------------------------
Summary: unit test of blockAuditorRoleUser in RANGER-2095 commit
is meaningless.
Key: RANGER-3650
URL: https://issues.apache.org/jira/browse/RANGER-3650
Project: Ranger
Issue Type: Bug
Components: admin
Affects Versions: 3.0.0, 2.3.0
Reporter: kirby zhou
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/
--
This message was sent by Atlassian Jira
(v8.20.1#820001)