summaryrefslogtreecommitdiffstats
path: root/tools/tools-common/src
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tools-common/src')
-rw-r--r--tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/CliParserTest.java3
-rw-r--r--tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/docs/ExampleAppVersionTest.java5
-rw-r--r--tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java6
3 files changed, 12 insertions, 2 deletions
diff --git a/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/CliParserTest.java b/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/CliParserTest.java
index ab14c66c5..80980bb34 100644
--- a/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/CliParserTest.java
+++ b/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/CliParserTest.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +23,7 @@ package org.onap.policy.apex.tools.common;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.assertNotNull;
import org.apache.commons.cli.Option;
import org.junit.Test;
@@ -42,6 +44,7 @@ public class CliParserTest {
@Test
public void testappVersion() {
final CliParser cli = new CliParser();
+ assertNotNull(cli);
LOGGER.info(cli.getAppVersion());
}
diff --git a/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/docs/ExampleAppVersionTest.java b/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/docs/ExampleAppVersionTest.java
index 2433e3c5c..1dc8d53ef 100644
--- a/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/docs/ExampleAppVersionTest.java
+++ b/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/docs/ExampleAppVersionTest.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,13 +21,14 @@
package org.onap.policy.apex.tools.common.docs;
+import static org.junit.Assert.assertNotNull;
+
////
//// NOTE: This file contains tags for ASCIIDOC
//// DO NOT REMOVE any of those tag lines, e.g.
////// tag::**
////// end::**
////
-
import org.apache.commons.cli.CommandLine;
import org.junit.Test;
import org.onap.policy.apex.tools.common.CliOptions;
@@ -51,6 +53,7 @@ public class ExampleAppVersionTest {
// tag::setupParser[]
final CliParser cli = new CliParser();
cli.addOption(CliOptions.VERSION);
+ assertNotNull(cli.getOptions());
final CommandLine cmd = cli.parseCli(args);
// end::setupParser[]
diff --git a/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java b/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java
index 797c7c1e8..c653cd0b2 100644
--- a/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java
+++ b/tools/tools-common/src/test/java/org/onap/policy/apex/tools/common/docs/ExampleCliParserTest.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +21,8 @@
package org.onap.policy.apex.tools.common.docs;
+import static org.junit.Assert.assertNotNull;
+
////
////NOTE: This file contains tags for ASCIIDOC
////DO NOT REMOVE any of those tag lines, e.g.
@@ -28,7 +31,6 @@ package org.onap.policy.apex.tools.common.docs;
////
////DO NOT auto-refresh imports or organise imports!
////
-
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.HelpFormatter;
import org.junit.Test;
@@ -62,9 +64,11 @@ public class ExampleCliParserTest {
// tag::setCli[]
final CliParser cli = new CliParser();
+ assertNotNull(cli);
cli.addOption(CliOptions.HELP);
cli.addOption(CliOptions.VERSION);
cli.addOption(CliOptions.MODELFILE);
+ assertNotNull(cli.getOptions());
// end::setCli[]
// tag::parseCli[]