diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/onap/dmaap/dbcapi/util/PermissionBuilderTest.java | 16 |
1 files changed, 15 insertions, 1 deletions
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)); |