diff options
author | Jim Hahn <jrh3@att.com> | 2021-09-02 09:57:16 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-09-02 11:26:11 -0400 |
commit | a84ef3cb2133fde745c50d7a23290505e4f4659a (patch) | |
tree | 9edcaf76ba26edbcf5c3be67b1e06518d1a5d344 /runtime/src/test/java | |
parent | 5af35328dd1cab498c1d361126fd123dd859eb07 (diff) |
Fix eclipse warnings in clamp
Fixed some of these warnings, just in policy-clamp-runtime:
- equals() with wrong argument type in junit
- remove unneeded "SuppressWarning"
- unused fields
- deprecated classes/methods
Fixed some sonars, too:
- use isEqualByComparingTo()
- method complexity: used eclipse to auto-extract methods
Fixed checkstyle issues:
- indentation level
Did not address all deprecation issues (e.g., SSLSocketFactory).
Issue-ID: POLICY-3200
Change-Id: Ibd92e5326854002dc0ca2d7b3b777699cafb5e98
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'runtime/src/test/java')
3 files changed, 4 insertions, 7 deletions
diff --git a/runtime/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItTestCase.java b/runtime/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItTestCase.java index 1d78d6ce1..165fd3fd6 100644 --- a/runtime/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItTestCase.java +++ b/runtime/src/test/java/org/onap/policy/clamp/clds/tosca/update/ToscaConverterWithDictionarySupportItTestCase.java @@ -29,7 +29,6 @@ import javax.transaction.Transactional; import org.junit.Test; import org.junit.runner.RunWith; import org.onap.policy.clamp.clds.Application; -import org.onap.policy.clamp.clds.tosca.update.execution.ToscaMetadataExecutor; import org.onap.policy.clamp.clds.tosca.update.parser.metadata.ToscaMetadataParserWithDictionarySupport; import org.onap.policy.clamp.clds.tosca.update.templates.JsonTemplateManager; import org.onap.policy.clamp.clds.util.JsonUtils; @@ -55,9 +54,6 @@ public class ToscaConverterWithDictionarySupportItTestCase { @Autowired private ToscaMetadataParserWithDictionarySupport toscaMetadataParserWithDictionarySupport; - @Autowired - private ToscaMetadataExecutor toscaMetadataExecutor; - /** * This Test validates Tosca yaml with metadata tag that contains policy_model_type and acronym * parameters which defines the Tosca Policy name and its short name. diff --git a/runtime/src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java b/runtime/src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java index f3ca978e7..57837eff4 100644 --- a/runtime/src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java +++ b/runtime/src/test/java/org/onap/policy/clamp/clds/util/LoggingUtilsTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * ONAP CLAMP * Copyright (C) 2019 Samsung. All rights reserved. +* 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. @@ -22,7 +23,6 @@ package org.onap.policy.clamp.clds.util; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -38,7 +38,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; diff --git a/runtime/src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java b/runtime/src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java index 567cad69d..de8ec4a48 100644 --- a/runtime/src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java +++ b/runtime/src/test/java/org/onap/policy/clamp/loop/ExternalComponentStateTest.java @@ -40,6 +40,7 @@ public class ExternalComponentStateTest { } @Test + @SuppressWarnings("unlikely-arg-type") public void equalsTest() { assertThat(state.equals(null)).isFalse(); @@ -68,7 +69,7 @@ public class ExternalComponentStateTest { public void compareToTest() { ExternalComponentState state2 = new ExternalComponentState("NOT_SENT", "The policies defined have NOT yet been created on the policy engine", 90); - assertThat(state.compareTo(state2)).isEqualTo(0); + assertThat(state).isEqualByComparingTo(state2); ExternalComponentState state3 = new ExternalComponentState("SENT", "The policies defined have NOT yet been created on the policy engine", 50); |