X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fdbcapi.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdbcapi%2Fservice%2FAafPermissionServiceTest.java;fp=src%2Ftest%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdbcapi%2Fservice%2FAafPermissionServiceTest.java;h=716736eb6e7de9bf180529aa3912363c0df842c8;hp=bad66b83974b1461cd2ec28040c6180cc81d6278;hb=392df8b9b82da9a700e1b7368e4d5b03de2a6067;hpb=27a9a302a7d7e1894732535a8eb61f3460637b24 diff --git a/src/test/java/org/onap/dmaap/dbcapi/service/AafPermissionServiceTest.java b/src/test/java/org/onap/dmaap/dbcapi/service/AafPermissionServiceTest.java index bad66b8..716736e 100644 --- a/src/test/java/org/onap/dmaap/dbcapi/service/AafPermissionServiceTest.java +++ b/src/test/java/org/onap/dmaap/dbcapi/service/AafPermissionServiceTest.java @@ -130,32 +130,6 @@ public class AafPermissionServiceTest { assertOkStatus(apiError); } - @Test - @Parameters({"200", "404"}) - public void shouldRevokeActionPermissionForClientRole(int aafServiceReturnedCode) { - DmaapGrant grant = new DmaapGrant(new DmaapPerm(TOPIC_PERM, ":topic." + FQTN, PUB_ACTION), ROLE); - given(mrClient.getClientRole()).willReturn(ROLE); - given(aafService.delGrant(grant)).willReturn(aafServiceReturnedCode); - - ApiError apiError = aafPermissionService.revokeClientPerms(mrClient); - - then(aafService).should().delGrant(grant); - then(mrClient).should().setStatus(VALID); - assertOkStatus(apiError); - } - - @Test - public void shouldReturnErrorStatusWhenPermissionWasNotRevokedFromRole() { - DmaapGrant grant = new DmaapGrant(new DmaapPerm(TOPIC_PERM, ":topic." + FQTN, PUB_ACTION), ROLE); - given(mrClient.getClientRole()).willReturn(ROLE); - given(aafService.delGrant(grant)).willReturn(INTERNAL_SERVER_ERROR); - - ApiError apiError = aafPermissionService.revokeClientPerms(mrClient); - - then(mrClient).should().setStatus(INVALID); - assertErrorStatus(apiError, INTERNAL_SERVER_ERROR); - } - private void assertErrorStatus(ApiError apiError, int code) { assertEquals(code, apiError.getCode()); }