Added additional test in AafUserRoleTest.java
Issue-ID: DMAAP-1098
Change-Id: Ic25143aa1ad7f47e9c513ccee9a52639249d25ad
Signed-off-by: Sudarshan Kumar <sudars19@in.ibm.com>
* ================================================================================
* Copyright (C) 2019 IBM Intellectual Property. All rights reserved.
* ================================================================================
* ================================================================================
* 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
* 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
package org.onap.dmaap.dbcapi.aaf;
package org.onap.dmaap.dbcapi.aaf;
-import org.junit.Test;
-
import static org.hamcrest.CoreMatchers.is;
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 {
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() {
@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
assertThat(role.toJSON(), is(" { \"user\": \"test\", \"role\": \"admin\" }"));
}
}
\ No newline at end of file