1 /*******************************************************************************
2 * ============LICENSE_START====================================================
4 * * ===========================================================================
5 * * Copyright © 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 ******************************************************************************/
22 package org.onap.aaf.org.test;
24 import static org.junit.Assert.assertFalse;
25 import static org.junit.Assert.assertNull;
26 import static org.junit.Assert.assertTrue;
28 import org.junit.Before;
29 import org.junit.Test;
30 import org.junit.runner.RunWith;
31 import org.mockito.Mock;
32 import org.mockito.MockitoAnnotations;
33 import org.onap.aaf.auth.env.AuthzTrans;
34 import org.onap.aaf.auth.org.OrganizationException;
35 import org.onap.aaf.auth.org.Organization.Identity;
36 import org.onap.aaf.org.DefaultOrg;
37 import org.onap.aaf.org.DefaultOrgIdentity;
38 import org.onap.aaf.org.Identities.Data;
39 import org.powermock.api.mockito.PowerMockito;
40 import org.powermock.modules.junit4.PowerMockRunner;
42 @RunWith(PowerMockRunner.class)
43 public class JU_DefaultOrgIdentity {
45 private DefaultOrgIdentity defaultOrgIdentity;
46 private DefaultOrgIdentity defaultOrgIdentityMock;
49 AuthzTrans authzTransMock;
54 private DefaultOrg defaultOrgMock;
56 private Data dataMock;
58 private Identity identityMock;
61 public void setUp() throws OrganizationException{
62 MockitoAnnotations.initMocks(this);
63 defaultOrgIdentityMock = PowerMockito.mock(DefaultOrgIdentity.class);
67 public void testEquals(){
69 Boolean res = defaultOrgIdentityMock.equals(b);
70 System.out.println("value of res " +res);
75 public void testIsFound(){
76 defaultOrgIdentityMock.isFound();
77 System.out.println("value of found " +defaultOrgIdentityMock.isFound());
78 assertFalse(defaultOrgIdentityMock.isFound());
82 public void testIsResponsible(){
83 defaultOrgIdentityMock.mayOwn();
84 System.out.println("value of res " +defaultOrgIdentityMock.mayOwn());
85 assertNull(defaultOrgIdentityMock.mayOwn());
89 public void testFullName(){
90 String fullName = defaultOrgIdentityMock.fullName();
91 System.out.println("value of fullname " +fullName);
92 assertTrue(fullName == null);