AT&T 2.0.19 Code drop, stage 3
[aaf/authz.git] / auth / auth-fs / src / test / java / org / onap / aaf / auth / fs / test / JU_FileServer.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.fs.test;
23
24 import static org.junit.Assert.*;
25 import static org.onap.aaf.auth.rserv.HttpMethods.GET;
26
27 import java.io.File;
28 import java.io.IOException;
29 import java.net.URL;
30 import java.util.Properties;
31
32 import org.junit.Before;
33 import org.junit.Test;
34 import org.junit.runner.RunWith;
35 import org.mockito.InjectMocks;
36 import org.mockito.Matchers;
37 import org.mockito.Mock;
38 import org.mockito.Mockito;
39 import org.mockito.runners.MockitoJUnitRunner;
40 import org.onap.aaf.auth.env.AuthzEnv;
41 import org.onap.aaf.auth.env.AuthzTrans;
42 import org.onap.aaf.auth.fs.*;
43 import org.onap.aaf.auth.rserv.CachingFileAccess;
44 import org.onap.aaf.misc.env.APIException;
45 import org.powermock.api.mockito.PowerMockito;
46 import org.powermock.modules.junit4.PowerMockRunner;
47
48 @RunWith(MockitoJUnitRunner.class)
49 public class JU_FileServer {    
50         @Mock
51         AuthzEnv authzEnvMock;
52         AuthzEnv authzEnv = new AuthzEnv();
53         
54         @Before
55         public void setUp() throws APIException, IOException{
56
57         }
58         
59         @SuppressWarnings("static-access")
60         @Test
61         public void testMain() throws Exception{
62                 
63                 String[] args = null;
64                 Properties props = new Properties();
65                 ClassLoader classLoader = getClass().getClassLoader();
66                 File file = new File(classLoader.getResource("FileServer.props").getFile());
67
68 //PowerMockito.whenNew(Something.class).withArguments(argument).thenReturn(mockSomething);
69                 //                      env.setLog4JNames("log4j.properties","authz","fs","audit","init",null);
70     // PowerMockito.whenNew(AuthzEnv.class).withArguments(props).thenReturn(authzEnvMock);
71    //  PowerMockito.doNothing().when(authzEnvMock.setLog4JNames(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString()));
72   // PowerMockito.when(new AuthzEnv(props)).thenReturn(authzEnvMock);
73                 //PowerMockito.doNothing().when(authzEnv).setLog4JNames(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString());
74         //PowerMockito.doNothing().when(authzEnvMock).setLog4JNames(" "," "," "," "," "," ");
75
76                 AAF_FS.main(args);
77                 //assertTrue(true);
78                 
79         }
80         
81 }