From 35840d835f581c2d61de1c57fe9963e36eb15c9f Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 25 Feb 2020 16:10:08 +0000 Subject: Fix Java 11/Checkstyle/Sonar warnings A number of Java 11, checkstyle, and SONAR warnings have crept into the Apex codebase over the last number of reviews. This change fixes those issues. Issue-ID: POLICY-1913 Change-Id: I2afd607e80f48323355380fb2fe5e048e18879f9 Signed-off-by: liamfallon --- .../engine/event/impl/EventConsumerFactory.java | 18 +++--- .../engine/event/impl/EventProducerFactory.java | 18 +++--- .../engine/event/impl/EventProtocolFactory.java | 20 +++--- .../service/engine/runtime/impl/EngineWorker.java | 73 +++++++++++----------- .../CarrierTechnologyParametersJsonAdapter.java | 25 ++++---- .../RestPluginCarrierTechnologyParameters.java | 42 ++++--------- .../EventProtocolParametersJsonAdapter.java | 18 +++--- .../engine/parameters/ApexParametersTest.java | 35 +++++------ .../engine/parameters/ContextParameterTests.java | 6 +- .../engine/parameters/ExecutorParameterTests.java | 21 ++++--- .../service/engine/parameters/ParameterTests.java | 18 +++--- .../engine/parameters/SyncParameterTests.java | 30 ++++----- 12 files changed, 153 insertions(+), 171 deletions(-) (limited to 'services') diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventConsumerFactory.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventConsumerFactory.java index 30a44e024..2f6922a2b 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventConsumerFactory.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventConsumerFactory.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-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. @@ -46,7 +46,7 @@ public class EventConsumerFactory { * @throws ApexEventException on errors creating the Apex event consumer */ public ApexEventConsumer createConsumer(final String name, final EventHandlerParameters consumerParameters) - throws ApexEventException { + throws ApexEventException { // Get the carrier technology parameters final CarrierTechnologyParameters technologyParameters = consumerParameters.getCarrierTechnologyParameters(); @@ -54,11 +54,11 @@ public class EventConsumerFactory { final String consumerPluginClass = technologyParameters.getEventConsumerPluginClass(); Object consumerPluginObject = null; try { - consumerPluginObject = Class.forName(consumerPluginClass).newInstance(); - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { + consumerPluginObject = Class.forName(consumerPluginClass).getDeclaredConstructor().newInstance(); + } catch (final Exception e) { final String errorMessage = "could not create an Apex event consumer for \"" + name - + "\" for the carrier technology \"" + technologyParameters.getLabel() - + "\", specified event consumer plugin class \"" + consumerPluginClass + "\" not found"; + + "\" for the carrier technology \"" + technologyParameters.getLabel() + + "\", specified event consumer plugin class \"" + consumerPluginClass + "\" not found"; LOGGER.error(errorMessage, e); throw new ApexEventException(errorMessage, e); } @@ -66,9 +66,9 @@ public class EventConsumerFactory { // Check the class is an event consumer if (!(consumerPluginObject instanceof ApexEventConsumer)) { final String errorMessage = "could not create an Apex event consumer \"" + name - + "\" for the carrier technology \"" + technologyParameters.getLabel() - + "\", specified event consumer plugin class \"" + consumerPluginClass - + "\" is not an instance of \"" + ApexEventConsumer.class.getName() + "\""; + + "\" for the carrier technology \"" + technologyParameters.getLabel() + + "\", specified event consumer plugin class \"" + consumerPluginClass + + "\" is not an instance of \"" + ApexEventConsumer.class.getName() + "\""; LOGGER.error(errorMessage); throw new ApexEventException(errorMessage); } diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventProducerFactory.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventProducerFactory.java index 349a6e38f..e87e2fd78 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventProducerFactory.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventProducerFactory.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-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. @@ -46,7 +46,7 @@ public class EventProducerFactory { * @throws ApexEventException on errors creating the Apex event producer */ public ApexEventProducer createProducer(final String name, final EventHandlerParameters producerParameters) - throws ApexEventException { + throws ApexEventException { // Get the carrier technology parameters final CarrierTechnologyParameters technologyParameters = producerParameters.getCarrierTechnologyParameters(); @@ -54,11 +54,11 @@ public class EventProducerFactory { final String producerPluginClass = technologyParameters.getEventProducerPluginClass(); Object producerPluginObject = null; try { - producerPluginObject = Class.forName(producerPluginClass).newInstance(); - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { + producerPluginObject = Class.forName(producerPluginClass).getDeclaredConstructor().newInstance(); + } catch (final Exception e) { final String errorMessage = "could not create an Apex event producer for Producer \"" + name - + "\" for the carrier technology \"" + technologyParameters.getLabel() - + "\", specified event producer plugin class \"" + producerPluginClass + "\" not found"; + + "\" for the carrier technology \"" + technologyParameters.getLabel() + + "\", specified event producer plugin class \"" + producerPluginClass + "\" not found"; LOGGER.error(errorMessage, e); throw new ApexEventException(errorMessage, e); } @@ -66,9 +66,9 @@ public class EventProducerFactory { // Check the class is an event producer if (!(producerPluginObject instanceof ApexEventProducer)) { final String errorMessage = "could not create an Apex event producer for Producer \"" + name - + "\" for the carrier technology \"" + technologyParameters.getLabel() - + "\", specified event producer plugin class \"" + producerPluginClass - + "\" is not an instance of \"" + ApexEventProducer.class.getName() + "\""; + + "\" for the carrier technology \"" + technologyParameters.getLabel() + + "\", specified event producer plugin class \"" + producerPluginClass + + "\" is not an instance of \"" + ApexEventProducer.class.getName() + "\""; LOGGER.error(errorMessage); throw new ApexEventException(errorMessage); } diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventProtocolFactory.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventProtocolFactory.java index b2a6f4754..bb353899a 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventProtocolFactory.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/EventProtocolFactory.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-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. @@ -46,17 +46,17 @@ public class EventProtocolFactory { * @return The event converter for converting events to and from Apex format */ public ApexEventProtocolConverter createConverter(final String name, - final EventProtocolParameters eventProtocolParameters) { + final EventProtocolParameters eventProtocolParameters) { // Get the class for the event protocol plugin using reflection final String eventProtocolPluginClass = eventProtocolParameters.getEventProtocolPluginClass(); Object eventProtocolPluginObject = null; try { - eventProtocolPluginObject = Class.forName(eventProtocolPluginClass).newInstance(); - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { + eventProtocolPluginObject = Class.forName(eventProtocolPluginClass).getDeclaredConstructor().newInstance(); + } catch (final Exception e) { final String errorMessage = "could not create an Apex event protocol converter for \"" + name - + "\" for the protocol \"" + eventProtocolParameters.getLabel() - + "\", specified event protocol converter plugin class \"" + eventProtocolPluginClass - + "\" not found"; + + "\" for the protocol \"" + eventProtocolParameters.getLabel() + + "\", specified event protocol converter plugin class \"" + eventProtocolPluginClass + + "\" not found"; LOGGER.error(errorMessage, e); throw new ApexEventRuntimeException(errorMessage, e); } @@ -64,9 +64,9 @@ public class EventProtocolFactory { // Check the class is an event consumer if (!(eventProtocolPluginObject instanceof ApexEventProtocolConverter)) { final String errorMessage = "could not create an Apex event protocol converter for \"" + name - + "\" for the protocol \"" + eventProtocolParameters.getLabel() - + "\", specified event protocol converter plugin class \"" + eventProtocolPluginClass - + "\" is not an instance of \"" + ApexEventProtocolConverter.class.getName() + "\""; + + "\" for the protocol \"" + eventProtocolParameters.getLabel() + + "\", specified event protocol converter plugin class \"" + eventProtocolPluginClass + + "\" is not an instance of \"" + ApexEventProtocolConverter.class.getName() + "\""; LOGGER.error(errorMessage); throw new ApexEventRuntimeException(errorMessage); } diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java index 5b5c7f49b..4da605dbc 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java @@ -25,6 +25,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonParser; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.ArrayList; @@ -34,7 +35,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.BlockingQueue; + import lombok.Setter; + import org.onap.policy.apex.context.ContextException; import org.onap.policy.apex.context.ContextRuntimeException; import org.onap.policy.apex.context.SchemaHelper; @@ -113,7 +116,7 @@ final class EngineWorker implements EngineService { * @throws ApexException thrown on errors on worker instantiation */ protected EngineWorker(final AxArtifactKey engineWorkerKey, final BlockingQueue queue, - final ApplicationThreadFactory threadFactory) { + final ApplicationThreadFactory threadFactory) { LOGGER.entry(engineWorkerKey); this.engineWorkerKey = engineWorkerKey; @@ -153,7 +156,7 @@ final class EngineWorker implements EngineService { @Override public EngineServiceEventInterface getEngineServiceEventInterface() { throw new UnsupportedOperationException( - "getEngineServiceEventInterface() call is not allowed on an Apex Engine Worker"); + "getEngineServiceEventInterface() call is not allowed on an Apex Engine Worker"); } /** @@ -189,7 +192,7 @@ final class EngineWorker implements EngineService { */ @Override public void updateModel(final AxArtifactKey engineKey, final String engineModel, final boolean forceFlag) - throws ApexException { + throws ApexException { LOGGER.entry(engineKey); // Read the Apex model into memory using the Apex Model Reader @@ -198,7 +201,6 @@ final class EngineWorker implements EngineService { final ApexModelReader modelReader = new ApexModelReader<>(AxPolicyModel.class); apexPolicyModel = modelReader.read(new ByteArrayInputStream(engineModel.getBytes())); } catch (final ApexModelException e) { - LOGGER.error("failed to unmarshal the apex model on engine " + engineKey.getId(), e); throw new ApexException("failed to unmarshal the apex model on engine " + engineKey.getId(), e); } @@ -213,14 +215,13 @@ final class EngineWorker implements EngineService { */ @Override public void updateModel(final AxArtifactKey engineKey, final AxPolicyModel apexModel, final boolean forceFlag) - throws ApexException { + throws ApexException { LOGGER.entry(engineKey); // Check if the key on the update request is correct if (!engineWorkerKey.equals(engineKey)) { - String message = ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() - + ENGINE_SUFFIX; - LOGGER.warn(message); + String message = + ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + ENGINE_SUFFIX; throw new ApexException(message); } @@ -230,14 +231,15 @@ final class EngineWorker implements EngineService { final AxPolicyModel currentModel = ModelService.getModel(AxPolicyModel.class); if (!currentModel.getKey().isCompatible(apexModel.getKey())) { if (forceFlag) { - LOGGER.warn("apex model update forced, supplied model with key \"" + apexModel.getKey().getId() - + "\" is not a compatible model update from the existing engine model with key \"" - + currentModel.getKey().getId() + "\""); + LOGGER.warn( + "apex model update forced, supplied model with key \"{}\" is not a compatible model update " + + "from the existing engine model with key \"{}\"", + apexModel.getKey().getId(), currentModel.getKey().getId()); } else { throw new ContextException( - "apex model update failed, supplied model with key \"" + apexModel.getKey().getId() - + "\" is not a compatible model update from the existing engine model with key \"" - + currentModel.getKey().getId() + "\""); + "apex model update failed, supplied model with key \"" + apexModel.getKey().getId() + + "\" is not a compatible model update from the existing engine model with key \"" + + currentModel.getKey().getId() + "\""); } } } @@ -273,16 +275,14 @@ final class EngineWorker implements EngineService { // Check if the key on the start request is correct if (!engineWorkerKey.equals(engineKey)) { - LOGGER.warn( - ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + ENGINE_SUFFIX); - throw new ApexException( - ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + ENGINE_SUFFIX); + throw new ApexException(ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + + ENGINE_SUFFIX); } // Starts the event processing thread that handles incoming events if (processorThread != null && processorThread.isAlive()) { - String message = ENGINE_FOR_KEY_PREFIX + engineWorkerKey.getId() + " is already running with state " - + getState(); + String message = + ENGINE_FOR_KEY_PREFIX + engineWorkerKey.getId() + " is already running with state " + getState(); LOGGER.error(message); throw new ApexException(message); } @@ -312,18 +312,18 @@ final class EngineWorker implements EngineService { public void stop(final AxArtifactKey engineKey) throws ApexException { // Check if the key on the start request is correct if (!engineWorkerKey.equals(engineKey)) { - LOGGER.warn( - ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + ENGINE_SUFFIX); - throw new ApexException( - ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + ENGINE_SUFFIX); + LOGGER.warn(ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + + ENGINE_SUFFIX); + throw new ApexException(ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + + ENGINE_SUFFIX); } // Interrupt the worker to stop its thread if (processorThread == null || !processorThread.isAlive()) { processorThread = null; - LOGGER - .warn(ENGINE_FOR_KEY_PREFIX + engineWorkerKey.getId() + " is already stopped with state " + getState()); + LOGGER.warn( + ENGINE_FOR_KEY_PREFIX + engineWorkerKey.getId() + " is already stopped with state " + getState()); return; } @@ -352,10 +352,10 @@ final class EngineWorker implements EngineService { public void clear(final AxArtifactKey engineKey) throws ApexException { // Check if the key on the start request is correct if (!engineWorkerKey.equals(engineKey)) { - LOGGER.warn( - ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + ENGINE_SUFFIX); - throw new ApexException( - ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + ENGINE_SUFFIX); + LOGGER.warn(ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + + ENGINE_SUFFIX); + throw new ApexException(ENGINE_KEY_PREFIX + engineKey.getId() + BAD_KEY_MATCH_TAG + engineWorkerKey.getId() + + ENGINE_SUFFIX); } // Interrupt the worker to stop its thread @@ -513,18 +513,18 @@ final class EngineWorker implements EngineService { runtimeJsonStringBuilder.append(",\"AlbumContent\":["); // Get the schema helper to use to marshal context album objects to JSON - final AxContextAlbum axContextAlbum = ModelService.getModel(AxContextAlbums.class) - .get(contextAlbumEntry.getKey()); + final AxContextAlbum axContextAlbum = + ModelService.getModel(AxContextAlbums.class).get(contextAlbumEntry.getKey()); SchemaHelper schemaHelper = null; try { // Get a schema helper to manage the translations between objects on the album map // for this album schemaHelper = new SchemaHelperFactory().createSchemaHelper(axContextAlbum.getKey(), - axContextAlbum.getItemSchema()); + axContextAlbum.getItemSchema()); } catch (final ContextRuntimeException e) { - final String resultString = "could not find schema helper to marshal context album \"" + axContextAlbum - + "\" to JSON"; + final String resultString = + "could not find schema helper to marshal context album \"" + axContextAlbum + "\" to JSON"; LOGGER.warn(resultString, e); // End of context album entry @@ -557,8 +557,7 @@ final class EngineWorker implements EngineService { runtimeJsonStringBuilder.append("]}"); // Tidy up the JSON string - final JsonParser jsonParser = new JsonParser(); - final JsonElement jsonElement = jsonParser.parse(runtimeJsonStringBuilder.toString()); + final JsonElement jsonElement = JsonParser.parseString(runtimeJsonStringBuilder.toString()); final String tidiedRuntimeString = gson.toJson(jsonElement); LOGGER.debug("runtime information={}", tidiedRuntimeString); diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParametersJsonAdapter.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParametersJsonAdapter.java index 35f648307..b7f2fb81d 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParametersJsonAdapter.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParametersJsonAdapter.java @@ -1,19 +1,20 @@ /*- * ============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. * 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========================================================= */ @@ -52,7 +53,6 @@ public class CarrierTechnologyParametersJsonAdapter private static final String VALUE_TAG = "\" value \""; private static final String CARRIER_TECHNOLOGY_PREAMBLE = "carrier technology \""; - private static final String PARAMETER_CLASS_NAME = "parameterClassName"; private static final String CARRIER_TECHNOLOGY_TOKEN = "carrierTechnology"; @@ -62,8 +62,7 @@ public class CarrierTechnologyParametersJsonAdapter private static final Map BUILT_IN_CARRIER_TECHNOLOGY_PARMETER_CLASS_MAP = new HashMap<>(); static { - BUILT_IN_CARRIER_TECHNOLOGY_PARMETER_CLASS_MAP.put("FILE", - FileCarrierTechnologyParameters.class.getName()); + BUILT_IN_CARRIER_TECHNOLOGY_PARMETER_CLASS_MAP.put("FILE", FileCarrierTechnologyParameters.class.getName()); BUILT_IN_CARRIER_TECHNOLOGY_PARMETER_CLASS_MAP.put("EVENT_REQUESTOR", EventRequestorCarrierTechnologyParameters.class.getName()); } @@ -151,8 +150,8 @@ public class CarrierTechnologyParametersJsonAdapter // OK no parameters for the carrier technology have been specified, just instantiate the // default parameters try { - carrierTechnologyParameters = - (CarrierTechnologyParameters) carrierTechnologyParameterClass.newInstance(); + carrierTechnologyParameters = (CarrierTechnologyParameters) carrierTechnologyParameterClass + .getDeclaredConstructor().newInstance(); } catch (final Exception e) { final String errorMessage = "could not create default parameters for carrier technology \"" + carrierTechnologyLabel + "\"\n" + e.getMessage(); @@ -164,11 +163,11 @@ public class CarrierTechnologyParametersJsonAdapter // Check that the carrier technology label matches the label in the carrier technology // parameters object if (!carrierTechnologyParameters.getLabel().equals(carrierTechnologyLabel)) { - final String errorMessage = CARRIER_TECHNOLOGY_PREAMBLE + carrierTechnologyLabel - + "\" does not match plugin \"" - + carrierTechnologyParameters.getLabel() + "\" in \"" + carrierTechnologyParameterClassName - + "\", specify correct carrier technology parameter plugin in parameter \"" + PARAMETER_CLASS_NAME - + "\""; + final String errorMessage = + CARRIER_TECHNOLOGY_PREAMBLE + carrierTechnologyLabel + "\" does not match plugin \"" + + carrierTechnologyParameters.getLabel() + "\" in \"" + carrierTechnologyParameterClassName + + "\", specify correct carrier technology parameter plugin in parameter \"" + + PARAMETER_CLASS_NAME + "\""; LOGGER.warn(errorMessage); throw new ParameterRuntimeException(errorMessage); } diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/RestPluginCarrierTechnologyParameters.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/RestPluginCarrierTechnologyParameters.java index f548f636a..707dcb104 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/RestPluginCarrierTechnologyParameters.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/RestPluginCarrierTechnologyParameters.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-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. @@ -33,8 +33,8 @@ import javax.ws.rs.core.MultivaluedMap; import lombok.Getter; import lombok.Setter; + import org.apache.commons.lang3.StringUtils; -import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters; import org.onap.policy.common.parameters.GroupValidationResult; import org.onap.policy.common.parameters.ValidationStatus; import org.onap.policy.common.utils.validation.ParameterValidationUtils; @@ -68,18 +68,12 @@ public class RestPluginCarrierTechnologyParameters extends CarrierTechnologyPara /** The supported HTTP methods. */ public enum HttpMethod { - GET, PUT, POST, DELETE + GET, + PUT, + POST, + DELETE } - /** The label of this carrier technology. */ - protected String CARRIER_TECHNOLOGY_LABEL; - - /** The producer plugin class for the REST carrier technology. */ - protected String EVENT_PRODUCER_PLUGIN_CLASS; - - /** The consumer plugin class for the REST carrier technology. */ - protected String EVENT_CONSUMER_PLUGIN_CLASS; - /** The default HTTP code filter, allows 2xx HTTP codes through. */ public static final String DEFAULT_HTTP_CODE_FILTER = "[2][0-9][0-9]"; @@ -92,7 +86,7 @@ public class RestPluginCarrierTechnologyParameters extends CarrierTechnologyPara protected static final Pattern patternErrorKey = Pattern.compile("(\\{[^\\{}]*.?\\{)|(\\{[^\\{}]*$)|(\\}[^\\{}]*.?\\})|(^[^\\{}]*.?\\})|\\{\\s*\\}"); - //variable + // variable protected String url = null; protected HttpMethod httpMethod = null; protected String[][] httpHeaders = null; @@ -104,14 +98,6 @@ public class RestPluginCarrierTechnologyParameters extends CarrierTechnologyPara */ public RestPluginCarrierTechnologyParameters() { super(); - - // Set the carrier technology properties for the web socket carrier technology - CARRIER_TECHNOLOGY_LABEL = "RESTPLUGIN"; - EVENT_PRODUCER_PLUGIN_CLASS = "PRODUCER"; - EVENT_CONSUMER_PLUGIN_CLASS = "CONSUMER"; - this.setLabel(CARRIER_TECHNOLOGY_LABEL); - this.setEventProducerPluginClass(EVENT_PRODUCER_PLUGIN_CLASS); - this.setEventConsumerPluginClass(EVENT_CONSUMER_PLUGIN_CLASS); } /** @@ -173,9 +159,8 @@ public class RestPluginCarrierTechnologyParameters extends CarrierTechnologyPara public GroupValidationResult validate() { GroupValidationResult result = super.validate(); - result = validateUrl(result); - - result = validateHttpHeaders(result); + validateUrl(result); + validateHttpHeaders(result); return validateHttpCodeFilter(result); } @@ -195,16 +180,15 @@ public class RestPluginCarrierTechnologyParameters extends CarrierTechnologyPara // @formatter:on public GroupValidationResult validateUrl(final GroupValidationResult result) { // Check if the URL has been set for event output - String URL_ERROR_MSG = "no URL has been set for event sending on " + CARRIER_TECHNOLOGY_LABEL; + String urlErrorMessage = "no URL has been set for event sending on " + getLabel(); if (getUrl() == null) { - result.setResult("url", ValidationStatus.INVALID, URL_ERROR_MSG); + result.setResult("url", ValidationStatus.INVALID, urlErrorMessage); return result; } Matcher matcher = patternErrorKey.matcher(getUrl()); if (matcher.find()) { - result.setResult("url", ValidationStatus.INVALID, - URL_ERROR_MSG); + result.setResult("url", ValidationStatus.INVALID, urlErrorMessage); } return result; @@ -271,7 +255,7 @@ public class RestPluginCarrierTechnologyParameters extends CarrierTechnologyPara */ @Override public String toString() { - return CARRIER_TECHNOLOGY_LABEL +"CarrierTechnologyParameters [url=" + url + ", httpMethod=" + httpMethod + ", httpHeaders=" + return getLabel() + "CarrierTechnologyParameters [url=" + url + ", httpMethod=" + httpMethod + ", httpHeaders=" + Arrays.deepToString(httpHeaders) + ", httpCodeFilter=" + httpCodeFilter + "]"; } } diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParametersJsonAdapter.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParametersJsonAdapter.java index 10941405b..5a1b165df 100644 --- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParametersJsonAdapter.java +++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParametersJsonAdapter.java @@ -1,19 +1,20 @@ /*- * ============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. * 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========================================================= */ @@ -39,8 +40,7 @@ import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * This class serialises and deserialises various type of event protocol parameters to and from - * JSON. + * This class serialises and deserialises various type of event protocol parameters to and from JSON. * * @author Liam Fallon (liam.fallon@ericsson.com) */ @@ -132,9 +132,8 @@ public class EventProtocolParametersJsonAdapter try { eventProtocolParameterClass = Class.forName(eventProtocolParameterClassName); } catch (final ClassNotFoundException e) { - final String errorMessage = - EVENT_PROTOCOL_PREFIX + eventProtocolLabel + "\" parameter \"" + PARAMETER_CLASS_NAME + VALUE_TAG - + eventProtocolParameterClassName + "\", could not find class"; + final String errorMessage = EVENT_PROTOCOL_PREFIX + eventProtocolLabel + "\" parameter \"" + + PARAMETER_CLASS_NAME + VALUE_TAG + eventProtocolParameterClassName + "\", could not find class"; LOGGER.warn(errorMessage, e); throw new ParameterRuntimeException(errorMessage, e); } @@ -146,7 +145,8 @@ public class EventProtocolParametersJsonAdapter // OK no parameters for the event protocol have been specified, just instantiate the // default parameters try { - eventProtocolParameters = (EventProtocolParameters) eventProtocolParameterClass.newInstance(); + eventProtocolParameters = + (EventProtocolParameters) eventProtocolParameterClass.getDeclaredConstructor().newInstance(); } catch (final Exception e) { final String errorMessage = "could not create default parameters for event protocol \"" + eventProtocolLabel + "\"\n" + e.getMessage(); diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ApexParametersTest.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ApexParametersTest.java index 4a946b111..ff97eaec2 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ApexParametersTest.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ApexParametersTest.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 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. * 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========================================================= */ @@ -39,9 +40,8 @@ import org.onap.policy.common.parameters.ParameterException; public class ApexParametersTest { @Test - public void javaPropertiesOk() throws ParameterException { - final String[] args = - { "-c", "src/test/resources/parameters/javaPropertiesOK.json" }; + public void testJavaPropertiesOk() throws ParameterException { + final String[] args = {"-c", "src/test/resources/parameters/javaPropertiesOK.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); try { @@ -57,9 +57,8 @@ public class ApexParametersTest { } @Test - public void javaPropertiesEmpty() throws ParameterException { - final String[] args = - { "-c", "src/test/resources/parameters/javaPropertiesEmpty.json" }; + public void testJavaPropertiesEmpty() throws ParameterException { + final String[] args = {"-c", "src/test/resources/parameters/javaPropertiesEmpty.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); try { @@ -69,12 +68,10 @@ public class ApexParametersTest { fail("This test should not throw an exception"); } } - @Test - public void javaPropertiesBad() throws ParameterException { - final String[] args = - { "-c", "src/test/resources/parameters/javaPropertiesBad.json" }; + public void testJavaPropertiesBad() throws ParameterException { + final String[] args = {"-c", "src/test/resources/parameters/javaPropertiesBad.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); try { @@ -87,23 +84,23 @@ public class ApexParametersTest { assertTrue(pe.getMessage().contains("java properties array entry is null")); } } - + @Test public void testGettersSetters() { ApexParameters pars = new ApexParameters(); assertNotNull(pars); - + pars.setEngineServiceParameters(null); assertNull(pars.getEngineServiceParameters()); - + pars.setEventInputParameters(null); assertNull(pars.getEventInputParameters()); - + pars.setEventOutputParameters(null); assertNull(pars.getEventOutputParameters()); - + assertFalse(pars.checkJavaPropertiesSet()); - + pars.setName("parName"); assertEquals("parName", pars.getName()); } diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java index de78bb0fe..f6d39f029 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java @@ -118,8 +118,10 @@ public class ContextParameterTests { + "\"src/test/resources/parameters/serviceContextBadPluginClassParams.json\"" + "\n(ClassCastException):class org.onap.policy.apex.service.engine.parameters." + "dummyclasses.SuperDooperExecutorParameters" - + " cannot be cast to class org.onap.policy.apex.context.parameters.ContextParameters (org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters and org.onap.policy.apex.context.parameters.ContextParameters are in unnamed module of loader 'app')", - e.getMessage()); + + " cannot be cast to class org.onap.policy.apex.context.parameters.ContextParameters " + + "(org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters and " + + "org.onap.policy.apex.context.parameters.ContextParameters are " + + "in unnamed module of loader 'app')", e.getMessage()); } } diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ExecutorParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ExecutorParameterTests.java index 2af051ea7..16a892f93 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ExecutorParameterTests.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ExecutorParameterTests.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. @@ -43,7 +44,7 @@ public class ExecutorParameterTests { } @Test - public void noParamsTest() { + public void testNoParamsTest() { final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorNoParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -57,7 +58,7 @@ public class ExecutorParameterTests { } @Test - public void badParamsTest() { + public void testBadParamsTest() { final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorBadParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -73,7 +74,7 @@ public class ExecutorParameterTests { } @Test - public void noExecutorParamsTest() { + public void testNoExecutorParamsTest() { final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorNoExecutorParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -89,7 +90,7 @@ public class ExecutorParameterTests { } @Test - public void emptyParamsTest() { + public void testEmptyParamsTest() { final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorEmptyParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -105,7 +106,7 @@ public class ExecutorParameterTests { } @Test - public void badPluginParamNameTest() { + public void testBadPluginParamNameTest() { final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorBadPluginNameParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -121,7 +122,7 @@ public class ExecutorParameterTests { } @Test - public void badPluginParamObjectTest() { + public void testBadPluginParamObjectTest() { final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorBadPluginValueObjectParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -137,7 +138,7 @@ public class ExecutorParameterTests { } @Test - public void badPluginParamBlankTest() { + public void testBadPluginParamBlankTest() { final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorBadPluginValueBlankParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -153,7 +154,7 @@ public class ExecutorParameterTests { } @Test - public void badPluginParamValueTest() { + public void testBadPluginParamValueTest() { final String[] args = {"-c", "src/test/resources/parameters/serviceExecutorBadPluginValueParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -170,7 +171,7 @@ public class ExecutorParameterTests { } @Test - public void goodParametersTest() { + public void testGoodParametersTest() { final String[] args = {"-c", "src/test/resources/parameters/goodParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -188,7 +189,7 @@ public class ExecutorParameterTests { } @Test - public void relativeParametersTest() { + public void testRelativeParametersTest() { // @formatter:off final String[] args = { "-rfr", diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java index e12bb6142..3da98163a 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-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. @@ -48,7 +48,7 @@ import org.onap.policy.common.parameters.ParameterException; */ public class ParameterTests { @Test - public void invalidParametersNoFileTest() throws ParameterException { + public void testInvalidParametersNoFileTest() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/invalidNoFile.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -62,7 +62,7 @@ public class ParameterTests { } @Test - public void invalidParametersEmptyTest() { + public void testInvalidParametersEmptyTest() { final String[] args = {"-c", "src/test/resources/parameters/empty.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -76,7 +76,7 @@ public class ParameterTests { } @Test - public void invalidParametersNoParamsTest() { + public void testInvalidParametersNoParamsTest() { final String[] args = {"-c", "src/test/resources/parameters/noParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -97,7 +97,7 @@ public class ParameterTests { } @Test - public void invalidParametersBlankParamsTest() { + public void testInvalidParametersBlankParamsTest() { final String[] args = {"-c", "src/test/resources/parameters/blankParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -122,7 +122,7 @@ public class ParameterTests { } @Test - public void invalidParametersTest() { + public void testInvalidParametersTest() { final String[] args = {"-c", "src/test/resources/parameters/badParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -168,7 +168,7 @@ public class ParameterTests { } @Test - public void modelNotFileTest() { + public void testModelNotFileTest() { final String[] args = {"-c", "src/test/resources/parameters/badParamsModelNotFile.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -190,7 +190,7 @@ public class ParameterTests { } @Test - public void goodParametersTest() { + public void testGoodParametersTest() { final String[] args = {"-c", "src/test/resources/parameters/goodParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -239,7 +239,7 @@ public class ParameterTests { } @Test - public void superDooperParametersTest() { + public void testSuperDooperParametersTest() { final String[] args = {"-c", "src/test/resources/parameters/superDooperParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java index 3da682884..b32ba14ba 100644 --- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java +++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-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. @@ -45,7 +45,7 @@ import org.onap.policy.common.parameters.ParameterException; */ public class SyncParameterTests { @Test - public void syncBadNoSyncWithPeer() throws ParameterException { + public void testSyncBadNoSyncWithPeer() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -67,7 +67,7 @@ public class SyncParameterTests { } @Test - public void syncBadNotSyncWithPeer() throws ParameterException { + public void testSyncBadNotSyncWithPeer() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -89,7 +89,7 @@ public class SyncParameterTests { } @Test - public void syncBadSyncBadPeers() throws ParameterException { + public void testSyncBadSyncBadPeers() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsBadPeers.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -122,7 +122,7 @@ public class SyncParameterTests { } @Test - public void syncBadSyncInvalidTimeout() throws ParameterException { + public void testSyncBadSyncInvalidTimeout() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsInvalidTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -157,7 +157,7 @@ public class SyncParameterTests { } @Test - public void syncBadSyncBadTimeout() throws ParameterException { + public void testSyncBadSyncBadTimeout() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsBadTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -179,7 +179,7 @@ public class SyncParameterTests { } @Test - public void syncBadSyncUnpairedTimeout() throws ParameterException { + public void testSyncBadSyncUnpairedTimeout() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncBadParamsUnpairedTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -216,7 +216,7 @@ public class SyncParameterTests { } @Test - public void syncGoodSyncGoodTimeoutProducer() throws ParameterException { + public void testSyncGoodSyncGoodTimeoutProducer() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncGoodParamsProducerTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -236,7 +236,7 @@ public class SyncParameterTests { } @Test - public void syncGoodSyncGoodTimeoutConsumer() throws ParameterException { + public void testSyncGoodSyncGoodTimeoutConsumer() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncGoodParamsConsumerTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -256,7 +256,7 @@ public class SyncParameterTests { } @Test - public void syncGoodSyncGoodTimeoutBoth() throws ParameterException { + public void testSyncGoodSyncGoodTimeoutBoth() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncGoodParamsBothTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -276,7 +276,7 @@ public class SyncParameterTests { } @Test - public void syncUnusedConsumerPeers() throws ParameterException { + public void testSyncUnusedConsumerPeers() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncUnusedConsumerPeers.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -305,7 +305,7 @@ public class SyncParameterTests { } @Test - public void syncMismatchedPeers() throws ParameterException { + public void testSyncMismatchedPeers() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncMismatchedPeers.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -342,7 +342,7 @@ public class SyncParameterTests { } @Test - public void syncUnusedProducerPeers() throws ParameterException { + public void testSyncUnusedProducerPeers() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncUnusedProducerPeers.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -369,7 +369,7 @@ public class SyncParameterTests { } @Test - public void syncMismatchedTimeout() throws ParameterException { + public void testSyncMismatchedTimeout() throws ParameterException { final String[] args = {"-c", "src/test/resources/parameters/syncMismatchedTimeout.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); @@ -398,7 +398,7 @@ public class SyncParameterTests { } @Test - public void syncGoodParametersTest() { + public void testSyncGoodParametersTest() { final String[] args = {"-c", "src/test/resources/parameters/syncGoodParams.json"}; final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args); -- cgit 1.2.3-korg