aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm
AgeCommit message (Collapse)AuthorFilesLines
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 branchHOCKLA2-71/+69
Issue-ID: POLICY-1583 Change-Id: Ic46ffcb6eb5b0d18f9cb0a6a2ec46374e523f54a Signed-off-by: HOCKLA <ah999m@att.com>
2019-07-30Fix managed noop topic sourceJim Hahn1-0/+13
NOOP topic sources configured via TopicParameterGroup are left unmanaged. Removed a new override method, as it did not pass the "managed" flag down, while the method that already existed in the superclass already works correctly. Also restored "null" lists to TopicParameterGroup so-as not to break the behavior of its validate() method. Change-Id: Id392a3263c3bd1c8f278461715b441719817c47c Issue-ID: POLICY-1953 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-29Add addTopic(List<TopicParams>)Jim Hahn7-27/+225
New services are typically configured using TopicParameters. These are converted into Properties before being passed to TopicEndpoint.addTopic(), which then converts them into BusTopicParams before configuring a given topic. Added TopicEndpoint.addTopic(List<TopicParams>), which makes it possible to configure the topics without going into the intermediate Properties. Furthermore, because TopicParams is a subclass of BusTopicParams, no conversion is needed for that either, so the TopicParams can be passed directly into the configuration classes. Incorporated changes from review. Change-Id: Id87e2c6812e36ae1a3ac680e6b35208667971782 Issue-ID: POLICY-1953 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-05Fix sonar issues in policy/endpointsJim Hahn9-46/+45
Sonar fixes, other than code coverage. These changes are disruptive and will likely cause breakage in a number of policy repos. Renamed constants. Moved constants/factories from interfaces to classes. Change-Id: I182d50320aa6b53e383081af806c60dd2f806cbe Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-26Fix some sonar issues in policy-endpointsJim Hahn14-29/+50
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-06-12Apply simple sonar fixesJim Hahn10-14/+37
Note: A number of these were identified, by SonarLint, in the Test classes, which are not typically scanned by Sonar. Removed unnecessary imports. Removed unneeded "throws Xxx". Replaced lambda with method references. Replaced duplicate strings with constants. Replaced try-fail-catch with assert-j methods to eliminate sonar complaints about duplicate failure messages. Added missing @Override annotations. Use map.computeIfAbsent() where appropriate. Also fixed some minor checkstyle issues. Removed unneeded "volatile" declarations. Replaced some if-else constructs with "?:" construct, per sonar. Replaced Object.wait() with CountDownLatch.await(); according to sonar (and javadocs), Object.wait() can return due to "spurious wakeups". Fixed issue whereby CryptoUtilsTest wouldn't run in my Eclipse. Change-Id: Ib6b71ed65662cfd6209400dac57ed69279bf29ec Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-19Add method to support configure all topics at onceJorge Hernandez1-0/+11
regardless of type (source or sink) Change-Id: Idaebae611746e364364d35375519173a7461ae61 Issue-ID: POLICY-1608 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2019-03-18TopicSinkClient support for unmanaged topicsJorge Hernandez1-25/+21
Change-Id: I6b92dcc0f225aa712b34adb9a1f9ab47df412c81 Issue-ID: POLICY-1608 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2019-03-06Adding client class for sending message to topicramverma2-0/+185
1) Adding TopicSinkClient class for sending messages to topic. The same class will be used for PAP->PDP & PDP->PAP communication. 2) Once this review is through, will raise another one to remove PdpClient from policy/pap. Change-Id: I7253683d9e88885cfbe2ac9041d01da239b9321b Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-02-21Support for lab contextual topic names.Jorge Hernandez9-14/+88
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 Hahn9-14/+73
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>
2019-01-11Adding NOOP sources supportJorge Hernandez8-271/+803
In addition, Noop* classes have been refactored to increase code reuse and clean some checkstyle issues. Additional Junits have been added for existing functionality. Change-Id: I072f9ff2f415630ac82eca949a8360249f73da86 Issue-ID: POLICY-1397 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2019-01-08Replace expectException with AssertJJim Hahn5-50/+26
Change-Id: I73c186f181960ac7ac8cd985e55db1831963910f Issue-ID: POLICY-1392 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-11-06Update dmaap code for 1.1.9Pamela Dragosh2-5/+5
The new version has changed class names. Issue-ID: POLICY-1229 Change-Id: Id268b1a57667ffa3b5950dba7c10db2181586245 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-29Fix RestManager test issueJim Hahn1-0/+24
Apparently drools-pdp code depends on Dmaap topic factories throwing IllegalArgumentException instead of IllegalStateException (which is what the other topic factories throw) when an unknown topic name is requested. Therefore, the change to make them consistent has been backed out. Change-Id: Ia3d7e26a61027977eb626c9ddad6369982eae002 Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-28Add junit coverage to rest of policy-endpoint busJim Hahn28-637/+1610
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-28Merge "Add coverage for policy-endpoints bus"Jorge Hernandez7-0/+1254
2018-09-27Add coverage for policy-endpoints busJim Hahn7-0/+1254
Added license. Fix checkstyle warnings. Change-Id: I2279b8b80b3dc175583353ced3d71c3a5cc4f975 Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-27Added more coverage to policy-endpoints internalJim Hahn6-0/+873
Fixed checkstyle error. Change-Id: Ie6a85633bab098a30ccb2c1c309e1640aa1c8131 Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-26Add junit coverage to policy-commonJim Hahn6-0/+1141
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>