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.auth.fs.test;
24 import static org.junit.Assert.*;
25 import static org.onap.aaf.auth.rserv.HttpMethods.GET;
28 import java.io.IOException;
30 import java.util.Properties;
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;
48 @RunWith(MockitoJUnitRunner.class)
49 public class JU_FileServer {
51 AuthzEnv authzEnvMock;
52 AuthzEnv authzEnv = new AuthzEnv();
55 public void setUp() throws APIException, IOException{
59 @SuppressWarnings("static-access")
61 public void testMain() throws Exception{
64 Properties props = new Properties();
65 ClassLoader classLoader = getClass().getClassLoader();
66 File file = new File(classLoader.getResource("FileServer.props").getFile());
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(" "," "," "," "," "," ");