Changes for checkstyle 8.32
[policy/apex-pdp.git] / testsuites / integration / integration-uservice-test / src / test / java / org / onap / policy / apex / testsuites / integration / uservice / executionproperties / DummyCarrierTechnologyParameters.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2019 Nordix Foundation.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.apex.testsuites.integration.uservice.executionproperties;
22
23 import lombok.Data;
24 import lombok.EqualsAndHashCode;
25 import org.apache.commons.lang3.StringUtils;
26 import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters;
27 import org.onap.policy.common.parameters.GroupValidationResult;
28 import org.onap.policy.common.parameters.ValidationStatus;
29
30 /**
31  * Dummy carrier technology parameters.
32  *
33  * <p>The parameters for this plugin are:
34  * <ol>
35  * <li>testToRun: The name of the test to run.
36  * </ol>
37  */
38 @Data
39 @EqualsAndHashCode(callSuper = false)
40 public class DummyCarrierTechnologyParameters extends CarrierTechnologyParameters {
41
42     /** The label of this carrier technology. */
43     public static final String DUMMY_CARRIER_TECHNOLOGY_LABEL = "DUMMY";
44
45     /** The producer plugin class for the dummy carrier technology. */
46     public static final String DUMMY_EVENT_PRODUCER_PLUGIN_CLASS = DummyApexEventProducer.class.getName();
47
48     /** The consumer plugin class for the dummy carrier technology. */
49     public static final String DUMMY_EVENT_CONSUMER_PLUGIN_CLASS = DummyApexEventConsumer.class.getName();
50
51     private String testToRun = null;
52     private String propertyFileName = null;
53
54     /**
55      * Constructor to create a dummy carrier technology parameters instance and register the instance with the parameter
56      * service.
57      */
58     public DummyCarrierTechnologyParameters() {
59         super();
60
61         // Set the carrier technology properties for the web socket carrier technology
62         this.setLabel(DUMMY_CARRIER_TECHNOLOGY_LABEL);
63         this.setEventProducerPluginClass(DUMMY_EVENT_PRODUCER_PLUGIN_CLASS);
64         this.setEventConsumerPluginClass(DUMMY_EVENT_CONSUMER_PLUGIN_CLASS);
65
66     }
67
68     /**
69      * {@inheritDoc}.
70      */
71     @Override
72     public GroupValidationResult validate() {
73         final GroupValidationResult result = super.validate();
74
75         if (StringUtils.isEmpty(testToRun)) {
76             result.setResult("testToRun", ValidationStatus.INVALID,
77                     "no test has been specified on the dummy carrier technology plugin");
78         }
79
80         if (StringUtils.isEmpty(propertyFileName)) {
81             result.setResult("propertyFileName", ValidationStatus.INVALID,
82                     "no propertyFileName has been specified on the dummy carrier technology plugin");
83         }
84
85         return result;
86     }
87 }