diff options
author | Jim Hahn <jrh3@att.com> | 2021-05-06 11:28:53 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-05-06 15:26:24 -0400 |
commit | 1d0aaaa5b31719c1718700bb0d1a99c413fd513c (patch) | |
tree | bd2687f1d38f3e3c4e53a68695c8c91c6866468e /integrity-audit/src/test | |
parent | 3b00f1c32b89282dcbb74d3d3645e263f005319e (diff) |
Fix sonars in policy-common
Fixed sonars:
- use "var" instead of actual type name
- re-interrupt threads
- use rej2 split() instead of String split()
Issue-ID: POLICY-3285
Change-Id: I82261e0b8a53ee5c5264556fbf5cec37454f014e
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'integrity-audit/src/test')
-rw-r--r-- | integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java index 4728fe84..6c48a6d9 100644 --- a/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java +++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/DbAuditTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * Integrity Audit * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-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. @@ -26,6 +26,7 @@ import static org.junit.Assert.assertFalse; import java.util.List; import java.util.Properties; +import java.util.regex.Pattern; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; @@ -51,6 +52,7 @@ public class DbAuditTest extends IntegrityAuditTestBase { private static Logger logger = FlexLogger.getLogger(DbAuditTest.class); + private static final Pattern COMMA_PAT = Pattern.compile(","); private static final String RESOURCE_NAME = "pdp1"; private EntityManagerFactory emf2; @@ -238,7 +240,7 @@ public class DbAuditTest extends IntegrityAuditTestBase { assertFalse(dbglog.getExtracted().isEmpty()); String mismatchIndex = dbglog.getExtracted().get(dbglog.getExtracted().size() - 1); - int mismatchEntries = mismatchIndex.trim().split(",").length; + int mismatchEntries = COMMA_PAT.split(mismatchIndex.trim()).length; logger.info("mismatchTest: mismatchIndex found: '" + mismatchIndex + "'" + " mismatachEntries = " + mismatchEntries); |