diff options
author | Jim Hahn <jrh3@att.com> | 2020-06-29 10:16:44 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-06-29 11:09:58 -0400 |
commit | ff0842117fba4dfe675a8b87af3a1098cde023bd (patch) | |
tree | 1dde66fc3323e9bb3edec8bf83df1456cbf6fffd /integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java | |
parent | 4cdfdf4fa218a3b4f7e9690355db85976bc1888d (diff) |
Fix issues in common for new sonar rules
Addressed issues reported due to updates to the sonar rules:
- invoke only one method in a junit lambda
- complete the assertion
- add DOCTYPE to html
Issue-ID: POLICY-2650
Change-Id: Ib8b8a2e4736cc23849c0f7aef972ffa3365a3e00
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java')
-rw-r--r-- | integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java index 79cfe549..a46be4f0 100644 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java +++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * Integrity Monitor * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2020 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. @@ -20,7 +20,7 @@ package org.onap.policy.common.im; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -177,16 +177,19 @@ public class AllSeemsWellTest extends IntegrityMonitorTestBase { } // Check for null parameters - assertThatThrownBy(() -> im.allSeemsWell(null, IntegrityMonitorProperties.ALLSEEMSWELL, ALL_SEEMS_WELL_MSG)); + assertThatIllegalArgumentException().isThrownBy( + () -> im.allSeemsWell(null, IntegrityMonitorProperties.ALLSEEMSWELL, ALL_SEEMS_WELL_MSG)); - assertThatThrownBy(() -> im.allSeemsWell("", IntegrityMonitorProperties.ALLSEEMSWELL, ALL_SEEMS_WELL_MSG)); + assertThatIllegalArgumentException().isThrownBy( + () -> im.allSeemsWell("", IntegrityMonitorProperties.ALLSEEMSWELL, ALL_SEEMS_WELL_MSG)); - assertThatThrownBy(() -> im.allSeemsWell(this.getClass().getName(), null, ALL_SEEMS_WELL_MSG)); + assertThatIllegalArgumentException().isThrownBy( + () -> im.allSeemsWell(this.getClass().getName(), null, ALL_SEEMS_WELL_MSG)); - assertThatThrownBy(() -> im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, - null)); + assertThatIllegalArgumentException().isThrownBy( + () -> im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, null)); - assertThatThrownBy( + assertThatIllegalArgumentException().isThrownBy( () -> im.allSeemsWell(this.getClass().getName(), IntegrityMonitorProperties.ALLSEEMSWELL, "")); logger.debug("\n\ntestAllSeemsWell: Exit\n\n"); |