org.onap migration
[vid.git] / vid-app-common / src / test / java / org / onap / fusionapp / service / ProfileServiceTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.fusionapp.service;
22
23 import java.util.List;
24
25 import org.junit.Assert;
26 import org.junit.Test;
27 import org.springframework.beans.factory.annotation.Autowired;
28
29 import org.onap.fusion.core.MockApplicationContextTestSuite;
30 import org.openecomp.portalsdk.core.domain.Profile;
31 import org.openecomp.portalsdk.core.domain.User;
32 import org.openecomp.portalsdk.core.service.ProfileService;
33 import org.openecomp.portalsdk.core.service.UserProfileService;
34
35
36 /**
37  * The Class ProfileServiceTest.
38  */
39
40 public class ProfileServiceTest extends MockApplicationContextTestSuite {
41         
42         /** The service. */
43         @Autowired
44         ProfileService service;
45         
46         /** The user profile service. */
47         @Autowired
48         UserProfileService userProfileService;
49         
50         /**
51          * Test find all.
52          */
53         //@Test
54         public void testFindAll() {
55                 try {
56                 List<Profile> profiles = service.findAll();
57                 Assert.assertTrue(profiles.size() > 0);
58
59                 }
60                 catch (Exception e) {
61                         // TODO: handle exception
62                 }
63         }
64
65         /**
66          * Test find all active.
67          */
68 //      @Test
69         public void testFindAllActive() {
70                                 
71                 List<User> users = userProfileService.findAllActive();
72                 List<User> activeUsers = userProfileService.findAllActive();
73                 Assert.assertTrue(users.size() - activeUsers.size() >= 0);
74         }
75 }