Install tools/libs from doc hub image
[aaf/authz.git] / auth / auth-cmd / src / test / java / org / onap / aaf / auth / cmd / test / mgmt / JU_SessClear.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.auth.cmd.test.mgmt;
23
24 import org.junit.Assert;
25 import org.junit.Before;
26
27 import static org.mockito.Mockito.mock;
28
29 import java.io.Writer;
30 import java.net.HttpURLConnection;
31 import java.net.URI;
32
33 import static org.junit.Assert.assertEquals;
34
35 import org.junit.BeforeClass;
36 import org.junit.Test;
37 import org.junit.runner.RunWith;
38 import org.mockito.runners.MockitoJUnitRunner;
39 import org.onap.aaf.auth.cmd.AAFcli;
40 import org.onap.aaf.auth.cmd.mgmt.Mgmt;
41 import org.onap.aaf.auth.cmd.mgmt.SessClear;
42 import org.onap.aaf.auth.cmd.mgmt.Session;
43 import org.onap.aaf.auth.env.AuthzEnv;
44 import org.onap.aaf.cadi.CadiException;
45 import org.onap.aaf.cadi.Locator;
46 import org.onap.aaf.cadi.LocatorException;
47 import org.onap.aaf.cadi.PropAccess;
48 import org.onap.aaf.cadi.SecuritySetter;
49 import org.onap.aaf.cadi.http.HMangr;
50 import org.onap.aaf.misc.env.APIException;
51
52 @RunWith(MockitoJUnitRunner.class)
53 public class JU_SessClear {
54         
55         private static SessClear sessclr;
56         PropAccess prop;
57         AuthzEnv aEnv;
58         Writer wtr;
59         Locator<URI> loc;
60         HMangr hman;    
61         AAFcli aafcli;
62         
63         @Before
64         public  void setUp() throws LocatorException, APIException {
65                 prop = new PropAccess();
66                 aEnv = new AuthzEnv();
67                 wtr = mock(Writer.class);
68                 loc = mock(Locator.class);
69                 SecuritySetter<HttpURLConnection> secSet = mock(SecuritySetter.class);
70                 hman = new HMangr(aEnv, loc);   
71                 aafcli = new AAFcli(prop, aEnv, wtr, hman, null, secSet);
72                 Mgmt mgmt = new Mgmt(aafcli);
73                 Session sess = new Session(mgmt);
74                 sessclr = new SessClear(sess);
75         }
76         
77 //      @Test
78 //      public void exec() {
79 //              try {
80 //                      assertEquals(sessclr._exec(0, "session clear"), 0);
81 //              } catch (CadiException e) {
82 //                      // TODO Auto-generated catch block
83 //                      e.printStackTrace();
84 //              } catch (APIException e) {
85 //                      // TODO Auto-generated catch block
86 //                      e.printStackTrace();
87 //              } catch (LocatorException e) {
88 //                      // TODO Auto-generated catch block
89 //                      e.printStackTrace();
90 //              }
91 //      }
92         
93         @Test
94         public void testDetailedHelp() {
95                 StringBuilder sb = new StringBuilder();
96                 //sessclr.detailedHelp(0, sb);
97         }
98 }