aboutsummaryrefslogtreecommitdiffstats
path: root/models-sim/models-sim-dmaap/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'models-sim/models-sim-dmaap/src/test')
-rw-r--r--models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/parameters/DmaapSimParameterHandlerTest.java5
-rw-r--r--models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/startstop/MainTest.java12
2 files changed, 14 insertions, 3 deletions
diff --git a/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/parameters/DmaapSimParameterHandlerTest.java b/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/parameters/DmaapSimParameterHandlerTest.java
index 8f053d219..ca6712388 100644
--- a/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/parameters/DmaapSimParameterHandlerTest.java
+++ b/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/parameters/DmaapSimParameterHandlerTest.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +25,7 @@ import static org.junit.Assert.assertNotNull;
import org.junit.Before;
import org.junit.Test;
+import org.onap.policy.common.utils.cmd.CommandLineException;
import org.onap.policy.models.sim.dmaap.DmaapSimException;
import org.onap.policy.models.sim.dmaap.parameters.DmaapSimParameterGroup;
import org.onap.policy.models.sim.dmaap.parameters.DmaapSimParameterHandler;
@@ -41,7 +43,7 @@ public class DmaapSimParameterHandlerTest {
}
@Test
- public void testGetParameters() throws DmaapSimException {
+ public void testGetParameters() throws DmaapSimException, CommandLineException {
final DmaapSimCommandLineArguments args = new DmaapSimCommandLineArguments();
args.parse(new String[] {"-c", RESOURCE_DIR + "NormalParameters.json"});
@@ -66,5 +68,4 @@ public class DmaapSimParameterHandlerTest {
assertThatThrownBy(() -> handler.getParameters(args)).isInstanceOf(DmaapSimException.class)
.hasMessageContaining("validation error");
}
-
}
diff --git a/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/startstop/MainTest.java b/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/startstop/MainTest.java
index cceeaf5af..1d6c68a49 100644
--- a/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/startstop/MainTest.java
+++ b/models-sim/models-sim-dmaap/src/test/java/org/onap/policy/sim/dmaap/startstop/MainTest.java
@@ -1,6 +1,7 @@
/*
* ============LICENSE_START=======================================================
- * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property.
+ * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property.
+ * Modifications Copyright (C) 2021 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,7 @@
package org.onap.policy.sim.dmaap.startstop;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
@@ -30,6 +32,7 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.models.sim.dmaap.rest.CommonRestServer;
+import org.onap.policy.models.sim.dmaap.startstop.DmaapSimCommandLineArguments;
import org.onap.policy.models.sim.dmaap.startstop.Main;
import org.onap.policy.sim.dmaap.parameters.CommonTestData;
@@ -102,4 +105,11 @@ public class MainTest extends CommonRestServer {
main = new Main(NormalParameters);
assertNull(main.getParameters());
}
+
+ @Test
+ public void testDmaapSimVersion() {
+ String[] testArgs = {"-v"};
+ DmaapSimCommandLineArguments sutArgs = new DmaapSimCommandLineArguments(testArgs);
+ assertThat(sutArgs.version()).startsWith("ONAP DMaaP simulator Service");
+ }
}