Public and Private Locate entries
[aaf/authz.git] / auth / auth-core / src / test / java / org / onap / aaf / auth / server / test / JU_AbsService.java
1 /**
2  * ============LICENSE_START====================================================
3  * org.onap.aaf
4  * ===========================================================================
5  * Copyright (c) 2018 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.auth.server.test;
23
24 import static org.junit.Assert.*;
25
26 import org.junit.After;
27 import org.junit.Before;
28 import org.junit.Test;
29 import org.mockito.Mock;
30 import org.mockito.Mockito;
31 import org.onap.aaf.auth.env.AuthzTrans;
32 import org.onap.aaf.auth.env.AuthzTransFilter;
33 import org.onap.aaf.auth.local.AbsData;
34 import org.onap.aaf.auth.local.DataFile;
35 import org.onap.aaf.auth.local.TextIndex;
36 import org.onap.aaf.auth.server.AbsService;
37 import org.onap.aaf.cadi.Access;
38 import org.onap.aaf.cadi.CadiException;
39 import org.onap.aaf.cadi.LocatorException;
40 import org.onap.aaf.cadi.PropAccess;
41 import org.onap.aaf.cadi.Access.Level;
42 import org.onap.aaf.cadi.config.Config;
43 import org.onap.aaf.cadi.register.Registrant;
44 import org.onap.aaf.misc.env.impl.BasicEnv;
45
46 import junit.framework.Assert;
47
48 import static org.junit.Assert.*;
49 import static org.mockito.Matchers.*;
50 import static org.mockito.Mockito.*;
51
52 import java.io.BufferedWriter;
53 import java.io.ByteArrayOutputStream;
54 import java.io.File;
55 import java.io.FileOutputStream;
56 import java.io.IOException;
57 import java.io.OutputStreamWriter;
58 import java.io.PrintStream;
59 import java.lang.reflect.InvocationTargetException;
60 import java.lang.reflect.Method;
61 import java.security.Principal;
62
63 import javax.servlet.Filter;
64
65 public class JU_AbsService {
66     
67     ByteArrayOutputStream outStream;
68     
69     private class AbsServiceStub extends AbsService {
70
71         public AbsServiceStub(Access access, BasicEnv env) throws CadiException {
72             super(access, env);
73             // TODO Auto-generated constructor stub
74         }
75
76         @Override
77         public Filter[] _filters(Object ... additionalTafLurs) throws CadiException, LocatorException {
78             // TODO Auto-generated method stub
79             return null;
80         }
81
82         @Override
83         public Registrant[] registrants(int port) throws CadiException, LocatorException {
84             // TODO Auto-generated method stub
85             return null;
86         }
87     
88     }
89     
90     @Before
91     public void setUp() {
92         outStream = new ByteArrayOutputStream();
93         System.setOut(new PrintStream(outStream));
94     }
95     
96     @After
97     public void tearDown() {
98         System.setOut(System.out);
99     }
100     
101     @Test
102     public void testStub() throws CadiException {
103         BasicEnv bEnv = new BasicEnv();
104         PropAccess prop = new PropAccess();
105         
106         prop.setProperty(Config.AAF_LOCATOR_NAMES, "te.st");
107         prop.setProperty(Config.AAF_LOCATOR_VERSION, "te.st");
108         prop.setLogLevel(Level.DEBUG);
109         AbsServiceStub absServiceStub = new AbsServiceStub(prop, bEnv);    //Testing other branches requires "fails" due to exception handling, will leave that off for now.
110     }
111     
112 }
113
114
115
116