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.cadi.test.filter;
24 import static org.junit.Assert.*;
25 import static org.mockito.Mockito.when;
27 import javax.servlet.FilterConfig;
28 import javax.servlet.ServletContext;
30 import org.junit.Before;
31 import org.junit.Test;
32 import org.mockito.Mock;
33 import org.mockito.MockitoAnnotations;
34 import org.onap.aaf.cadi.PropAccess;
36 public class JU_FCGetTest {
39 public void netYetTested() {
40 //fail("Tests not yet implemented");
44 // private ServletContext context;
47 // private FilterConfig config;
50 // private PropAccess access = new PropAccess();
53 // public void setUp() {
54 // MockitoAnnotations.initMocks(this);
58 // public void testGetStringFromDef() {
59 // PropAccess access = new PropAccess();
61 // FCGet fcGet = new FCGet(access, context, config);
63 // String user = fcGet.get("user", "DefaultUser", true);
65 // assertEquals(user, "DefaultUser");
69 // public void testGetStringFromContext() {
70 // PropAccess access = new PropAccess();
71 // when(context.getInitParameter("user")).thenReturn("ContextUser");
73 // FCGet fcGet = new FCGet(access, context, null);
75 // String user = fcGet.get("user", "DefaultUser", true);
77 // assertEquals(user,"ContextUser");
81 // public void testGetStringFromFilter() {
82 // PropAccess access = new PropAccess();
83 // when(config.getInitParameter("user")).thenReturn("FilterUser");
85 // FCGet fcGet = new FCGet(access, null, config);
87 // String user = fcGet.get("user", "DefaultUser", true);
89 // assertEquals(user,"FilterUser");
93 // public void testGetStringWithNullContextFilter() {
95 // when(access.getProperty("user", "DefaultUser")).thenReturn(null);
97 // FCGet fcGet = new FCGet(access, null, null);
99 // String user = fcGet.get("user", "DefaultUser", true);
101 // assertEquals(user,"DefaultUser");