AT&T 2.0.19 Code drop, stage 3
[aaf/authz.git] / auth / auth-deforg / src / test / java / org / onap / aaf / org / test / JU_DefaultOrgIdentity.java
1 /*******************************************************************************
2  * ============LICENSE_START====================================================
3  * * org.onap.aaf
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
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  ******************************************************************************/
22 package org.onap.aaf.org.test;
23
24 import static org.junit.Assert.assertFalse;
25 import static org.junit.Assert.assertNull;
26 import static org.junit.Assert.assertTrue;
27
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;
41
42 @RunWith(PowerMockRunner.class)
43 public class JU_DefaultOrgIdentity {
44
45         private DefaultOrgIdentity defaultOrgIdentity;
46         private DefaultOrgIdentity defaultOrgIdentityMock;
47         
48         @Mock
49         AuthzTrans authzTransMock;
50         
51         String key="key";
52         
53         @Mock
54         private DefaultOrg defaultOrgMock;
55         @Mock
56         private Data dataMock;
57         @Mock
58         private Identity identityMock;
59         
60         @Before
61         public void setUp() throws OrganizationException{
62                 MockitoAnnotations.initMocks(this);
63                 defaultOrgIdentityMock = PowerMockito.mock(DefaultOrgIdentity.class);
64         }
65         
66         @Test
67         public void testEquals(){
68                 Object b = null;
69                 Boolean res = defaultOrgIdentityMock.equals(b);
70                 System.out.println("value of res " +res);
71         }
72         
73         
74         @Test
75         public void testIsFound(){
76                 defaultOrgIdentityMock.isFound();
77                 System.out.println("value of found " +defaultOrgIdentityMock.isFound());
78                 assertFalse(defaultOrgIdentityMock.isFound());
79         }
80         
81         @Test
82         public void testIsResponsible(){
83                 defaultOrgIdentityMock.mayOwn();
84                 System.out.println("value of res " +defaultOrgIdentityMock.mayOwn());
85                 assertNull(defaultOrgIdentityMock.mayOwn());
86         }
87         
88         @Test
89         public void testFullName(){
90                 String fullName = defaultOrgIdentityMock.fullName();
91                 System.out.println("value of fullname " +fullName);
92                 assertTrue(fullName == null);
93         }
94         
95         
96 }