summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorvarun gudisena <varuneshwar.gudisena@att.com>2019-03-21 01:25:44 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-21 01:25:44 +0000
commitc5e7718df9ec94e7ea9a00050caf540f439894f4 (patch)
treec34d16258abad24c492b656dbb75bbea5bf1c176 /src/test
parente88b8ed452eced15f80fa5c7ce2b6b0cd9175ec6 (diff)
parent8aeeb123bd315e6aa03af254c6d414501b3df802 (diff)
Merge "Added additional test in AafUserRoleTest.java"
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/dmaap/dbcapi/aaf/AafUserRoleTest.java31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/test/java/org/onap/dmaap/dbcapi/aaf/AafUserRoleTest.java b/src/test/java/org/onap/dmaap/dbcapi/aaf/AafUserRoleTest.java
index 6328c21..88fff87 100644
--- a/src/test/java/org/onap/dmaap/dbcapi/aaf/AafUserRoleTest.java
+++ b/src/test/java/org/onap/dmaap/dbcapi/aaf/AafUserRoleTest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2019 IBM Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 IBM
+ * ===================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -20,16 +22,37 @@
package org.onap.dmaap.dbcapi.aaf;
-import org.junit.Test;
-
import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Before;
+import org.junit.Test;
public class AafUserRoleTest {
+ AafUserRole aafUserRole;
+
+ @Before
+ public void setUp() {
+ aafUserRole = new AafUserRole("xyz", "admin");
+ }
+
+ @Test
+ public void testGetIdentity() {
+ aafUserRole.setIdentity("xyz");
+ assertEquals("xyz", aafUserRole.getIdentity());
+ }
+
+ @Test
+ public void testGetRole() {
+ aafUserRole.setRole("admin");
+ assertEquals("admin", aafUserRole.getRole());
+ }
+
@Test
public void toJSON() {
- AafUserRole role = new AafUserRole("test","admin");
+ AafUserRole role = new AafUserRole("test", "admin");
assertThat(role.toJSON(), is(" { \"user\": \"test\", \"role\": \"admin\" }"));
}
} \ No newline at end of file