From e1d67de22d0bf9fe50c16ee6bc1e50310e74d4fa Mon Sep 17 00:00:00 2001 From: Taka Cho Date: Tue, 24 Aug 2021 13:03:02 -0400 Subject: clamp sonar fix on test code and the rest - rename files to "...ItTestCase" to comply SONAR and checkstyle - surefire plugin include *Test.java files - failsafe plugin include *ItTestCase.java files - use assertEquals etc. - replace to "var" - remove unused import Issue-ID: POLICY-3452 Change-Id: I2e6e829726c4585f5f8bc985f4e8f2b88d17aef1 Signed-off-by: Taka Cho --- .../controlloop/runtime/main/web/RuntimeErrorController.java | 4 +++- .../clamp/controlloop/runtime/supervision/SupervisionHandler.java | 2 ++ .../clamp/controlloop/runtime/supervision/SupervisionScanner.java | 4 +++- .../runtime/supervision/comm/ControlLoopUpdatePublisher.java | 8 +++++--- .../runtime/supervision/comm/ParticipantUpdatePublisher.java | 5 +++-- .../controlloop/runtime/monitoring/TestMonitoringProvider.java | 4 +++- .../controlloop/runtime/supervision/SupervisionAspectTest.java | 8 +++++--- 7 files changed, 24 insertions(+), 11 deletions(-) (limited to 'runtime-controlloop/src') diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/main/web/RuntimeErrorController.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/main/web/RuntimeErrorController.java index 2dc7a6b8e..ac2dba355 100644 --- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/main/web/RuntimeErrorController.java +++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/main/web/RuntimeErrorController.java @@ -2,6 +2,8 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. * ================================================================================ + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * ================================================================================ * 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 @@ -83,7 +85,7 @@ public class RuntimeErrorController implements ErrorController { Map map = this.errorAttributes.getErrorAttributes(new ServletWebRequest(request), ErrorAttributeOptions.defaults()); - StringBuilder sb = new StringBuilder(); + var sb = new StringBuilder(); final Object error = map.get("error"); if (error != null) { sb.append(error.toString()).append(" "); diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java index b39573461..c68b7fd49 100644 --- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java +++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionHandler.java @@ -2,6 +2,8 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. * ================================================================================ + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * ================================================================================ * 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 diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionScanner.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionScanner.java index a05337991..65149a733 100644 --- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionScanner.java +++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/SupervisionScanner.java @@ -2,6 +2,8 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. * ================================================================================ + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * ================================================================================ * 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 @@ -204,7 +206,7 @@ public class SupervisionScanner { return; } - boolean completed = true; + var completed = true; for (ControlLoopElement element : controlLoop.getElements().values()) { if (!element.getState().equals(element.getOrderedState().asState())) { completed = false; diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java index 35219bb68..6df030d32 100644 --- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java +++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ControlLoopUpdatePublisher.java @@ -2,6 +2,8 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. * ================================================================================ + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * ================================================================================ * 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 @@ -59,7 +61,7 @@ public class ControlLoopUpdatePublisher extends AbstractParticipantPublisher controlLoopElementList = new ArrayList<>(); participantUpdate.setParticipantId(clElement.getParticipantId()); controlLoopElementList.add(clElement); diff --git a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java index d239f38cb..efd262560 100644 --- a/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java +++ b/runtime-controlloop/src/main/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/ParticipantUpdatePublisher.java @@ -2,6 +2,8 @@ * ============LICENSE_START======================================================= * Copyright (C) 2021 Nordix Foundation. * ================================================================================ + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * ================================================================================ * 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 @@ -36,7 +38,6 @@ import org.onap.policy.models.provider.PolicyModelsProvider; import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; -import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplates; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -117,7 +118,7 @@ public class ParticipantUpdatePublisher extends AbstractParticipantPublisher