2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.portalapp.service;
23 import java.util.List;
25 import org.junit.Assert;
26 import org.junit.Test;
27 import org.springframework.beans.factory.annotation.Autowired;
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;
37 * The Class ProfileServiceTest.
39 public class ProfileServiceTest extends MockApplicationContextTestSuite {
43 ProfileService service;
45 /** The user profile service. */
47 UserProfileService userProfileService;
53 public void testFindAll() {
55 List<Profile> profiles = service.findAll();
56 Assert.assertTrue(profiles.size() > 0);
60 * Test find all active.
63 public void testFindAllActive() {
65 List<User> users = userProfileService.findAllActive();
66 List<User> activeUsers = userProfileService.findAllActive();
67 Assert.assertTrue(users.size() - activeUsers.size() >= 0);