summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2020-02-25 16:10:08 +0000
committerliamfallon <liam.fallon@est.tech>2020-02-26 08:33:06 +0000
commit35840d835f581c2d61de1c57fe9963e36eb15c9f (patch)
tree10b8a6004cad1b4d1d63ebebe2aa26ae2af7f3e4 /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java
parentaacc7442f046d44359934ea3d93f425a809e7616 (diff)
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 <liam.fallon@est.tech>
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/RestClientCarrierTechnologyParametersTest.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/RestClientCarrierTechnologyParametersTest.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/RestClientCarrierTechnologyParametersTest.java
index 0e4ddd0a3..df3b61bcb 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/RestClientCarrierTechnologyParametersTest.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/RestClientCarrierTechnologyParametersTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 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.
@@ -21,6 +21,7 @@
package org.onap.policy.apex.plugins.event.carrier.restclient;
+import static org.assertj.core.api.Assertions.assertThatCode;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -35,7 +36,7 @@ import org.onap.policy.apex.service.parameters.ApexParameters;
import org.onap.policy.common.parameters.ParameterException;
/**
- * Test REST Requestor carrier technology parameters.
+ * Test REST client carrier technology parameters.
*/
public class RestClientCarrierTechnologyParametersTest {
@@ -92,16 +93,11 @@ public class RestClientCarrierTechnologyParametersTest {
arguments.setConfigurationFilePath("src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json");
arguments.setRelativeFileRoot(".");
- try {
- new ApexParameterHandler().getParameters(arguments);
+ assertThatCode(() -> {
ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
-
parameters.getEventInputParameters().get("RestClientConsumer0").getCarrierTechnologyParameters();
- fail("test should throw an exception here");
- } catch (ParameterException pe) {
- assertTrue(pe.getMessage().contains(
- "Invalid HTTP code filter, the filter must be specified as a three digit regular expression: "));
- }
+ }).hasMessageContaining(
+ "Invalid HTTP code filter, the filter must be specified as a three digit regular expression: ");
}
@Test