summaryrefslogtreecommitdiffstats
path: root/integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-06-21 13:19:31 -0400
committerJim Hahn <jrh3@att.com>2019-06-21 17:19:09 -0400
commitd6aa3faba917b45e01f5001fe3a768feddedc798 (patch)
tree077a51a89320f558f08b2d0512f6cf63450ae90d /integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java
parentc9392e1a126de54ae8a0e1f3316729e878115300 (diff)
Fix sonar issues in integrity monitor
Used Eclipse Refactor->Extract Method to reduce cyclomatic complexity. Flattened nested FpManager class into IntegrityMonitor class. Changed some strings to StringBuilder, where lots of concatenation was being done. Simplified some things by eliminating some try/catch blocks where an exception can't actually (except may an out-of-memory exception). Also addressed some sonar issues in the tests (e.g., use "<>" where appropriate). Eliminated some assertException methods, replacing them with assertj methods. Did not attempt to increase junit coverage. Change-Id: I311acaffcd87f0cbbf382c06c7fa26177007abd5 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java')
-rw-r--r--integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java
index f3cb1eff..715d8f75 100644
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/ExceptionsTest.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* Integrity Monitor
* ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2019 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
- *
+ *
* 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.
@@ -32,47 +32,47 @@ import org.onap.policy.common.utils.test.ExceptionsTester;
public class ExceptionsTest extends ExceptionsTester {
@Test
- public void testStateTransitionException() throws Exception {
+ public void testStateTransitionException() {
assertEquals(4, test(StateTransitionException.class));
}
@Test
- public void testStateManagementException() throws Exception {
+ public void testStateManagementException() {
assertEquals(4, test(StateManagementException.class));
}
@Test
- public void testStandbyStatusException() throws Exception {
+ public void testStandbyStatusException() {
assertEquals(5, test(StandbyStatusException.class));
}
@Test
- public void testIntegrityMonitorPropertiesException() throws Exception {
+ public void testIntegrityMonitorPropertiesException() {
assertEquals(4, test(IntegrityMonitorPropertiesException.class));
}
@Test
- public void testIntegrityMonitorException() throws Exception {
+ public void testIntegrityMonitorException() {
assertEquals(5, test(IntegrityMonitorException.class));
}
@Test
- public void testForwardProgressException() throws Exception {
+ public void testForwardProgressException() {
assertEquals(4, test(ForwardProgressException.class));
}
@Test
- public void testAllSeemsWellException() throws Exception {
+ public void testAllSeemsWellException() {
assertEquals(4, test(AllSeemsWellException.class));
}
@Test
- public void testAdministrativeStateException() throws Exception {
+ public void testAdministrativeStateException() {
assertEquals(4, test(AdministrativeStateException.class));
}
@Test
- public void testComponentAdminException() throws Exception {
+ public void testComponentAdminException() {
assertEquals(4, test(ComponentAdminException.class));
}
}