aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.java
AgeCommit message (Collapse)AuthorFilesLines
2020-09-28New sonars in policy-commonJim Hahn1-2/+14
Addressed the following sonars: - too many assertions in a test case - use parameterized test method Disabled production sonars for util-test, as the entire module is only used for testing other modules. Issue-ID: POLICY-2650-sonar Change-Id: If49775a6c95855dcd9601ee0d833bb00741b1550 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-04-06Address sonar issues in commonJim Hahn1-1/+2
Addressed the following sonar issues: - missing assertion in junit test case - disable sonars about setAccessible() as it's required for jackson emulation - sleep in junit - don't use wild-cards (e.g., "*") with java.util Pattern - use re2j instead of java.util Pattern - use String methods (e.g., startsWith()) - duplicate method bodies - duplicate code in Coder classes - string concatenation in logger calls - UTF-8 encoding - return primitive instead of boxed primitive - add assertion to tests - renamed support methods from doTestXxx to verifyXxx - cognitive complexity - use AtomicRef instead of volatile - use specific Functionals (e.g., IntConsumer) - function always returns the same value - serializable vs transient Issue-ID: POLICY-2305 Change-Id: I08eb7aa495a80bdc1d26827ba17a7946c83b9828 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-01-13Changed Matchers to ArgumentMatchersJim Hahn1-2/+2
Issue-ID: POLICY-1406 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I6d85bb10c15f9d82fa55d9328d18640098050dd9
2019-06-26Fix some sonar issues in policy-endpointsJim Hahn1-0/+1
Refactored various classes to reduce cyclomatic complexity. Introduced some endpoint utility classes to facilitate extraction and conversion of property values, and populating of common "builder" values. Change-Id: Ie1c91cd94cb54700dc9127f72780b4d94b82ec39 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-21Support for lab contextual topic names.Jorge Hernandez1-1/+39
This work allows a drools application, with its drl template to refer to the topic name by its invariable canonical name, ie. POLICY-CL-MGT. Since the drl is a design time artifact, it is desired to know topics by its canonical non-changeable name. The actual per lab environment topic name may change on a per deployment basis, for example POLICY-CL-MGT-WINDRIVER or POLICY-CL-MGT-TLAB. The template can still use POLICY-CL-MGT without modification but the actual installation configuration would use the "effectiveTopic" property to point to the right topic on a per lab basis. This also helps with installation (long story) since the canonical topics will be known ahead of time. Change-Id: I8322bf7e427569c37a76eea5ce6d5b9547cb2ff3 Issue-ID: POLICY-1534 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2019-02-13Add gson handler and testsJim Hahn1-6/+12
Added JacksonHandler which provides jackson behavior in gson. Also added classes to facilitate testing of gson serializations. Added compareGson(xxx, Class). Removed trailing spaces from some files. Updated license dates. Replaced incorrect constant with ${xxx} in json test file. Fixed typo in test method name. Change-Id: If05b654d76a4ffc88646f03334be82b32506f28f Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-28Add junit coverage to rest of policy-endpoint busJim Hahn1-2/+2
Also extracted out common code from tests. Fix checkstyle issues. Be consistent in returning IllegalStateException when topic is not found by any Topic Factory. Added/updated some comments. Use better name for "validate" argument. Renamed test() to testDestroy(). Added NoopTopicPropertyBuilder. Renamed BusTopicTestBase to TopicTestBase. Change-Id: Id4c7ab9f2b5572dc5195b0da116e285c5e9b6f06 Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-26Add junit coverage to policy-commonJim Hahn1-0/+295
Added coverage tests for policy-endpoints. Fixed new checkstyle warnings. Use powermock version from parent pom. Replaced literals with constants in new tests. Moved test superclass higher up the class hierarchy so it can be re-used. Removed powermock version. Change-Id: I7d3d45132cd0973f4d02d3af320a1d53a1234e4d Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>