diff options
author | surya-huawei <a.u.surya@huawei.com> | 2017-09-28 17:59:53 +0530 |
---|---|---|
committer | surya-huawei <a.u.surya@huawei.com> | 2017-09-28 18:01:31 +0530 |
commit | 1cb7623802f69bdf23dd285d67bd662f94d9f2d3 (patch) | |
tree | c19dcfbf3a5d82b926d3f3c8be9bbc914dcd7ae2 /mdsal-resource/provider | |
parent | 2c5d29be34111eb03de70a12429d2a3d3e2ebbc1 (diff) |
Add a unit test for mdsal
*Add a negative unit test case for ConfigResource
This is to check availability of query and
improve sonar code coverage
Issue-Id: CCSDK-106
Change-Id: Ic276d1cfacce3aea7444adcb7bf09d6cdffb294e
Signed-off-by: surya-huawei <a.u.surya@huawei.com>
Diffstat (limited to 'mdsal-resource/provider')
-rw-r--r-- | mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/ConfigResourceTest.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/ConfigResourceTest.java b/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/ConfigResourceTest.java new file mode 100644 index 00000000..f5b0bcf0 --- /dev/null +++ b/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/ConfigResourceTest.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.adaptors.resource.mdsal; + +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; + +import static org.junit.Assert.assertEquals; + +public class ConfigResourceTest { + ConfigResource configResource = new ConfigResource("http", "local", + "10001", "admin", + "password"); + + @Test + public void isAvailableNegativeTest() throws SvcLogicException { + SvcLogicContext ctx = new SvcLogicContext(); + assertEquals(QueryStatus.NOT_FOUND, configResource.isAvailable + ("xyz", "key", "prefix", ctx)); + } +} + |