Skip to content

Commit

Permalink
fix workflow security tests in alerting (#1310) (#1311)
Browse files Browse the repository at this point in the history
Signed-off-by: Subhobrata Dey <sbcd90@gmail.com>
  • Loading branch information
opensearch-trigger-bot[bot] committed Nov 27, 2023
1 parent e5c1e02 commit ddc11d0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ class SecureWorkflowRestApiIT : AlertingRestTestCase() {
assertEquals("Get workflow failed", RestStatus.FORBIDDEN.status, e.response.statusLine.statusCode)
} finally {
deleteRoleAndRoleMapping(TEST_HR_ROLE)
deleteRoleMapping(ALERTING_FULL_ACCESS_ROLE)
deleteUser(getUser)
getUserClient?.close()
}
Expand Down Expand Up @@ -444,6 +445,7 @@ class SecureWorkflowRestApiIT : AlertingRestTestCase() {
} catch (e: ResponseException) {
assertEquals("Create workflow failed", RestStatus.FORBIDDEN.status, e.response.statusLine.statusCode)
} finally {
deleteRoleMapping(ALERTING_FULL_ACCESS_ROLE)
deleteUser(userWithDifferentRole)
userWithDifferentRoleClient?.close()
}
Expand Down Expand Up @@ -1101,6 +1103,7 @@ class SecureWorkflowRestApiIT : AlertingRestTestCase() {
assertEquals("Delete workflow failed", RestStatus.OK, response?.restStatus())
} finally {
deleteRoleAndRoleMapping(TEST_HR_ROLE)
deleteRoleMapping(ALERTING_FULL_ACCESS_ROLE)
deleteUser(deleteUser)
deleteUserClient?.close()
}
Expand Down

0 comments on commit ddc11d0

Please sign in to comment.