32697473bbf632c4349ab0078c74376ddac16d57
[aaf/authz.git] / auth / auth-cmd / src / test / java / org / onap / aaf / auth / cmd / test / JU_DeprecatedCMD.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
23 package org.onap.aaf.auth.cmd.test;
24
25 import static org.junit.Assert.*;
26
27 import org.junit.After;
28 import org.junit.Before;
29 import org.junit.Test;
30 import org.mockito.Mock;
31 import org.mockito.Mockito;
32 import org.onap.aaf.auth.cmd.AAFcli;
33 import org.onap.aaf.auth.cmd.Cmd;
34 import org.onap.aaf.auth.cmd.DeprecatedCMD;
35 import org.onap.aaf.auth.cmd.Param;
36 import org.onap.aaf.auth.cmd.test.JU_Cmd;
37 import org.onap.aaf.cadi.CadiException;
38 import org.onap.aaf.cadi.LocatorException;
39 import org.onap.aaf.misc.env.APIException;
40
41 import static org.mockito.Mockito.*;
42
43 import java.io.IOException;
44 import java.security.GeneralSecurityException;
45
46 import org.junit.Test;
47
48 public class JU_DeprecatedCMD {
49
50     CmdStub cmd;
51     AAFcli cli;
52     
53     private class CmdStub extends Cmd {
54
55         public CmdStub(AAFcli aafcli, String name, Param[] params) {
56             super(aafcli, name, params);
57             // TODO Auto-generated constructor stub
58         }
59
60         @Override
61         protected int _exec(int idx, String... args) throws CadiException, APIException, LocatorException {
62             // TODO Auto-generated method stub
63             return 0;
64         }
65         
66     }
67     
68     @Test
69     public void testExec() throws CadiException, APIException, LocatorException, GeneralSecurityException, IOException {
70         cli = JU_AAFCli.getAAfCli();
71         Param[] param = new Param[] {new Param("name",true)};
72         
73         cmd = new CmdStub(cli,"test", param);
74         DeprecatedCMD deprecatedcmd = new DeprecatedCMD(cmd,"test", "test");
75         deprecatedcmd._exec(0, "test");
76     }
77
78 }