diff options
author | Michael Lando <ml636r@att.com> | 2017-10-22 12:20:09 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-10-22 12:20:09 +0000 |
commit | 2693a68a809586b3809d3b2631d6c7670a732ecc (patch) | |
tree | 59e5f769086de9464b8a7deb3bc614abdc2a0cea /catalog-be | |
parent | a8ca620825a2478f75baf76b4e75e5ccc58f0174 (diff) | |
parent | 00fca27997c4a4a473823c4dc0123c074dac7b50 (diff) |
Merge "remove neo4j classes" into release-1.1.0
Diffstat (limited to 'catalog-be')
-rw-r--r-- | catalog-be/src/test/java/org/openecomp/sdc/be/user/UserAdminManagerTest.java | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/user/UserAdminManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/user/UserAdminManagerTest.java deleted file mode 100644 index 4b01b4fd61..0000000000 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/user/UserAdminManagerTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdc.be.user; - -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.when; - -import org.junit.Before; -import org.mockito.Mockito; -import org.openecomp.sdc.be.dao.api.ActionStatus; -import org.openecomp.sdc.be.dao.api.IUsersDAO; -import org.openecomp.sdc.be.dao.impl.Neo4jUsersDAO; -import org.openecomp.sdc.be.resources.data.UserData; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -import fj.data.Either; - -public class UserAdminManagerTest { - - final IUsersDAO usersDao = Mockito.mock(Neo4jUsersDAO.class); - Gson gson; - - @Before - public void setup() { - Either<UserData, ActionStatus> eitherOk = Either.right(ActionStatus.OK); - gson = new GsonBuilder().setPrettyPrinting().create(); - when(usersDao.getUserData(anyString())).thenReturn(eitherOk); - when(usersDao.saveUserData((UserData) anyObject())).thenReturn(ActionStatus.OK); - when(usersDao.updateUserData((UserData) anyObject())).thenReturn(ActionStatus.OK); - when(usersDao.deleteUserData(anyString())).thenReturn(ActionStatus.OK); - } - - // @Test - // public void testCreateUser() { - // String json = "{\"firstName\": \"James\",\"lastName\": - // \"Brown\",\"userId\": \"jb1234u\",\"email\": - // \"jb1234u@sdc.com\",\"role\": \"ADMIN\"}"; - // UserData user = gson.fromJson(json, UserData.class); - // Either<UserData,ActionStatus> either = - // UserAdminManager.getInstance().createUser(user); - // assertTrue(either.isRight()); - // assertEquals(ActionStatus.OK, either.right().value()); - // } - // - // - // @Test - // public void testCreateUserInvalidEmail() { - // String json = "{\"firstName\": \"James\",\"lastName\": - // \"Brown\",\"userId\": \"jb1234u\",\"email\": \"@sdc.com\",\"role\": - // \"ADMIN\"}"; - // UserData user = gson.fromJson(json, UserData.class); - // Either<UserData,ActionStatus> either = - // UserAdminManager.getInstance().createUser(user); - // assertTrue(either.isRight()); - // assertEquals(ActionStatus.INVALID_EMAIL_ADDRESS, either.right().value()); - // } - // - // @Test - // public void testCreateUserInvalidRole() { - // String json = "{\"firstName\": \"James\",\"lastName\": - // \"Brown\",\"userId\": \"jb1234u\",\"email\": - // \"jb1234u@sdc.com\",\"role\": \"MIN\"}"; - // UserData user = gson.fromJson(json, UserData.class); - // Either<UserData,ActionStatus> either = - // UserAdminManager.getInstance().createUser(user); - // assertTrue(either.isRight()); - // assertEquals(ActionStatus.INVALID_EMAIL_ADDRESS, either.right().value()); - // } - -} |