Upgrade sonar plugin
[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 \r
40 public class ProfileServiceTest extends MockApplicationContextTestSuite {\r
41         \r
42         /** The service. */\r
43         @Autowired\r
44         ProfileService service;\r
45         \r
46         /** The user profile service. */\r
47         @Autowired\r
48         UserProfileService userProfileService;\r
49         \r
50         /**\r
51          * Test find all.\r
52          */\r
53         //@Test\r
54         public void testFindAll() {\r
55                 try {\r
56                 List<Profile> profiles = service.findAll();\r
57                 Assert.assertTrue(profiles.size() > 0);\r
58 \r
59                 }\r
60                 catch (Exception e) {\r
61                         // TODO: handle exception\r
62                 }\r
63         }\r
64 \r
65         /**\r
66          * Test find all active.\r
67          */\r
68 //      @Test\r
69         public void testFindAllActive() {\r
70                                 \r
71                 List<User> users = userProfileService.findAllActive();\r
72                 List<User> activeUsers = userProfileService.findAllActive();\r
73                 Assert.assertTrue(users.size() - activeUsers.size() >= 0);\r
74         }\r
75 }\r