2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 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 package org.openecomp.policy.xacml.test;
23 import java.io.IOException;
24 import java.util.ArrayList;
25 import java.util.Collections;
26 import java.util.List;
28 import javax.servlet.ServletConfig;
29 import javax.servlet.ServletOutputStream;
30 import javax.servlet.http.HttpServletRequest;
31 import javax.servlet.http.HttpServletResponse;
33 import junit.framework.TestCase;
35 import org.junit.Before;
36 import org.junit.Test;
37 import org.mockito.Mockito;
38 import org.springframework.mock.web.MockHttpServletResponse;
39 import org.springframework.mock.web.MockServletConfig;
41 public class XACMLEngineTest extends TestCase{
43 private List<String> headers = new ArrayList<String>();
45 private HttpServletRequest httpServletRequest;
46 private HttpServletResponse httpServletResponse;
47 private ServletOutputStream mockOutput;
48 private ServletConfig servletConfig;
52 public void setUp() throws IOException {
53 httpServletRequest = Mockito.mock(HttpServletRequest.class);
54 Mockito.when(httpServletRequest.getMethod()).thenReturn("POST");
55 Mockito.when(httpServletRequest.getParameter("groupId")).thenReturn(null);
56 Mockito.when(httpServletRequest.getHeaderNames()).thenReturn(Collections.enumeration(headers));
57 Mockito.when(httpServletRequest.getAttributeNames()).thenReturn(Collections.enumeration(headers));
60 mockOutput = Mockito.mock(ServletOutputStream.class);
62 httpServletResponse = Mockito.mock(MockHttpServletResponse.class);
64 Mockito.when(httpServletResponse.getOutputStream()).thenReturn(mockOutput);
66 servletConfig = Mockito.mock(MockServletConfig.class);
68 Mockito.when(servletConfig.getInitParameterNames()).thenReturn(Collections.enumeration(headers));
75 public void testDummy() throws Exception{
78 } catch (Exception e) {