From b7097d21c25a48c9d209548ac8afdc09b1679457 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 10 Feb 2021 16:17:10 -0500 Subject: More sonars in models Addressed the following: - make constructors protected - check exception type - too many assertions - remove annotation lists - use "<>" - reduce cognitive complexity - extract constant - multiple method calls in one assert - don't use eq() in verify() - indentation Issue-ID: POLICY-2905 Change-Id: I25bb3951f781250e9cdfe8f5f3b80cb63e129184 Signed-off-by: Jim Hahn --- .../policy/models/provider/impl/DatabasePolicyModelsProviderTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models-provider') diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java index 596f9fa0d..4f574906a 100644 --- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java +++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java @@ -299,7 +299,7 @@ public class DatabasePolicyModelsProviderTest { assertTrue(databaseProvider.getPolicyTypeList(NAME, VERSION_100).isEmpty()); assertThatThrownBy( - () -> databaseProvider.getFilteredPolicyTypes(ToscaEntityFilter.builder().build())) + () -> databaseProvider.getFilteredPolicyTypes(ToscaEntityFilter.builder().build())) .hasMessage("service template not found in database"); assertTrue(databaseProvider.getFilteredPolicyTypeList(ToscaEntityFilter.builder().build()) @@ -322,7 +322,7 @@ public class DatabasePolicyModelsProviderTest { assertTrue(databaseProvider.getPolicyList(NAME, VERSION_100).isEmpty()); assertThatThrownBy( - () -> databaseProvider.getFilteredPolicies(ToscaTypedEntityFilter.builder().build())) + () -> databaseProvider.getFilteredPolicies(ToscaTypedEntityFilter.builder().build())) .hasMessage("service template not found in database"); assertTrue(databaseProvider.getFilteredPolicyList(ToscaTypedEntityFilter.builder().build()) -- cgit 1.2.3-korg