Change groupID to match Garrit Project
[aaf/authz.git] / cadi / core / src / test / java / org / onap / aaf / cadi / test / filter / JU_FCGetTest.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.cadi.test.filter;
23
24 import static org.junit.Assert.*;
25 import static org.mockito.Mockito.when;
26
27 import javax.servlet.FilterConfig;
28 import javax.servlet.ServletContext;
29
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;
35
36 public class JU_FCGetTest {
37
38         @Test
39         public void netYetTested() {
40                 //fail("Tests not yet implemented");
41         }
42
43 //      @Mock
44 //      private ServletContext context;
45         
46 //      @Mock
47 //      private FilterConfig config;
48
49 //      @Mock
50 //      private PropAccess access = new PropAccess();
51         
52 //      @Before
53 //      public void setUp() {
54 //              MockitoAnnotations.initMocks(this);
55 //      }
56         
57 //      @Test
58 //      public void testGetStringFromDef() {
59 //              PropAccess access = new PropAccess();
60                 
61 //              FCGet fcGet = new FCGet(access, context, config);
62
63 //              String user = fcGet.get("user", "DefaultUser", true);
64                 
65 //              assertEquals(user, "DefaultUser");
66 //      }
67
68 //      @Test
69 //      public void testGetStringFromContext() {
70 //              PropAccess access = new PropAccess();
71 //              when(context.getInitParameter("user")).thenReturn("ContextUser");
72                 
73 //              FCGet fcGet = new FCGet(access, context, null);
74
75 //              String user = fcGet.get("user", "DefaultUser", true);
76                 
77 //              assertEquals(user,"ContextUser");
78 //      }
79         
80 //      @Test
81 //      public void testGetStringFromFilter() {
82 //              PropAccess access = new PropAccess();
83 //              when(config.getInitParameter("user")).thenReturn("FilterUser");
84                 
85 //              FCGet fcGet = new FCGet(access, null, config);
86
87 //              String user = fcGet.get("user", "DefaultUser", true);
88                 
89 //              assertEquals(user,"FilterUser");
90 //      }
91         
92 //      @Test
93 //      public void testGetStringWithNullContextFilter() {
94                 
95 //              when(access.getProperty("user", "DefaultUser")).thenReturn(null);
96                 
97 //              FCGet fcGet = new FCGet(access, null, null);
98
99 //              String user = fcGet.get("user", "DefaultUser", true);
100                 
101 //              assertEquals(user,"DefaultUser");
102 //      }
103 }