summaryrefslogtreecommitdiffstats
path: root/models-sim/policy-models-simulators/src
diff options
context:
space:
mode:
Diffstat (limited to 'models-sim/policy-models-simulators/src')
-rw-r--r--models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java12
-rw-r--r--models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java2
2 files changed, 7 insertions, 7 deletions
diff --git a/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java b/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java
index f82423c11..4c299914b 100644
--- a/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java
+++ b/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -165,7 +165,7 @@ public class Main extends ServiceManagerContainer {
private SimulatorParameters readParameters(String paramFile) {
try {
- String paramsJson = getResourceAsString(paramFile);
+ var paramsJson = getResourceAsString(paramFile);
if (paramsJson == null) {
throw new IllegalArgumentException(new FileNotFoundException(paramFile));
}
@@ -183,14 +183,14 @@ public class Main extends ServiceManagerContainer {
}
private DmaapSimProvider buildDmaapProvider(DmaapSimParameterGroup params) {
- DmaapSimProvider prov = new DmaapSimProvider(params);
+ var prov = new DmaapSimProvider(params);
DmaapSimProvider.setInstance(prov);
prov.start();
return prov;
}
private CdsSimulator buildCdsSimulator(CdsServerParameters params) throws IOException {
- CdsSimulator cdsSimulator = new CdsSimulator(params.getHost(), params.getPort(), params.getResourceLocation(),
+ var cdsSimulator = new CdsSimulator(params.getHost(), params.getPort(), params.getResourceLocation(),
params.getSuccessRepeatCount(), params.getRequestedResponseDelayMs());
cdsSimulator.start();
return cdsSimulator;
@@ -211,7 +211,7 @@ public class Main extends ServiceManagerContainer {
private HttpServletServer buildRestServer(String dmaapName, ClassRestServerParameters params) {
try {
- Properties props = getServerProperties(dmaapName, params);
+ var props = getServerProperties(dmaapName, params);
HttpServletServer testServer = makeServer(props);
testServer.waitedStart(5000);
@@ -263,7 +263,7 @@ public class Main extends ServiceManagerContainer {
* @return a set of properties representing the given parameters
*/
private static Properties getServerProperties(String dmaapName, ClassRestServerParameters params) {
- final Properties props = new Properties();
+ final var props = new Properties();
props.setProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES, params.getName());
final String svcpfx = PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + params.getName();
diff --git a/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java b/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java
index 491585e9c..28c4f42d2 100644
--- a/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java
+++ b/models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java
@@ -80,7 +80,7 @@ public class SimulatorParameters {
if (dmaapProvider != null) {
// do not want full validation of the provider, so validate the relevant
// fields ourselves
- BeanValidationResult subResult = new BeanValidationResult("dmaapProvider", dmaapProvider);
+ var subResult = new BeanValidationResult("dmaapProvider", dmaapProvider);
subResult.validateNotNull("name", dmaapProvider.getName());
if (dmaapProvider.getTopicSweepSec() < 1) {
subResult.addResult("topicSweepSec", dmaapProvider.getTopicSweepSec(),