diff options
Diffstat (limited to 'framework/src/test/java/org/onap/cli/fw/conf/OnapCommandConfgTest.java')
-rw-r--r-- | framework/src/test/java/org/onap/cli/fw/conf/OnapCommandConfgTest.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/framework/src/test/java/org/onap/cli/fw/conf/OnapCommandConfgTest.java b/framework/src/test/java/org/onap/cli/fw/conf/OnapCommandConfgTest.java new file mode 100644 index 00000000..e345945b --- /dev/null +++ b/framework/src/test/java/org/onap/cli/fw/conf/OnapCommandConfgTest.java @@ -0,0 +1,44 @@ +/* + * Copyright 2017 Huawei Technologies Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.cli.fw.conf; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.util.Properties; + +public class OnapCommandConfgTest { + + @Test + public void versionTest() { + String str = OnapCommandConfg.getVersion(); + Assert.assertTrue(str != null); + } + + @Test + public void isAuthIgnoredTest() throws IOException { + Properties prps = new Properties(); + prps.load(OnapCommandConfg.class.getClassLoader().getResourceAsStream("onap.properties")); + boolean auth = OnapCommandConfg.isAuthIgnored(); + Assert.assertTrue(auth == Boolean.valueOf(prps.getProperty("cli.ignore_auth"))); + Assert.assertTrue(OnapCommandConfg.isCookiesBasedAuth() == Boolean + .valueOf(prps.getProperty("http.api_key_use_cookies"))); + Assert.assertTrue("X-Auth-Token".equals(OnapCommandConfg.getXAuthTokenName())); + } + +} |