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 ******************************************************************************/
23 package org.onap.aaf.auth.cmd.test;
25 import static org.junit.Assert.*;
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;
41 import static org.mockito.Mockito.*;
43 import java.io.IOException;
44 import java.security.GeneralSecurityException;
46 import org.junit.Test;
48 public class JU_DeprecatedCMD {
53 private class CmdStub extends Cmd {
55 public CmdStub(AAFcli aafcli, String name, Param[] params) {
56 super(aafcli, name, params);
57 // TODO Auto-generated constructor stub
61 protected int _exec(int idx, String... args) throws CadiException, APIException, LocatorException {
62 // TODO Auto-generated method stub
69 public void testExec() throws CadiException, APIException, LocatorException, GeneralSecurityException, IOException {
70 cli = JU_AAFCli.getAAfCli();
71 Param[] param = new Param[] {new Param("name",true)};
73 cmd = new CmdStub(cli,"test", param);
74 DeprecatedCMD deprecatedcmd = new DeprecatedCMD(cmd,"test", "test");
75 deprecatedcmd._exec(0, "test");