88858e7baa3afa7643d38e80ecf7353b489d82f3
[aaf/authz.git] / authz-fs / src / test / java / org / onap / aaf / authz / fs / JU_FileServer.java
1 /*******************************************************************************\r
2  * ============LICENSE_START====================================================\r
3  * * org.onap.aaf\r
4  * * ===========================================================================\r
5  * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
6  * * ===========================================================================\r
7  * * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * * you may not use this file except in compliance with the License.\r
9  * * You may obtain a copy of the License at\r
10  * * \r
11  *  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * * \r
13  *  * Unless required by applicable law or agreed to in writing, software\r
14  * * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * * See the License for the specific language governing permissions and\r
17  * * limitations under the License.\r
18  * * ============LICENSE_END====================================================\r
19  * *\r
20  * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
21  * *\r
22  ******************************************************************************/\r
23 package org.onap.aaf.authz.fs;\r
24 \r
25 import static org.junit.Assert.*;\r
26 import static org.onap.aaf.cssa.rserv.HttpMethods.GET;\r
27 \r
28 import java.io.File;\r
29 import java.io.IOException;\r
30 import java.net.URL;\r
31 import java.util.Properties;\r
32 \r
33 import org.junit.Before;\r
34 import org.junit.Test;\r
35 import org.junit.runner.RunWith;\r
36 import org.mockito.InjectMocks;\r
37 import org.mockito.Matchers;\r
38 import org.mockito.Mock;\r
39 import org.mockito.Mockito;\r
40 import org.mockito.runners.MockitoJUnitRunner;\r
41 import org.onap.aaf.authz.env.AuthzEnv;\r
42 import org.onap.aaf.authz.env.AuthzTrans;\r
43 import org.onap.aaf.authz.fs.*;\r
44 import org.onap.aaf.cssa.rserv.CachingFileAccess;\r
45 import org.powermock.api.mockito.PowerMockito;\r
46 import org.powermock.modules.junit4.PowerMockRunner;\r
47 \r
48 import org.onap.aaf.inno.env.APIException;\r
49 \r
50 @RunWith(MockitoJUnitRunner.class)\r
51 public class JU_FileServer {    \r
52         @Mock\r
53         AuthzEnv authzEnvMock;\r
54         AuthzEnv authzEnv = new AuthzEnv();\r
55         \r
56         @Before\r
57         public void setUp() throws APIException, IOException{\r
58 \r
59         }\r
60         \r
61         @SuppressWarnings("static-access")\r
62         @Test\r
63         public void testMain() throws Exception{\r
64                 \r
65                 String[] args = null;\r
66                 Properties props = new Properties();\r
67                 ClassLoader classLoader = getClass().getClassLoader();\r
68                 File file = new File(classLoader.getResource("FileServer.props").getFile());\r
69 \r
70 //PowerMockito.whenNew(Something.class).withArguments(argument).thenReturn(mockSomething);\r
71                 //                      env.setLog4JNames("log4j.properties","authz","fs","audit","init",null);\r
72     // PowerMockito.whenNew(AuthzEnv.class).withArguments(props).thenReturn(authzEnvMock);\r
73    //  PowerMockito.doNothing().when(authzEnvMock.setLog4JNames(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString()));\r
74   // PowerMockito.when(new AuthzEnv(props)).thenReturn(authzEnvMock);\r
75                 //PowerMockito.doNothing().when(authzEnv).setLog4JNames(Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString(), Matchers.anyString());\r
76         //PowerMockito.doNothing().when(authzEnvMock).setLog4JNames(" "," "," "," "," "," ");\r
77 \r
78                 FileServer.main(args);\r
79                 //assertTrue(true);\r
80                 \r
81         }\r
82         \r
83 }\r