diff options
author | 2017-09-28 17:04:44 +0800 | |
---|---|---|
committer | 2017-09-28 09:16:41 +0000 | |
commit | 687a149af6ff59fba9e614e060a598392b68db6b (patch) | |
tree | 018b99dc2c64ec32e53d6968fa679369a399ce82 /wfenginemgrservice/src/test/java/org/onap/workflow/resources/ToolUtilTest.java | |
parent | ca57c4bc2ce48c52f10bf6ef816492cf044430e0 (diff) |
Add unit test for vfc-nfvo-wfengine
Change-Id: I75acdc20d9aa6ccb650b80d93c675bab7c27dca9
Issue-id: VFC-454
Signed-off-by: Zhaoxing <meng.zhaoxing1@zte.com.cn>
Diffstat (limited to 'wfenginemgrservice/src/test/java/org/onap/workflow/resources/ToolUtilTest.java')
-rw-r--r-- | wfenginemgrservice/src/test/java/org/onap/workflow/resources/ToolUtilTest.java | 58 |
1 files changed, 20 insertions, 38 deletions
diff --git a/wfenginemgrservice/src/test/java/org/onap/workflow/resources/ToolUtilTest.java b/wfenginemgrservice/src/test/java/org/onap/workflow/resources/ToolUtilTest.java index bdc11c1..c479085 100644 --- a/wfenginemgrservice/src/test/java/org/onap/workflow/resources/ToolUtilTest.java +++ b/wfenginemgrservice/src/test/java/org/onap/workflow/resources/ToolUtilTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2016-2017 ZTE Corporation. + * Copyright 2017 ZTE Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,17 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.onap.workflow.resources; -import static org.junit.Assert.assertTrue; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; +import org.junit.Assert; import org.junit.Test; -import org.mockito.InjectMocks; import org.onap.workflow.activitiext.common.ToolUtil; /** @@ -31,38 +25,26 @@ import org.onap.workflow.activitiext.common.ToolUtil; * */ public class ToolUtilTest { + @Test + public void testIsEmptyString() { + Assert.assertEquals(true, ToolUtil.isEmptyString(null)); + Assert.assertEquals(true, ToolUtil.isEmptyString("")); + Assert.assertEquals(false, ToolUtil.isEmptyString("test")); + } - @InjectMocks - private ToolUtil toolUtil; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception {} - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception {} - - @SuppressWarnings("static-access") @Test - public void test() { - toolUtil.isEmptyString(null); + public void testisTrimedEmptyString() { + Assert.assertEquals(true, ToolUtil.isTrimedEmptyString(null)); + Assert.assertEquals(true, ToolUtil.isTrimedEmptyString("")); + Assert.assertEquals(false, ToolUtil.isTrimedEmptyString("test")); } + @Test + public void testisTrimedEmptyArray() { + String[] originArray = new String[1]; + originArray[0] = "122"; + Assert.assertEquals(true, ToolUtil.isTrimedEmptyArray(null)); + Assert.assertEquals(true, ToolUtil.isTrimedEmptyArray(new String[0])); + Assert.assertEquals(false, ToolUtil.isTrimedEmptyArray(originArray)); + } } |