9de907d889e01f4613189f49f5bfd97163ceb123
[aaf/authz.git] / auth / auth-core / src / test / java / org / onap / aaf / auth / common / test / JU_Define.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.auth.common.test;
23
24 import org.junit.Before;
25 import org.junit.Test;
26 import org.junit.runner.RunWith;
27 import org.mockito.Mock;
28 import org.junit.Before;
29 import static org.mockito.Mockito.*;
30 import org.onap.aaf.auth.common.Define;
31 import org.onap.aaf.cadi.Access;
32 import org.onap.aaf.cadi.CadiException;
33 import org.onap.aaf.cadi.config.Config;
34 import org.onap.aaf.misc.env.Env;
35 import static org.junit.Assert.*;
36
37 //import com.att.authz.common.Define;
38 import org.powermock.api.mockito.PowerMockito;
39 import org.powermock.modules.junit4.PowerMockRunner;
40
41 @RunWith(PowerMockRunner.class)
42 public class JU_Define {
43         public static String ROOT_NS="NS.Not.Set";
44         public static String ROOT_COMPANY=ROOT_NS;
45         Access acc;
46         @Mock
47         Env envMock;
48
49
50         @Before
51         public void setUp(){
52                 acc = mock(Access.class);
53         }
54
55         @Test
56         public void testRootNS() {
57                 //Define.ROOT_NS();
58         }
59
60         @Test
61         public void testRootCompany() {
62                 //Define.ROOT_COMPANY();
63         }
64
65         @Test
66         public void testSet() throws CadiException {
67                 when(acc.getProperty(Config.AAF_ROOT_NS,"org.onap.aaf")).thenReturn(".ns_Test");
68                 //when(acc.getProperty(Config.AAF_ROOT_COMPANY,null)).thenReturn("company_Test");
69                 //Define.set(acc);
70         }
71
72         @Test
73         public void testVarReplace() {
74                 Define.varReplace("AAF_NS.");
75                 Define.varReplace("test");
76         }
77 }