aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap
diff options
context:
space:
mode:
authorpkaras <piotr.karas@nokia.com>2019-06-06 07:28:05 +0200
committerpkaras <piotr.karas@nokia.com>2019-06-07 09:37:40 +0200
commit27a9a302a7d7e1894732535a8eb61f3460637b24 (patch)
treeb3bee3293d925a49762fcc66fbc90dd4ece1347d /src/test/java/org/onap
parent12d3560c7219af8d75ba9bab3b70b283252fe39d (diff)
deleting namespace and permission implementation
Change-Id: If9e3dc12da186cfee42ae0816e39ba868cb82ad5 Issue-ID: DMAAP-1217 Signed-off-by: piotr.karas <piotr.karas@nokia.com>
Diffstat (limited to 'src/test/java/org/onap')
-rw-r--r--src/test/java/org/onap/dmaap/dbcapi/aaf/AafServiceImplTest.java41
-rw-r--r--src/test/java/org/onap/dmaap/dbcapi/service/AafTopicSetupServiceTest.java4
2 files changed, 43 insertions, 2 deletions
diff --git a/src/test/java/org/onap/dmaap/dbcapi/aaf/AafServiceImplTest.java b/src/test/java/org/onap/dmaap/dbcapi/aaf/AafServiceImplTest.java
index fd70a16..69b320a 100644
--- a/src/test/java/org/onap/dmaap/dbcapi/aaf/AafServiceImplTest.java
+++ b/src/test/java/org/onap/dmaap/dbcapi/aaf/AafServiceImplTest.java
@@ -33,6 +33,7 @@ import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.then;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verifyZeroInteractions;
@RunWith(JUnitParamsRunner.class)
@@ -165,4 +166,44 @@ public class AafServiceImplTest {
assertEquals(aafServiceReturnedCode, status);
}
+
+ @Test
+ public void shouldDeletePermission() {
+ DmaapPerm perm = new DmaapPerm("permName", "type", "action");
+
+ int status = aafService.delPerm(perm, false);
+
+ then(aafConnection).should().delAaf(any(AafEmpty.class), eq(AAF_URL + "authz/perm/permName/type/action"));
+ assertEquals(OK, status);
+ }
+
+ @Test
+ public void shouldDeletePermissionWithForce() {
+ DmaapPerm perm = new DmaapPerm("permName", "type", "action");
+
+ int status = aafService.delPerm(perm, true);
+
+ then(aafConnection).should().delAaf(any(AafEmpty.class), eq(AAF_URL + "authz/perm/permName/type/action?force=true"));
+ assertEquals(OK, status);
+ }
+
+ @Test
+ public void shouldDeleteNamespace() {
+ AafNamespace ns = new AafNamespace("nsName", "ident");
+
+ int status = aafService.delNamespace(ns, false);
+
+ then(aafConnection).should().delAaf(any(AafEmpty.class), eq(AAF_URL + "authz/ns/nsName"));
+ assertEquals(OK, status);
+ }
+
+ @Test
+ public void shouldDeleteNamespaceWithForce() {
+ AafNamespace ns = new AafNamespace("nsName", "ident");
+
+ int status = aafService.delNamespace(ns, true);
+
+ then(aafConnection).should().delAaf(any(AafEmpty.class), eq(AAF_URL + "authz/ns/nsName?force=true"));
+ assertEquals(OK, status);
+ }
} \ No newline at end of file
diff --git a/src/test/java/org/onap/dmaap/dbcapi/service/AafTopicSetupServiceTest.java b/src/test/java/org/onap/dmaap/dbcapi/service/AafTopicSetupServiceTest.java
index 1317b97..8fd8c6f 100644
--- a/src/test/java/org/onap/dmaap/dbcapi/service/AafTopicSetupServiceTest.java
+++ b/src/test/java/org/onap/dmaap/dbcapi/service/AafTopicSetupServiceTest.java
@@ -336,7 +336,7 @@ public class AafTopicSetupServiceTest {
}
@Override
- public int delPerm(DmaapPerm perm) {
+ public int delPerm(DmaapPerm perm, boolean force) {
removedPerms.add(perm);
return removePermStatus;
}
@@ -370,7 +370,7 @@ public class AafTopicSetupServiceTest {
}
@Override
- public int delNamespace(AafNamespace namespace) {
+ public int delNamespace(AafNamespace namespace, boolean force) {
this.removedNamespace = namespace;
return removeNamespaceStatus;
}