aboutsummaryrefslogtreecommitdiffstats
path: root/integrity-monitor
AgeCommit message (Collapse)AuthorFilesLines
2020-06-18Changes for checkstyle 8.32liamfallon2-3/+3
Issue-ID: POLICY-2188 Change-Id: I00843c61a6567001fc35c3ebb77b6843a1eb7da2 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-06-17Cleanup various sonar issues in policy-commonJim Hahn8-95/+96
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-06-12Merge "Remove logback.xml files bundled as part of jar"Ram Krishna Verma1-259/+0
2020-06-12Remove logback.xml files bundled as part of jara.sreekumar1-259/+0
Change-Id: Ia98493a3ec6ad91a46c88ab71998eb039da44842 Issue-ID: POLICY-2627 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-06-11Removing log4j from policy/commonuj426b1-4/+0
Change-Id: Ib662556533f72c99180b611d0a1933f20e231b2c Issue-ID: POLICY-2623 Signed-off-by: uj426b <uj426b@att.com>
2020-05-19Bump common master to 1.7.0Pamela Dragosh1-1/+1
Issue-ID: POLICY-2514 Change-Id: Ic7bcf44a9f0c887d6c99edb8609725a15c4aa9a7 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-05-05Bump common to 1.6.6-SNAPSHOTPamela Dragosh1-1/+1
Issue-ID: POLICY-2514 Change-Id: Ied6a2571a0f1008eefa87b8aefdde12bd494a79b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-04-14Bump common to 1.6.5-SNAPSHOTRam Krishna Verma1-1/+1
Issue-ID: POLICY-2378 Change-Id: I0012a2cd7acbb9d634b1fc7226992b873142016a Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-04-10Bump common to 1.6.4-SNAPSHOTPamela Dragosh1-1/+1
Issue-ID: POLICY-2378 Change-Id: Ib3afcf81460f42e1a62d51a484184763d61dace6 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-04-09rename jpa persistence filejhh3-0/+6
After inspecting the fat jar generated by brmsgw, noticed that the persistence.xml included from here it was overriden by another one, therefore the persistence unit was not available. This may solve the issue for the brmsgw, as with a far jar build, there are the risks of collisions such as this of files with the same name. Issue-ID: POLICY-2471 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I91cf2b6d3d2f5086d77795e08800ca96d984c214
2020-04-06Address sonar issues in commonJim Hahn2-77/+98
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-03-27More sonar issues cleanupPamela Dragosh2-8/+6
Either log or rethrow Use boolean expression Add at least one test Remove commented out code Issue-ID: POLICY-2204 Change-Id: I4fdf31aea75303e4f49d25198eb3b12341995bfe Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-24Sonar and eclipse warnings commonPamela Dragosh1-110/+85
Unused imports Not enough arguments Issue-ID: POLICY-2204 Change-Id: I6405cb697ea976096b1276e2291b1c73617d33b5 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-20Bump common to 1.6.3-SNAPSHOTPamela Dragosh1-1/+1
Released 1.6.2 Issue-ID: POLICY-2378 Change-Id: I12c93a88af2b00c25d457ff9aa9e50c1845e004c Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-01-14Sonar cleanup overrides and fixesPamela Dragosh1-2/+2
Removal of UTF-8 because its already set capabilities doesn't generate any code, no need to include override false positives for passwords etc. override for logging and exception throw that we want add synchronized to overrides that are synchronized ignore checking of some conditions adding synchronized to match set* methods Issue-ID: POLICY-2321 Change-Id: I26d9ca22a0cdd67fdaae9c44b718b8dc103f190e Signed-off-by: Pamela Dragosh <pdragosh@research.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 Hahn3-28/+48
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
2020-01-09policy/common jdk11 upgradesHOCKLA1-2/+2
Issue-ID: POLICY-1583 Change-Id: I6bcd320a6cdedd84dad9b54fdb4fec0cb8443b44 Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-06Merge "Minor changes for new Eclipse checkstyle checks"Pamela Dragosh2-136/+193
2019-12-06Bumped policy/common patch version to 1.6.2-SNAPSHOTHOCKLA1-1/+1
Issue-ID: POLICY-1583 Change-Id: I4a1c5848f158d10b4b6f21f048f92d69ccc90a83 Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-06Minor changes for new Eclipse checkstyle checksliamfallon2-136/+193
The laest Eclipse checkstyle version 8.26.0 does more thorough checking and identified a number of small issues in the apex-pdp codebase. This review fixes those issues. logging pattern in logback.xml files amended to be less than 120 characters. Test case added for checking parameter is valid. Issue-ID: POLICY-2204 Change-Id: Id7293e44b56c225afc6290e1c599603e9ebedb19 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-12-05Changed project version to 1.6.1-SNAPSHOT to isolate for java 11 upgradesHOCKLA1-1/+1
Issue-ID: POLICY-1583 Change-Id: I805ebed75e7e0cb5109946328958341018421aad Signed-off-by: HOCKLA <ah999m@att.com>
2019-09-06Bump version in policy/common masterJim Hahn1-1/+1
Change-Id: If86cac60ee143b1d8ae92fd3893ea33a0d3e1b81 Issue-ID: POLICY-2045 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-27Remove AlertSeverity from logback in policy/commonJim Hahn1-35/+35
Replaced AlertSeverity with severity in logback xml files, because the MDC only has severity. Change-Id: I118b195b65555c915c723faf117c4f4854e990f3 Issue-ID: POLICY-1989 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-02Bump version in policy/commonJim Hahn1-1/+1
Change-Id: I7efbdf7c36907eb10ae5ce4c9d7d4988d7e2d68a Issue-ID: POLICY-1965 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-15Combine lines in IM state transition tableJim Hahn2-727/+172
Rewrote the code to generate the Integrity Monitor state transition table, eliminating duplicate lines. Output the table, before and after the change, and verified that they were identical, with one exception: there were two places where the original code had "StandbyStateException", while all of the others had "StandbyStatusException". Guessing that the original code was incorrect in these two cases, I changed the new code to always use "StandbyStatusException" instead. Change-Id: Ibe3044eb1ac398a0bc8f328f4e14305d4bdeb380 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-05Fix sonar issues in Integrity MonitorJim Hahn5-303/+337
Fixed most sonar issues, except for code coverage. Change-Id: I473635d896797b2290920da86c6770848bc2e883 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-24Fix more sonar issues in Integrity Audit & MonitorJim Hahn6-898/+382
Removed duplicate code in DbDao by refactoring common code into a new updateIae() method. Removed duplicate code in IntegrityMonitor by refactoring common code into a new withinTransaction() method. Removed duplicate code in StateManagementEntity, StateElement by replacing with lombok Getter & Setter annotations. Removed duplicate code in StateManagement by refactoring common code into new setState() and getState() methods. Also removed logger.isDebugEnabled() tests. Added coverage for StateChangeNotifier. Change-Id: I2e29b836dafc5de569a2267206a6a34105e44021 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-21Fix sonar issues in integrity monitorJim Hahn12-2623/+2563
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>
2019-06-21Bump common to 1.5.1 SNAPSHOTPamela Dragosh1-1/+1
Released 1.5.0 Issue-ID: POLICY-1737 Change-Id: I51b1c264d52cab2b2501dce7c5b0e7805d39ad5c Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-06-13More sonar fixes in policy/commonJim Hahn5-157/+137
Note: this does not increase code coverage, but should fix other code issues. Resolved cyclomatic complexity issue in ParameterValidationResult. Refactored duplicate code in GroupValidationResult. Removed IOException from NetworkUtil "throws". Replaced null/empty string tests with StringUtils.isBlank(). Added @FunctionalInterface where needed. Replaced anonymous classes with lambda expressions. Replaced duplicate strings with a constant. Added private constructors for utility classes. Removed sleep() from tests. Removed unused parameter from method call. Made some protected methods private. Compute integrity monitor's state-transition table once. Use for-loop instead of iterator. Moved constructors. Fixed some checkstyle issues (tabs => spaces, trailing spaces). Change-Id: I9a962ca45c4ff3f212c6014da799d06f07b232ef Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-05-28Change version to 1.5.0Pamela Dragosh1-1/+1
Upgrade minor review for El Alto. Update to policy/parent Issue-ID: POLICY-1747 Change-Id: I5c54479d7b1e1951e52580c40127177e5f6d389d Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-05-01Bump common snapshotPamela Dragosh1-1/+1
In prep for next version. Issue-ID: POLICY-1700 Change-Id: I4dec2414dbd3d0d941bf24e9cd359265d7105371 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-11-27Remove Factory from IntegrityMonitorJim Hahn4-90/+48
Also removed unneeded method override in junit test. Change-Id: I7186e9f75443f7b8ba8376aa0e00a5cf4c573696 Issue-ID: POLICY-1287 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-11-27Fix checkstyle issue in policy commonKrishnakumar Jinka3-110/+101
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-10-31Set new master version for Dublinliamfallon1-4/+3
Issue-ID: POLICY-1232 Change-Id: Icb6179ace3f320bdda3da2160afd2d058762ae5e Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-10-24Fix refering to snapshot in policy/common1.3.1ramverma1-1/+1
Issue-ID: POLICY-1213 Change-Id: Id34f28a3f41687993009128940e9ddec69d5b88f Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
2018-10-05Remove constraintsPamela Dragosh1-2/+1
Sonar is flagging the null checks. Issue-ID: POLICY-1130 Change-Id: I4ab94b3db79d4089f20afaf3f80f3c925541084a Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-10-01Fix minor sonarPamela Dragosh4-104/+125
These are mainly duplicate strings. But also combined if statements and fixing some debug messages missing arguments or format specifiers. Some duplicates I left alone as it seemed unreadable to change them. Also moving variables to their correct place (before constructors). Issue-ID: POLICY-1130 Change-Id: I8018c676b22fe8fec635f129fa37921ad1004569 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-26Use powermock version from parent pomJim Hahn1-5/+0
Change-Id: I84fd562e7050508a75b4192ba162a09acd938986 Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-14Fixes for checkstyle issuesPamela Dragosh6-10/+24
More fixes for spacing, adding comments, adding period at the end, and move code closer to usage. Issue-ID: POLICY-881 Change-Id: Ife99eaf627a221e87d65d24dfd145b0ee4e06d21 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-06-21IntegrityMonitor: remove sleep from junit testsJim Hahn12-195/+300
Modified the code to use a CurrentTime object for its "time" operations (e.g., sleep(), currentTimeInMillis()). Modified junit tests to replace the CurrentTime object with TestTime objects so they don't actually do any sleeping. Update license date. Remove unneeded dependency from pom. Don't start FpManager thread within its own constructor. toMillis() should handle -1 as an input. Fix comment in test base superclass. Change time units in test base from DAYS to MILLISECONDS. Change-Id: Id6a4edb1747ca1a683e5d37522872b781294532d Issue-ID: POLICY-908 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-06-20IntegrityMonitory - remove latch for non-test codeJim Hahn3-67/+93
Change-Id: I95ebcf8aabfa01eb6453a4ba5dd88d11c8f025c9 Issue-ID: POLICY-908 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-06-08Remove "&quot;" from logback xml filesJim Hahn1-2/+2
Logback complains if %d{} values contain "&quot;", but it works fine without them, thus they have been removed. Update license header. Change-Id: Ie72cc5ec922c161e1fd5058021a57282c4f0134b Issue-ID: POLICY-785 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-06-05Update policy-common to SNAPSHOT-1.3.0liamfallon1-1/+1
Snapshot updated for Casablanca. Change-Id: Ife941f771b02be68e35fd638adfac78cf2b3ba99 Issue-ID: POLICY-875 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-05-21Use ${POLICY_LOGS} for log directoryv1.2.32.0.0-ONAPbeijing2.0.0-ONAPJim Hahn1-3/+3
Update license date. Change-Id: I912e1d8ab56b124178b4bfdd8646ee62b48b386c Issue-ID: POLICY-759 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-05-21Update Policy Common to 1.2.3-SNAPSHOTliamfallon1-1/+1
These reviews must be merged in order because of layering. This review should be merged FIRST. Issue-ID: POLICY-844 Change-Id: I7cf07902c3b2d7766dc64f1c1dd80d91dee18467 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-05-16Upgrade SNAPSHOT to 1.2.2liamfallon1-1/+1
These reviews must be merged in order because of layering. This review should be merged FIRST Change-Id: If143b2d23487c073fafad8f6208cd8d320ec98e9 Issue-ID: POLICY-798 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-04-13Upgrade SNAPSHOT to 1.2.1Pamela Dragosh1-1/+1
Issue-ID: POLICY-736 Change-Id: Iccb43b692908ffc35fc0d18da1e967718e3c3519 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-03-20Removed checkstyle warningsmmis29-7603/+7889
Removed checkstyle warnings in policy/common/im Issue-ID: POLICY-695 Change-Id: I32b4797249386c0d1bd0f50792880a1759503a67 Signed-off-by: mmis <michael.morris@ericsson.com>