From 715872f016751eb1ba7fb0045a7fc3fc34bf2327 Mon Sep 17 00:00:00 2001 From: pkaras Date: Tue, 14 May 2019 08:39:06 +0200 Subject: Problem in building AAF permission - fix Change-Id: If3c16d950ebe21d4f922b2e8f074e29ded26e9ce Issue-ID: DMAAP-1200 Signed-off-by: piotr.karas --- .../onap/dmaap/dbcapi/util/PermissionBuilderTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/test') diff --git a/src/test/java/org/onap/dmaap/dbcapi/util/PermissionBuilderTest.java b/src/test/java/org/onap/dmaap/dbcapi/util/PermissionBuilderTest.java index 61bb4b6..8db9d2e 100644 --- a/src/test/java/org/onap/dmaap/dbcapi/util/PermissionBuilderTest.java +++ b/src/test/java/org/onap/dmaap/dbcapi/util/PermissionBuilderTest.java @@ -116,7 +116,21 @@ public class PermissionBuilderTest { @Test public void buildPermission_shouldBuildPermissionWithRealInstance() { //given - String path = "/subpath/topics/"; + String path = "/dmaap"; + String method = "GET"; + initPermissionBuilder(path, method, provideRealInstance(DMAAP_NAME)); + + //when + String permission = permissionBuilder.buildPermission(request); + + //then + assertEquals("org.onap.dmaap-bc.api.dmaap|mr|GET", permission); + } + + @Test + public void buildPermission_shouldBuildPermissionWhenUrlContainsId() { + //given + String path = "/topics/topic_id_123"; String method = "GET"; initPermissionBuilder(path, method, provideRealInstance(DMAAP_NAME)); -- cgit 1.2.3-korg