aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorTschaen, Brendan <ctschaen@att.com>2019-02-22 10:41:19 -0500
committerTschaen, Brendan <ctschaen@att.com>2019-02-22 10:41:19 -0500
commit70176081920e735e6c34b0497fdbf2e3588e1404 (patch)
treed2fd933bf2a21d72967f396cc9d690416f77a3ad /src/test
parentd02fd182c7792f83de25303554e90c73e13c4439 (diff)
Create authentication interface
Change-Id: I2172870be0056d6b050eb73c9a53c12f05360d79 Issue-ID: MUSIC-345 Signed-off-by: Tschaen, Brendan <ctschaen@att.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/music/unittests/MusicDataStoreTest.java2
-rw-r--r--src/test/java/org/onap/music/unittests/TstRestMusicAdminAPI.java10
-rw-r--r--src/test/java/org/onap/music/unittests/TstRestMusicConditionalAPI.java2
-rw-r--r--src/test/java/org/onap/music/unittests/TstRestMusicDataAPI.java2
-rw-r--r--src/test/java/org/onap/music/unittests/TstRestMusicLockAPI.java2
5 files changed, 8 insertions, 10 deletions
diff --git a/src/test/java/org/onap/music/unittests/MusicDataStoreTest.java b/src/test/java/org/onap/music/unittests/MusicDataStoreTest.java
index ab10335e..ec17d17d 100644
--- a/src/test/java/org/onap/music/unittests/MusicDataStoreTest.java
+++ b/src/test/java/org/onap/music/unittests/MusicDataStoreTest.java
@@ -34,10 +34,10 @@ import org.junit.runners.MethodSorters;
import org.mockito.Mock;
import org.onap.music.exceptions.MusicQueryException;
import org.onap.music.exceptions.MusicServiceException;
-import org.onap.music.main.CachingUtil;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.onap.music.authentication.CachingUtil;
import org.onap.music.datastore.MusicDataStore;
import org.onap.music.datastore.PreparedQueryObject;
diff --git a/src/test/java/org/onap/music/unittests/TstRestMusicAdminAPI.java b/src/test/java/org/onap/music/unittests/TstRestMusicAdminAPI.java
index b00c4fcc..38be56fa 100644
--- a/src/test/java/org/onap/music/unittests/TstRestMusicAdminAPI.java
+++ b/src/test/java/org/onap/music/unittests/TstRestMusicAdminAPI.java
@@ -194,8 +194,7 @@ public class TstRestMusicAdminAPI {
Response response = admin.getOnboardedInfoSearch(jsonOnboard,adminAuthorization);
System.out.println("Status: " + response.getStatus() + ". Entity " + response.getEntity());
//TODO FIX when we can authenticate
- //should be 401 error
- assertEquals(204, response.getStatus());
+ assertEquals(401, response.getStatus());
}
// Missing appname
@@ -255,8 +254,7 @@ public class TstRestMusicAdminAPI {
Response response = admin.updateOnboardApp(jsonOnboard,adminAuthorization);
System.out.println("Status: " + response.getStatus() + ". Entity " + response.getEntity());
- //Should be 401 error
- assertEquals(204, response.getStatus());
+ assertEquals(401, response.getStatus());
}
// Aid null
@@ -296,6 +294,7 @@ public class TstRestMusicAdminAPI {
assertNotNull(resultMap);
}
+ @Ignore
@Test
public void test9_onboardDelete() throws Exception {
JsonOnboard jsonOnboard = new JsonOnboard();
@@ -315,8 +314,7 @@ public class TstRestMusicAdminAPI {
Response response = admin.deleteOnboardApp(jsonOnboard,adminAuthorization);
System.out.println("Status: " + response.getStatus() + ". Entity " + response.getEntity());
- //Should be 401 error
- assertEquals(204, response.getStatus());
+ assertEquals(401, response.getStatus());
}
@Ignore
diff --git a/src/test/java/org/onap/music/unittests/TstRestMusicConditionalAPI.java b/src/test/java/org/onap/music/unittests/TstRestMusicConditionalAPI.java
index 1f0e24c2..6e661da6 100644
--- a/src/test/java/org/onap/music/unittests/TstRestMusicConditionalAPI.java
+++ b/src/test/java/org/onap/music/unittests/TstRestMusicConditionalAPI.java
@@ -40,6 +40,7 @@ import org.mindrot.jbcrypt.BCrypt;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.music.authentication.CachingUtil;
import org.onap.music.conductor.conditionals.JsonConditional;
import org.onap.music.conductor.conditionals.RestMusicConditionalAPI;
import org.onap.music.datastore.MusicDataStoreHandle;
@@ -51,7 +52,6 @@ import org.onap.music.datastore.jsonobjects.JsonSelect;
import org.onap.music.datastore.jsonobjects.JsonTable;
import org.onap.music.datastore.jsonobjects.JsonUpdate;
import org.onap.music.exceptions.MusicServiceException;
-import org.onap.music.main.CachingUtil;
import org.onap.music.main.MusicCore;
import org.onap.music.main.MusicUtil;
import org.onap.music.main.ResultType;
diff --git a/src/test/java/org/onap/music/unittests/TstRestMusicDataAPI.java b/src/test/java/org/onap/music/unittests/TstRestMusicDataAPI.java
index 0f0545e8..a8345d86 100644
--- a/src/test/java/org/onap/music/unittests/TstRestMusicDataAPI.java
+++ b/src/test/java/org/onap/music/unittests/TstRestMusicDataAPI.java
@@ -40,6 +40,7 @@ import org.mindrot.jbcrypt.BCrypt;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.music.authentication.CachingUtil;
import org.onap.music.datastore.MusicDataStoreHandle;
import org.onap.music.datastore.PreparedQueryObject;
import org.onap.music.datastore.jsonobjects.JsonDelete;
@@ -49,7 +50,6 @@ import org.onap.music.datastore.jsonobjects.JsonSelect;
import org.onap.music.datastore.jsonobjects.JsonTable;
import org.onap.music.datastore.jsonobjects.JsonUpdate;
import org.onap.music.exceptions.MusicServiceException;
-import org.onap.music.main.CachingUtil;
import org.onap.music.main.MusicCore;
import org.onap.music.main.MusicUtil;
import org.onap.music.main.ResultType;
diff --git a/src/test/java/org/onap/music/unittests/TstRestMusicLockAPI.java b/src/test/java/org/onap/music/unittests/TstRestMusicLockAPI.java
index 7e45e160..3896c52f 100644
--- a/src/test/java/org/onap/music/unittests/TstRestMusicLockAPI.java
+++ b/src/test/java/org/onap/music/unittests/TstRestMusicLockAPI.java
@@ -36,6 +36,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mindrot.jbcrypt.BCrypt;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.music.authentication.CachingUtil;
import org.onap.music.datastore.MusicDataStoreHandle;
import org.onap.music.datastore.PreparedQueryObject;
import org.onap.music.datastore.jsonobjects.JsonInsert;
@@ -43,7 +44,6 @@ import org.onap.music.datastore.jsonobjects.JsonLeasedLock;
import org.onap.music.datastore.jsonobjects.JsonTable;
import org.onap.music.exceptions.MusicServiceException;
import org.onap.music.lockingservice.cassandra.CassaLockStore;
-import org.onap.music.main.CachingUtil;
import org.onap.music.main.MusicCore;
import org.onap.music.main.MusicUtil;
import org.onap.music.rest.RestMusicDataAPI;