diff options
author | 2020-07-14 14:55:47 +0530 | |
---|---|---|
committer | 2020-07-14 19:22:59 +0530 | |
commit | 9a08d687e48312beef47bce357d374ede2ce0dc7 (patch) | |
tree | 3717d377dd4ea90f4e88c28d52bb3c0d5d28f34c /main/src/test | |
parent | 5f23e02caa5ab128a4c01866dec91eaea8dc7cee (diff) |
Code Improvements
Signed-off-by: SravanKumarGunda <sravan.kumar1@huawei.com>
Issue-ID: CLI-270
Change-Id: I3de621dab68f153c16a36102239b095c60abf9ab
Diffstat (limited to 'main/src/test')
-rw-r--r-- | main/src/test/java/org/onap/cli/main/interactive/StringCompleterTest.java | 13 | ||||
-rw-r--r-- | main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java | 4 |
2 files changed, 8 insertions, 9 deletions
diff --git a/main/src/test/java/org/onap/cli/main/interactive/StringCompleterTest.java b/main/src/test/java/org/onap/cli/main/interactive/StringCompleterTest.java index 32f3be8a..853ceb49 100644 --- a/main/src/test/java/org/onap/cli/main/interactive/StringCompleterTest.java +++ b/main/src/test/java/org/onap/cli/main/interactive/StringCompleterTest.java @@ -16,12 +16,11 @@ package org.onap.cli.main.interactive; -import static org.junit.Assert.assertTrue; - import java.util.ArrayList; import java.util.Arrays; import org.junit.Test; +import static org.junit.Assert.assertEquals; public class StringCompleterTest { @@ -29,20 +28,20 @@ public class StringCompleterTest { public void completeTest() { StringCompleter com = new StringCompleter(Arrays.asList(new String[] { "test", "testing1", "testing2" })); int result = com.complete("test", 1, new ArrayList<CharSequence>()); - assertTrue(result == 0); + assertEquals(0, result); result = com.complete(null, 1, new ArrayList<CharSequence>()); - assertTrue(result == 0); + assertEquals(0, result); com.add("test", "testing1", "testing2"); result = com.complete("test", 1, new ArrayList<CharSequence>()); - assertTrue(result == 0); + assertEquals(0, result); result = com.complete("sfds", 1, new ArrayList<CharSequence>()); - assertTrue(result == -1); + assertEquals(-1, result); result = com.complete("test", 1, new ArrayList<CharSequence>()); - assertTrue(result == 0); + assertEquals(0, result); } } diff --git a/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java b/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java index e74981fb..05249898 100644 --- a/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java +++ b/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java @@ -405,7 +405,7 @@ public class OnapCliUtilsTest { paramslist.add(param1); OnapCliArgsParser.populateParams(paramslist, Arrays.asList("--yaml", "name", "--yaml", "test-schema")); - Assert.assertTrue(paramslist.iterator().next().getValue().equals("test-schema")); + Assert.assertEquals("test-schema", paramslist.iterator().next().getValue()); } @Test public void testReadYamlStringFromUrlForFile() throws OnapCommandException { @@ -417,6 +417,6 @@ public class OnapCliUtilsTest { paramslist.add(param1); OnapCliArgsParser.populateParams(paramslist, Arrays.asList("--yaml", "main/src/test/resources/open-cli-schema/sample-test-schema.yaml", "--yaml", "test-schema")); - Assert.assertTrue(paramslist.iterator().next().getValue().equals("test-schema")); + Assert.assertEquals("test-schema", paramslist.iterator().next().getValue()); } }
\ No newline at end of file |