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