aboutsummaryrefslogtreecommitdiffstats
path: root/tools/model-generator
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2024-06-11 15:49:30 +0100
committeradheli.tavares <adheli.tavares@est.tech>2024-06-17 16:12:00 +0100
commitdd15704b23b3b1e9508a5f615f066ffca46a7101 (patch)
treec3a1158fc288223fcb4173765e71637d844a3501 /tools/model-generator
parente9b746340711ddfccee7ac0f669ace626b1b3d46 (diff)
Convert junit4 to junit5
- tools module Issue-ID: POLICY-5041 Change-Id: I4fddc20e306e82db8af858ff2444f7e40c9e5acd Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'tools/model-generator')
-rw-r--r--tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/KeyInfoGetterTest.java31
-rw-r--r--tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/SchemaUtilsTest.java40
-rw-r--r--tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2CliTest.java32
-rw-r--r--tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2event/Model2EventSchemaTest.java43
-rw-r--r--tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2event/Model2EventTest.java50
5 files changed, 97 insertions, 99 deletions
diff --git a/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/KeyInfoGetterTest.java b/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/KeyInfoGetterTest.java
index e6ecefd12..3ba316f8a 100644
--- a/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/KeyInfoGetterTest.java
+++ b/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/KeyInfoGetterTest.java
@@ -1,29 +1,30 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* 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.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
package org.onap.policy.apex.tools.model.generator;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
import org.onap.policy.apex.model.policymodel.concepts.AxState;
@@ -32,10 +33,10 @@ import org.onap.policy.apex.testsuites.integration.common.model.SampleDomainMode
/**
* Test the Key Info Getter.
*/
-public class KeyInfoGetterTest {
+class KeyInfoGetterTest {
@Test
- public void testKeyInfoGetter() {
+ void testKeyInfoGetter() {
AxPolicyModel sampleModel = new SampleDomainModelFactory().getSamplePolicyModel("JAVASCRIPT");
KeyInfoGetter kiGetter = new KeyInfoGetter(sampleModel);
@@ -50,22 +51,22 @@ public class KeyInfoGetterTest {
assertNull(kiGetter.getDesc(null));
assertNull(kiGetter.getDesc(new AxArtifactKey()));
assertEquals("Generated description for concept referred to by key " + "\"SamplePolicyModelJAVASCRIPT:0.0.1\"",
- kiGetter.getDesc(sampleModel.getKey()));
-
+ kiGetter.getDesc(sampleModel.getKey()));
+
assertNull(kiGetter.getVersion(null));
assertEquals("0.0.1", kiGetter.getVersion(sampleModel.getKey()));
-
+
AxState matchState = sampleModel.getPolicies().get("Policy0").getStateMap().get("Match");
-
+
assertNull(kiGetter.getLName(null));
assertEquals("Match", kiGetter.getLName(matchState.getKey()));
-
+
assertNull(kiGetter.getPName(null));
assertEquals("Policy0", kiGetter.getPName(matchState.getKey()));
-
+
assertNull(kiGetter.getPVersion(null));
assertEquals("0.0.1", kiGetter.getPVersion(matchState.getKey()));
-
+
assertNull(kiGetter.getPlName(null));
assertEquals("NULL", kiGetter.getPlName(matchState.getKey()));
}
diff --git a/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/SchemaUtilsTest.java b/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/SchemaUtilsTest.java
index a195411f3..f4f0997af 100644
--- a/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/SchemaUtilsTest.java
+++ b/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/SchemaUtilsTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020, 2024 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,7 +22,7 @@
package org.onap.policy.apex.tools.model.generator;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -31,8 +31,8 @@ import java.util.List;
import java.util.Map;
import org.apache.avro.Schema;
import org.apache.avro.Schema.Field;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.onap.policy.apex.context.impl.schema.SchemaHelperFactory;
import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
import org.onap.policy.apex.context.parameters.ContextParameterConstants;
@@ -63,10 +63,10 @@ public class SchemaUtilsTest {
/**
* Read the models into strings.
*
- * @throws IOException on model reading errors
+ * @throws IOException on model reading errors
* @throws ApexModelException on model reading exceptions
*/
- @BeforeClass
+ @BeforeAll
public static void readSimpleModel() throws IOException, ApexModelException {
String avroModelString = TextFileUtils.getTextFileAsString("src/test/resources/vpnsla.json");
@@ -75,18 +75,17 @@ public class SchemaUtilsTest {
}
@Test
- public void testSchemaUtilsErrors() {
+ void testSchemaUtilsErrors() {
AxEvent event = avroModel.getEvents().get("CustomerContextEventIn");
+ String modelClassName = "org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas";
assertThatThrownBy(() -> SchemaUtils.getEventSchema(event))
- .hasMessage("Model for org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas"
- + " not found in model service");
+ .hasMessage("Model for " + modelClassName + " not found in model service");
assertThatThrownBy(() -> {
Map<String, Schema> preexistingParamSchemas = new LinkedHashMap<>();
SchemaUtils.getEventParameterSchema(event.getParameterMap().get("links"), preexistingParamSchemas);
- }).hasMessage("Model for org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas"
- + " not found in model service");
+ }).hasMessage("Model for " + modelClassName + " not found in model service");
List<Field> skeletonFields = SchemaUtils.getSkeletonEventSchemaFields();
assertEquals(5, skeletonFields.size());
@@ -95,16 +94,15 @@ public class SchemaUtilsTest {
AxArtifactKey topoNodesKey = new AxArtifactKey("albumTopoNodes", "0.0.1");
assertThatThrownBy(() -> {
AvroSchemaHelper schemaHelper = (AvroSchemaHelper) new SchemaHelperFactory()
- .createSchemaHelper(topoNodesKey, avroCtxtSchema.getKey());
+ .createSchemaHelper(topoNodesKey, avroCtxtSchema.getKey());
Map<String, Schema> schemaMap = new LinkedHashMap<>();
SchemaUtils.processSubSchemas(schemaHelper.getAvroSchema(), schemaMap);
- }).hasMessage("Model for org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas"
- + " not found in model service");
+ }).hasMessage("Model for " + modelClassName + " not found in model service");
}
@Test
- public void testSchemaUtils() throws ApexEventException {
+ void testSchemaUtils() throws ApexEventException {
ParameterService.clear();
final SchemaParameters schemaParameters = new SchemaParameters();
schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
@@ -117,11 +115,11 @@ public class SchemaUtilsTest {
Schema eventSchema = SchemaUtils.getEventSchema(event);
assertEquals("{\"type\":\"record\",\"name\":\"CustomerContextEventIn\"",
- eventSchema.toString().substring(0, 48));
+ eventSchema.toString().substring(0, 48));
Map<String, Schema> preexistingParamSchemas = new LinkedHashMap<>();
Schema epSchema =
- SchemaUtils.getEventParameterSchema(event.getParameterMap().get("links"), preexistingParamSchemas);
+ SchemaUtils.getEventParameterSchema(event.getParameterMap().get("links"), preexistingParamSchemas);
assertEquals("\"string\"", epSchema.toString());
AxContextSchema avroCtxtSchema = avroModel.getSchemas().get("ctxtTopologyNodesDecl");
@@ -131,7 +129,7 @@ public class SchemaUtilsTest {
assertThatThrownBy(() -> {
AvroSchemaHelper schemaHelper = (AvroSchemaHelper) new SchemaHelperFactory()
- .createSchemaHelper(topoNodesKey, avroCtxtSchema.getKey());
+ .createSchemaHelper(topoNodesKey, avroCtxtSchema.getKey());
Map<String, Schema> schemaMap = new LinkedHashMap<>();
SchemaUtils.processSubSchemas(schemaHelper.getAvroSchema(), schemaMap);
@@ -140,20 +138,20 @@ public class SchemaUtilsTest {
schemaParameters.getSchemaHelperParameterMap().put("Avro", new AvroSchemaHelperParameters());
AvroSchemaHelper schemaHelper =
- (AvroSchemaHelper) new SchemaHelperFactory().createSchemaHelper(topoNodesKey, avroCtxtSchema.getKey());
+ (AvroSchemaHelper) new SchemaHelperFactory().createSchemaHelper(topoNodesKey, avroCtxtSchema.getKey());
Map<String, Schema> schemaMap = new LinkedHashMap<>();
SchemaUtils.processSubSchemas(schemaHelper.getAvroSchema(), schemaMap);
eventSchema = SchemaUtils.getEventSchema(event);
assertEquals("{\"type\":\"record\",\"name\":\"CustomerContextEventIn\"",
- eventSchema.toString().substring(0, 48));
+ eventSchema.toString().substring(0, 48));
epSchema = SchemaUtils.getEventParameterSchema(event.getParameterMap().get("links"), preexistingParamSchemas);
assertEquals("\"string\"", epSchema.toString());
AxInputField inField =
- new AxInputField(new AxReferenceKey("FieldParent", "0.0.1", "Field"), avroCtxtSchema.getKey(), false);
+ new AxInputField(new AxReferenceKey("FieldParent", "0.0.1", "Field"), avroCtxtSchema.getKey(), false);
Schema ep2Schema = SchemaUtils.getEventParameterSchema(inField, preexistingParamSchemas);
assertEquals("{\"type\":\"record\",\"name\":\"TopologyNodes\"", ep2Schema.toString().substring(0, 39));
diff --git a/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2CliTest.java b/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2CliTest.java
index b27c16842..41be1d3dd 100644
--- a/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2CliTest.java
+++ b/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2CliTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020,2022 Nordix Foundation.
+ * Modifications Copyright (C) 2020, 2022, 2024 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,27 +24,27 @@ package org.onap.policy.apex.tools.model.generator.model2cli;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* Test the Model2Cli utility.
*/
-public class Model2CliTest {
+class Model2CliTest {
@Test
- public void testModel2Cli() {
+ void testModel2Cli() {
final String[] cliArgs = {"-h"};
assertThatCode(() -> Model2CliMain.main(cliArgs)).doesNotThrowAnyException();
}
@Test
- public void testModel2CliNoOptions() {
+ void testModel2CliNoOptions() {
final String[] cliArgs = new String[] {};
final String outputString = runModel2Cli(cliArgs);
@@ -53,22 +53,22 @@ public class Model2CliTest {
}
@Test
- public void testModel2CliBadOptions() {
+ void testModel2CliBadOptions() {
assertThat(runModel2Cli(new String[] {"-zabbu"})).contains("usage: gen-model2cli");
}
@Test
- public void testModel2CliHelp() {
+ void testModel2CliHelp() {
assertThat(runModel2Cli(new String[] {"-h"})).contains("usage: gen-model2cli");
}
@Test
- public void testModel2CliVersion() {
+ void testModel2CliVersion() {
assertThat(runModel2Cli(new String[] {"-v"})).contains("gen-model2cli").doesNotContain("usage:");
}
@Test
- public void testModel2CliOverwrite() throws IOException {
+ void testModel2CliOverwrite() throws IOException {
File tempFile = File.createTempFile("AvroModel", ".apex");
tempFile.deleteOnExit();
@@ -80,32 +80,32 @@ public class Model2CliTest {
}
@Test
- public void testModel2CliAadm() throws IOException {
+ void testModel2CliAadm() throws IOException {
testModel2CliModel("target/examples/models/AADM", "AADMPolicyModel");
}
@Test
- public void testModel2CliAnomaly() throws IOException {
+ void testModel2CliAnomaly() throws IOException {
testModel2CliModel("target/examples/models/Adaptive", "AnomalyDetectionPolicyModel");
}
@Test
- public void testModel2CliAutoLearn() throws IOException {
+ void testModel2CliAutoLearn() throws IOException {
testModel2CliModel("target/examples/models/Adaptive", "AutoLearnPolicyModel");
}
@Test
- public void testModel2CliJms() throws IOException {
+ void testModel2CliJms() throws IOException {
testModel2CliModel("target/examples/models/JMS", "JMSTestModel");
}
@Test
- public void testModel2CliMfp() throws IOException {
+ void testModel2CliMfp() throws IOException {
testModel2CliModel("target/examples/models/MyFirstPolicy/2", "MyFirstPolicyModel_0.0.1");
}
@Test
- public void testModel2CliSample() throws IOException {
+ void testModel2CliSample() throws IOException {
testModel2CliModel("target/examples/models/SampleDomain", "SamplePolicyModelJAVASCRIPT");
}
diff --git a/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2event/Model2EventSchemaTest.java b/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2event/Model2EventSchemaTest.java
index 9c7eccd0f..9ffbd3ca4 100644
--- a/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2event/Model2EventSchemaTest.java
+++ b/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2event/Model2EventSchemaTest.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,15 +22,15 @@
package org.onap.policy.apex.tools.model.generator.model2event;
import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Arrays;
import org.apache.avro.Schema;
import org.apache.avro.Schema.Field;
import org.apache.avro.Schema.Type;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
import org.onap.policy.apex.context.parameters.ContextParameterConstants;
import org.onap.policy.apex.context.parameters.SchemaParameters;
@@ -42,17 +42,20 @@ import org.stringtemplate.v4.STGroupFile;
/**
* Test the Model2EventSchema.
*/
-public class Model2EventSchemaTest {
+class Model2EventSchemaTest {
String modelFile = "src/test/resources/blankSchema.json";
String type = "stimuli";
- /** The name of the application. */
- public static final String APP_NAME = "gen-model2eventSchema";
/**
- * Set ups parameterService for the test.
+ * The name of the application.
*/
- @BeforeClass
- public static void prepareForTest() {
+ private static final String APP_NAME = "gen-model2eventSchema";
+
+ /**
+ * Set-ups parameterService for the test.
+ */
+ @BeforeAll
+ static void prepareForTest() {
final SchemaParameters schemaParameters = new SchemaParameters();
schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
schemaParameters.getSchemaHelperParameterMap().put("JAVA", new JavaSchemaHelperParameters());
@@ -62,7 +65,7 @@ public class Model2EventSchemaTest {
}
@Test
- public void testEventSchemaBadModelFile() {
+ void testEventSchemaBadModelFile() {
Model2JsonEventSchema app = new Model2JsonEventSchema(modelFile, type, APP_NAME);
assertThatCode(() -> {
int ret = app.runApp();
@@ -72,7 +75,7 @@ public class Model2EventSchemaTest {
}
@Test
- public void testEventSchemaBadType() {
+ void testEventSchemaBadType() {
modelFile = "src/test/resources/SmallModel.json";
type = "default";
Model2JsonEventSchema app = new Model2JsonEventSchema(modelFile, type, APP_NAME);
@@ -83,19 +86,19 @@ public class Model2EventSchemaTest {
}
@Test
- public void testEventSchemaStimuli() throws ApexException {
+ void testEventSchemaStimuli() throws ApexException {
modelFile = "src/test/resources/SmallModel.json";
String[] types = {"stimuli", "response", "internal"};
- for (String type2: types) {
+ for (String type2 : types) {
type = type2;
Model2JsonEventSchema app = new Model2JsonEventSchema(modelFile, type, APP_NAME);
- assertEquals(type, 0, app.runApp());
+ assertEquals(0, app.runApp(), type);
}
}
@Test
- public void testEventSchemaNotSimpleType() {
+ void testEventSchemaNotSimpleType() {
modelFile = "src/test/resources/ExecutionPropertiesRestTestPolicyModel.json";
type = "internal";
Model2JsonEventSchema app = new Model2JsonEventSchema(modelFile, type, APP_NAME);
@@ -103,7 +106,7 @@ public class Model2EventSchemaTest {
Field stringField = new Field("string", Schema.create(Type.STRING), null, null);
Field enumField =
- new Field("enum", Schema.createEnum("my_enum", "doc", null, Arrays.asList("a", "b", "c")), null, null);
+ new Field("enum", Schema.createEnum("my_enum", "doc", null, Arrays.asList("a", "b", "c")), null, null);
Schema schema = Schema.createRecord("my_record", "doc", "mytest", false);
schema.setFields(Arrays.asList(stringField, enumField));
Schema arrayOut = Schema.createArray(schema);
@@ -115,8 +118,8 @@ public class Model2EventSchemaTest {
}).doesNotThrowAnyException();
}
- @AfterClass
- public static void cleanTest() {
+ @AfterAll
+ static void cleanTest() {
ParameterService.deregister(ContextParameterConstants.SCHEMA_GROUP_NAME);
ModelService.clear();
}
diff --git a/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2event/Model2EventTest.java b/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2event/Model2EventTest.java
index c9180607e..93bb6e9e8 100644
--- a/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2event/Model2EventTest.java
+++ b/tools/model-generator/src/test/java/org/onap/policy/apex/tools/model/generator/model2event/Model2EventTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation
+ * Modifications Copyright (C) 2020, 2024 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,31 +24,27 @@ package org.onap.policy.apex.tools.model.generator.model2event;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* Test the Model2Event utility.
*/
-public class Model2EventTest {
+class Model2EventTest {
@Test
- public void testModel2Event() {
- final String[] EventArgs =
- { "-h" };
-
+ void testModel2Event() {
+ final String[] EventArgs = {"-h"};
assertThatCode(() -> Model2EventMain.main(EventArgs)).doesNotThrowAnyException();
-
}
@Test
- public void testModel2EventNoOptions() {
- final String[] EventArgs = new String[]
- {};
+ void testModel2EventNoOptions() {
+ final String[] EventArgs = new String[] {};
final String outputString = runModel2Event(EventArgs);
@@ -56,24 +52,24 @@ public class Model2EventTest {
}
@Test
- public void testModel2EventBadOptions() {
+ void testModel2EventBadOptions() {
assertThat(runModel2Event(new String[] {"-zabbu"})).contains("usage: gen-model2event");
}
@Test
- public void testModel2EventHelp() {
+ void testModel2EventHelp() {
assertThat(runModel2Event(new String[] {"-h"})).contains("usage: gen-model2event");
}
@Test
- public void testModel2EventVersion() {
+ void testModel2EventVersion() {
assertThat(runModel2Event(new String[] {"-v"})).contains("gen-model2event").doesNotContain("usage:");
}
@Test
- public void testModel2EventNoType() {
+ void testModel2EventNoType() {
final String[] EventArgs =
- { "-m", "src/test/resources/models/AvroModel.json" };
+ {"-m", "src/test/resources/models/AvroModel.json"};
final String outputString = runModel2Event(EventArgs);
@@ -81,9 +77,9 @@ public class Model2EventTest {
}
@Test
- public void testModel2EventBadType() {
+ void testModel2EventBadType() {
final String[] EventArgs =
- { "-m", "src/test/resources/models/AvroModel.json", "-t", "Zooby" };
+ {"-m", "src/test/resources/models/AvroModel.json", "-t", "Zooby"};
final String outputString = runModel2Event(EventArgs);
@@ -91,27 +87,27 @@ public class Model2EventTest {
}
@Test
- public void testModel2EventAadm() throws IOException {
+ void testModel2EventAadm() throws IOException {
testModel2EventModel("AADMPolicyModel");
}
@Test
- public void testModel2EventAnomaly() throws IOException {
+ void testModel2EventAnomaly() throws IOException {
testModel2EventModel("AnomalyDetectionPolicyModel");
}
@Test
- public void testModel2EventAutoLearn() throws IOException {
+ void testModel2EventAutoLearn() throws IOException {
testModel2EventModel("AutoLearnPolicyModel");
}
@Test
- public void testModel2EventMfp() throws IOException {
+ void testModel2EventMfp() throws IOException {
testModel2EventModel("MyFirstPolicyModel");
}
@Test
- public void testModel2EventSample() throws IOException {
+ void testModel2EventSample() throws IOException {
testModel2EventModel("SamplePolicyModelJAVASCRIPT");
}
@@ -143,17 +139,17 @@ public class Model2EventTest {
tempFile.deleteOnExit();
final String[] eventArgs0 =
- { "-m", "src/test/resources/models/" + modelName + ".json", "-t", "stimuli" };
+ {"-m", "src/test/resources/models/" + modelName + ".json", "-t", "stimuli"};
final String outputString0 = runModel2Event(eventArgs0);
assertTrue(outputString0.contains("type: stimuli"));
- final String[] eventArgs1 = {"-m", "src/test/resources/models/" + modelName + ".json", "-t", "response" };
+ final String[] eventArgs1 = {"-m", "src/test/resources/models/" + modelName + ".json", "-t", "response"};
final String outputString1 = runModel2Event(eventArgs1);
assertTrue(outputString1.contains("type: response"));
- final String[] eventArgs2 = {"-m", "src/test/resources/models/" + modelName + ".json", "-t", "internal" };
+ final String[] eventArgs2 = {"-m", "src/test/resources/models/" + modelName + ".json", "-t", "internal"};
final String outputString2 = runModel2Event(eventArgs2);
assertTrue(outputString2.contains("type: internal"));