aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-02-10Merge "Add headers to asynchronous get in HttpClient"Ram Krishna Verma3-12/+22
2020-02-08Add enhancements to standard coderJim Hahn2-16/+101
Added support for array indices in StandardCoderObject getString(). Also made it Serializable. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ia514aed96fdfe7f635c5a6dc3e1f90939654d383
2020-02-08Add headers to asynchronous get in HttpClientJim Hahn3-12/+22
Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I61ef2fcfde5eb361652d2d6e3f55324af7ca7b4e
2020-02-03Merge "Fix ResourceUtilsTest junit"Pamela Dragosh1-6/+16
2020-02-03Merge "Add pretty() method to Coder"Pamela Dragosh7-9/+138
2020-01-31Add pretty() method to CoderJim Hahn7-9/+138
"Pretty" JSON is often needed, so added Coder.pretty() to facilitate that. Incorporated review comment(s): - changed pretty() to encode(object, pretty) Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I180fa6de416836008bf1c410132ae30f4dde9271
2020-01-31Fix ResourceUtilsTest junitJim Hahn1-6/+16
The junit for ResourceUtilsTest fails when run on a non-linux box due to the different path separator. Modified the test to normalize path names before making comparisons. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I58db71155d30b379e20e7c46bedfc6d79e26b6cb
2020-01-31Add async support to HttpClientJim Hahn3-8/+236
Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I0123b98e89b734efd264dd62080bb23573a7a3e6
2020-01-30Add Configurable to common/capabilitiesJim Hahn1-0/+43
Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Iab0ce1ba0c478d646546d02734228ef97d58b4c4
2020-01-30Merge "Add a bean validator"Pamela Dragosh4-6/+1093
2020-01-30Add a bean validatorJim Hahn4-6/+1093
Added a bean validator that will validate the fields within an arbitrary object using the annotations in the parameters package. Also added validateMap to the bean validators. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I2192f3d1ba735d3779c35711a7dba053918aa547
2020-01-29Convert double to int when decoding JSONJim Hahn2-2/+18
When decoding straight into a List or Map class, StandardCoder was not applying the double-to-int conversion. Fixed it. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I939e3378645d45ac98d2bca6b2a4076870a05626
2020-01-27Schema validation extension to StandardCoderjhh8-6/+357
Issue-ID: POLICY-2331 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ic3e8d21715d17a61ea5d07740dd9f4dd0dbb8641 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-01-23Merge "Create path to text file being created"Liam Fallon2-1/+25
2020-01-22Create path to text file being createdliamfallon2-1/+25
If you try and write to a file where part of the pat does not exist, that path should be created. Issue-ID: POLICY-1581 Change-Id: Ifb7a4ff4e1804814b6679956f0c58d5ac026c4a4 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-01-20Replace deprecated Nashorn javascript engineJim Hahn3-15/+21
Some test drivers use javascript to evaluate expected results. In java 8, the standard javascript engine was Nashorn, but that has been deprecated. As the test scripts use a simple xxx.yyy.zzz notation, decided to go with a small expression language, Apache JEXL, instead. Issue-ID: POLICY-2324 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Iffff468a880c612bdb31da84964dfa4132fa15e3
2020-01-14Sonar cleanup overrides and fixesPamela Dragosh9-34/+40
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-14Merge "Changed Matchers to ArgumentMatchers"Pamela Dragosh11-26/+26
2020-01-13Add method to return resource directory contentsliamfallon2-10/+144
In order to avoid hard coding the policy types and policies that are in the example directories into unit test cases, and in order to automatically pick up added and removed policy types and policies, it would be good to read the contents of resource directories at run time in unit tests. This change brings in that functionality into ResourceUtils. Issue-ID: POLICY-2315 Change-Id: I601718828aad0f065dbbaa1f5af8d0a0f133f44d Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-01-13Changed Matchers to ArgumentMatchersJim Hahn11-26/+26
Issue-ID: POLICY-1406 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I6d85bb10c15f9d82fa55d9328d18640098050dd9
2020-01-13Merge "Update sonar configuration"Ram Krishna Verma1-75/+1
2020-01-13Merge "Address items deprecated by move to java 11"Ram Krishna Verma5-32/+55
2020-01-10Fix mockito import in commonJim Hahn2-6/+11
ONAP-Logging was failing when using powermock-mockito2. This change also requires a property (version.javax.bind) to be added to the parent/integration pom. Issue-ID: POLICY-1406 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: If8813edaf86d84cff72c0e476ebf2a36bf5dcf18
2020-01-10Update sonar configurationPamela Dragosh1-75/+1
Sonarcloud upgrade resulted in new configuration property Removed deprecated properties No need for plugin configuration override of oparent Issue-ID: POLICY-2321 Change-Id: Ia294575d2ea0a589eab6797b48b8c1924f9f1b36 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-01-10Address items deprecated by move to java 11Jim Hahn5-32/+55
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 upgradesHOCKLA7-17/+23
Issue-ID: POLICY-1583 Change-Id: I6bcd320a6cdedd84dad9b54fdb4fec0cb8443b44 Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-16Update policy common for checkstyle 8liamfallon1-1/+0
Minor changes to clear down checkstyle warnings in policy common. Issue-ID: POLICY-206 Change-Id: Ifa6753bafdc4b2a9ee0725c4f3751c6eac03e096 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-12-16Added JDK 11 upgrades and point to parent java 11 branchHOCKLA9-97/+94
Issue-ID: POLICY-1583 Change-Id: Ic46ffcb6eb5b0d18f9cb0a6a2ec46374e523f54a Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-06Merge "Minor changes for new Eclipse checkstyle checks"Pamela Dragosh14-596/+960
2019-12-06Bumped policy/common patch version to 1.6.2-SNAPSHOTHOCKLA11-11/+11
Issue-ID: POLICY-1583 Change-Id: I4a1c5848f158d10b4b6f21f048f92d69ccc90a83 Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-06Release 1.6.1 policy/commonHOCKLA1-0/+4
This is a re-release, previous release wasn't pointing to an already installed release Issue-ID: POLICY-1583 Change-Id: I613dd5a78b439b60455be58b476204e422ebbf02 Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-06Point to 3.1.0 policy/parent to prep for re-releaseHOCKLA1-1/+1
Issue-ID: POLICY-1583 Change-Id: I1c65a4478d1121b863d29388bd3a7047d92ff5ea Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-06Minor changes for new Eclipse checkstyle checksliamfallon14-596/+960
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 upgradesHOCKLA11-12/+12
Issue-ID: POLICY-1583 Change-Id: I805ebed75e7e0cb5109946328958341018421aad Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-04Added a yaml file to release 1.6.0 policy/commonHOCKLA2-1/+5
Issue-ID: POLICY-1583 Change-Id: I20b608a6674a4496e5aa20fa3c26da2a275a289d Signed-off-by: HOCKLA <ah999m@att.com>
2019-11-04Make jersey-hk2 dependency non-testliamfallon1-2/+0
THis change will amke this dependency available to all components when using policy-endopints. Issue-ID: POLICY-2209 Change-Id: Ie3c6ca9d21327bdc54b5f14d64c41eed329941ad Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-11-01Add common Jersey versionliamfallon6-31/+28
Add a common version of Jersey for all Policy Framework components. Issue-ID: POLICY-2209 Change-Id: I8554a97e9f13887418118966bfe1043b65d9a179 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-10-29Fix new sonar issues in commonJim Hahn2-5/+5
Issue-ID: POLICY-2204 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: If0a11913f614e038ecd3e8c3f0b56d3ac78b03ec Signed-off-by: Jim Hahn <jrh3@att.com>
2019-10-29Merge "Cleanup eclipse warnings in common"Jorge Hernandez2-5/+1
2019-10-29Cleanup eclipse warnings in commonJim Hahn2-5/+1
Issue-ID: POLICY-2204 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: If55ea1a804997ab751f15813e6b643572d4f189f
2019-10-29Disable HTML escaping in gson codersJim Hahn3-6/+7
Issue-ID: POLICY-1869 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ic757d3a8e7e0e3537ecba979a919b9ea3c1aa797 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-10-24Integrate CryptoUtils into ONAP commonChou, Joseph (jc2555)2-0/+244
Update junit to add test cases Change-Id: If3236853138a05faac5f51a859b935265c14f0d6 Issue-ID: POLICY-1945 Signed-off-by: Chou, Joseph (jc2555) <jc2555@att.com>
2019-10-21Add CryptoCoder interfacejhh3-9/+45
This is to allow multiple supporting implementations. Issue-ID: POLICY-1945 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I42491e5671f561fe320f034bf8ffe03848dff43f Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-10-16Removed unthrown checked exceptions from CryptoUtils.jhh1-10/+3
additional minor javadoc clean up Issue-ID: POLICY-1945 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I23927b8c4dd63ed658e8062c87b4884ea1d31825
2019-09-16Eliminate constructors with side-effectsJim Hahn7-23/+41
Several of the Gson and Jackson handlers take a GsonBuilder, which they then configure with additional adapters prior to create a Gson object that they subsequently use. The code has been modified so that the constructors no longer take a GsonBuilder, thus eliminating the side-effects that they had on the builders. Instead, a configBuilder() method has been added to the handler classes that makes it clear tht they modify the GsonBuilder. This also has the advantage that classes that want a Gson object configured per a given handler need only call that handler's configBuilder() method; previously, they had to constructor the handler and then retrieve its gson object. Also updated a few tests to specify the HTTP "Accept" header to ensure that return results are in yaml format. Change-Id: I2ef98198041ff9f73913d01ee6ee14ecf20ba617 Issue-ID: POLICY-2081 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-13Extract YamlJsonTranslator from StandardYamlCoderJim Hahn17-334/+816
Refactored StandardYamlCoder, extracting a new class, YamlJsonTranslator, from it. This facilitates performing yaml translation when not using a standard "gson" coder. Added YamlJacksonHandler which supports YAML translation layered on top of a JacksonHandler instead of a GsonMessageBodyHandler. Also added junit tests to complete coverage of StandardCoder. Also added public APPLICATION_YAML to YamlMessageBodyHandler. Change-Id: Ia470fa194661fbf1aebeaf0f18b57f2a984cb64b Issue-ID: POLICY-2081 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-13Merge "Changes to accomodate to version of jetty"Jorge Hernandez1-6/+7
2019-09-13Merge "Remove YamlException class"Jim Hahn2-124/+0
2019-09-13Changes to accomodate to version of jettyJim Hahn1-6/+7
With a newer version of jetty being used, a couple of methods have been deprecated. Modified the code to use the facilities appropriate to the new jetty version. Change-Id: Idcaef11836841480c24b1721c06ed642d3d4394a Issue-ID: POLICY-2100 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-12Report bad-request for invalid YAMLJim Hahn8-61/+232
Added classes and modified code to report bad-request when a servlet attempts to read invalid YAML. Change-Id: Iacddee92a448fb69d5c778a3c3f3f2b5528983f7 Issue-ID: POLICY-2085 Signed-off-by: Jim Hahn <jrh3@att.com>