Update aaf client module
[aaf/authz.git] / authz-cmd / src / test / java / com / att / cmd / JU_AAFCli.java
diff --git a/authz-cmd/src/test/java/com/att/cmd/JU_AAFCli.java b/authz-cmd/src/test/java/com/att/cmd/JU_AAFCli.java
deleted file mode 100644 (file)
index 9cd76a2..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************\r
- * ============LICENSE_START====================================================\r
- * * org.onap.aaf\r
- * * ===========================================================================\r
- * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
- * * ===========================================================================\r
- * * Licensed under the Apache License, Version 2.0 (the "License");\r
- * * you may not use this file except in compliance with the License.\r
- * * You may obtain a copy of the License at\r
- * * \r
- *  *      http://www.apache.org/licenses/LICENSE-2.0\r
- * * \r
- *  * Unless required by applicable law or agreed to in writing, software\r
- * * distributed under the License is distributed on an "AS IS" BASIS,\r
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * * See the License for the specific language governing permissions and\r
- * * limitations under the License.\r
- * * ============LICENSE_END====================================================\r
- * *\r
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
- * *\r
- ******************************************************************************/\r
-package com.att.cmd;\r
-\r
-import static org.junit.Assert.assertTrue;\r
-import static org.mockito.Mockito.mock;\r
-\r
-import java.io.IOException;\r
-import java.io.OutputStreamWriter;\r
-import java.net.HttpURLConnection;\r
-import java.security.GeneralSecurityException;\r
-\r
-import org.junit.BeforeClass;\r
-import org.junit.Test;\r
-import org.junit.runner.RunWith;\r
-import org.mockito.runners.MockitoJUnitRunner;\r
-\r
-import com.att.authz.env.AuthzEnv;\r
-import com.att.cadi.Locator;\r
-import com.att.cadi.LocatorException;\r
-import com.att.cadi.client.PropertyLocator;\r
-import com.att.cadi.config.Config;\r
-import com.att.cadi.config.SecurityInfo;\r
-import com.att.cadi.http.HBasicAuthSS;\r
-import com.att.cadi.http.HMangr;\r
-import com.att.inno.env.APIException;\r
-\r
-@RunWith(MockitoJUnitRunner.class)\r
-public class JU_AAFCli {\r
-       \r
-       private static AAFcli cli;\r
-       private static int TIMEOUT = Integer.parseInt(Config.AAF_CONN_TIMEOUT_DEF);\r
-       \r
-       @BeforeClass\r
-       public static void setUp() throws Exception, Exception {\r
-               cli = getAAfCli();\r
-       }\r
-       \r
-       @Test\r
-       public void eval() throws Exception {\r
-               assertTrue(cli.eval("#startswith"));\r
-       }\r
-       \r
-       @Test\r
-       public void eval_empty() throws Exception{\r
-               assertTrue(cli.eval(""));\r
-       }\r
-       \r
-       @Test\r
-       public void eval_randomString() throws Exception {\r
-               assertTrue(cli.eval("Some random string @#&*& to check complete 100 coverage"));\r
-       }\r
-       \r
-       public static AAFcli getAAfCli() throws APIException, LocatorException, GeneralSecurityException, IOException {\r
-               final AuthzEnv env = new AuthzEnv(System.getProperties());\r
-               String aafUrl = "https://DME2RESOLVE";\r
-               SecurityInfo si = new SecurityInfo(env);\r
-               env.loadToSystemPropsStartsWith("AAF", "DME2");\r
-               Locator loc;\r
-               loc = new PropertyLocator(aafUrl);                                              \r
-               TIMEOUT = Integer.parseInt(env.getProperty(Config.AAF_CONN_TIMEOUT, Config.AAF_CONN_TIMEOUT_DEF));\r
-               HMangr hman = new HMangr(env, loc).readTimeout(TIMEOUT).apiVersion("2.0");\r
-               \r
-               //TODO: Consider requiring a default in properties\r
-               env.setProperty(Config.AAF_DEFAULT_REALM, System.getProperty(Config.AAF_DEFAULT_REALM,Config.getDefaultRealm()));\r
-               HBasicAuthSS ss = mock(HBasicAuthSS.class);\r
-               return new AAFcli(env, new OutputStreamWriter(System.out), hman, si, ss);\r
-       }\r
-}\r