aboutsummaryrefslogtreecommitdiffstats
path: root/integrity-monitor/src/test/java/org/onap/policy/common/im/StateManagementTest.java
AgeCommit message (Collapse)AuthorFilesLines
2023-09-21Java 17 Upgradeadheli.tavares1-8/+9
Issue-ID: POLICY-4668 Change-Id: If4e79224de61d66d7514f3abbd7b8bee1c3d5681 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2021-05-21Enhance toString methods in factory classesJim Hahn1-12/+5
The factory classes in policy-endpoints have toString() methods that return "[]" for their list contents. Updated the code to provide a list of the keys rather than just an empty list. Also replaced some toString() methods with lombok. Also replace StringBuilder with concatenation in some cases. Issue-ID: POLICY-3298 Change-Id: I64fca21a4b009f7e09fcc482b5d156753fb7e680 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-12-04Fixing sonar issues in policy-commona.sreekumar1-132/+134
Change-Id: I4dce0dbdf71d01fbb59e9bf861d1af1ab49e5ae7 Issue-ID: POLICY-2914 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-06-29Fix issues in common for new sonar rulesJim Hahn1-7/+5
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>
2020-06-17Cleanup various sonar issues in policy-commonJim Hahn1-1/+0
Addressed the following issues: - unused imports - unused method parameters - use assertEquals, assertSame instead of assertTrue - provide the parametrized type for this generic Also fixed some checkstyle issues: - removed blank lines between "import" groups Issue-ID: POLICY-2650 Change-Id: I004bb650ac10c49ccd0fc405f6959896fec39f9b 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
2020-01-10Address items deprecated by move to java 11Jim Hahn1-3/+3
Addressed the following deprecated items: - "new Integer(xxx)" - Observable/Observer - Mockito.anyObject() Added assertion to a junit test to address a sonar issue. Did not address deprecated Nashorn javascript interpreter; that will be done in a separate review. Updated licenses. Issue-ID: POLICY-1406 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I81fd158f831e01d5410d79898ced658285787d47
2019-06-21Fix sonar issues in integrity monitorJim Hahn1-31/+33
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>
2018-11-27Fix checkstyle issue in policy commonKrishnakumar Jinka1-4/+5
Move method into class it is being called. Fix minor checkstyle formatting in the class. The changes have side effects hence revert some changes. Modify the javadoc tags Issue-ID: POLICY-1251 Change-Id: Iecb513dafe3f60628664f3e60d6c49d3e4ce3148 Signed-off-by: kris.jinka <kris.jinka@samsung.com>
2018-03-20Removed checkstyle warningsmmis1-1/+3
Removed checkstyle warnings in policy/common/im Issue-ID: POLICY-695 Change-Id: I32b4797249386c0d1bd0f50792880a1759503a67 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-03-16Fixing 12 reported bugs in Sonar for policy/commoneikrwaq1-204/+263
Change-Id: I7bf453828f7a62070e7a73362798e6f2d4806b2f Issue-ID: POLICY-661 Signed-off-by: eikrwaq <waqas.ikram@ericsson.com>
2018-02-13Add test coverage to integrity-monitorJim Hahn1-0/+239
Removed "test" from package name. Refactored tests, creating common IntegrityMonitorTestBase. Turned log/print statements into assertEquals in StateTransitionTest. Turned log/print statements into assertEquals in StateManagementTest. Modified AllSeemsWellTest to use IntegrityMonitorTestBase. Modified IntegrityMonitorTest to use IntegrityMonitorTestBase. Added several hooks to IntegrityMonitor to control timers at a finer granularity. Added hooks to IntegrityMonitor to control the FPManager thread. Remove hooks for refresh timer, as property suffices. Added assertException() and assertNoException() methods to IntegrityMonitorTestBase, and then replaced most "try/catch" blocks with calls to those methods. Updated StateManagement to close EntityManagers. Modify pom to remove scope from utils dependency. Fix some comments and remove an unneeded EntityTransaction variable. Change-Id: Ic0789d26f985a40a35f618343fa4e88aa473b2b3 Issue-ID: POLICY-582 Signed-off-by: Jim Hahn <jrh3@att.com>