actually adding the files to the initial commit
[vid.git] / vid / src / test / java / org / openecomp / portalapp / 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.openecomp.portalapp.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.openecomp.portalsdk.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 public class ProfileServiceTest extends MockApplicationContextTestSuite {
40         
41         /** The service. */
42         @Autowired
43         ProfileService service;
44         
45         /** The user profile service. */
46         @Autowired
47         UserProfileService userProfileService;
48         
49         /**
50          * Test find all.
51          */
52         @Test
53         public void testFindAll() {
54                 
55                 List<Profile> profiles = service.findAll();
56                 Assert.assertTrue(profiles.size() > 0);
57         }
58
59         /**
60          * Test find all active.
61          */
62         @Test
63         public void testFindAllActive() {
64                                 
65                 List<User> users = userProfileService.findAllActive();
66                 List<User> activeUsers = userProfileService.findAllActive();
67                 Assert.assertTrue(users.size() - activeUsers.size() >= 0);
68         }
69 }