aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.test/src
AgeCommit message (Collapse)AuthorFilesLines
2020-03-06Add subrequest ID to OperationOutcomeJim Hahn1-0/+1
Rule notifications need the subrequest ID to be populated in the OperationOutcome object, where possible. Issue-ID: POLICY-2385 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ic44320f67ad8df7bcb3000cfa667f95427818e71
2020-03-06Log full URL for REST callsJim Hahn1-2/+2
Actors only log the URI, without the host and port info. Modified to log the full URL. Also adjusted URLs for trailing "/". Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I0c9a2d139258ef23bc363a873b56f5cb4680247d
2020-03-05Add SO VF Module Delete OperationJim Hahn1-0/+3
Redesigned the SO Operation classes; moved some code from the subclass to the superclass so it could be reused by the VF Module Delete Operation. JerseyClient does not support DELETE with a request body, so had to implement a delete() method using java11 HttpClient. Fix some issues found while testing with drools-apps. Added "delete" operation to SO simulator. Issue-ID: POLICY-2371 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I269fe13cf90c295ec2bbac92bc5a59b3820ea265
2020-03-03Translate APPC Instant to LongJim Hahn1-1/+1
APPC uses encode Instant fields as milliseconds instead of as ISO date strings. Issue-ID: POLICY-2363 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Id9bedb11c43264f882b6fd044155621c8ccc79f6
2020-03-03Fix path issuesJim Hahn1-1/+30
A&AI tenant query is prepending the target entity with "/", but it should not. Fixed it. Modified A&AI and SO actors to get path prefixes from parameters. Fixed a bug in an A&AI simulator response (extra "}" at the end. Issue-ID: POLICY-2349 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I71f8b1e5fb8a4bd29b4f616a7757d366c7d58127
2020-02-26Change ActorService config to Map<String,Object>Jim Hahn1-1/+1
It's a bit of a pain to pass Map<String, Map<String,Object>> to the ActorService configure() method. Changed it to simply take a Map<String,Object>, as it had been in a previous iteration. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ib6e703115027bc4919cc93762ca5b38d254f2b8f
2020-02-21Change payload to Map<String,Object> so it's more versatileJim Hahn11-1/+499
This was supposed to be two separate commits, but I goofed something. Added guard query to Operation superclass. Modified VfModuleCreate to store the VF count, pass it to the guard, and bump it once the create completes successfully. Added code to check Actors for proper plug-in to ActorService. Renamed "operation" property to "operations", to be more consistent with other parameters (e.g., TopicParameterGroup). The META-INF/services files for the actors had mixed case, which did not match the package name of the Actor class, preventing the ServiceLoader from recognizing them. Also modified the ActorService to skip any that cannot actually be loaded, for whatever reason (e.g., not in the classpath). Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ifa97744543f2866cc553138ec5ec644b033de780
2020-02-20More actor clean-upJim Hahn6-78/+42
Currently, Operator classes refer to Operation classes, and vice versa, creating a dependency cycle. In addition, there is a slight problem in that if an operator is reconfigured, any running operation may get inconsistent configuration data. Modified the code to create Config objects that are passed to the operation, instead of passing the Operator to the operations. This solved both issues. Replaceed makeOperator() with constructors. Added parameter type to HttpActors. Modified guard to get "ONAP" properties from its configuration, as a default. Changed setUp() to setUpBasic(), so "throws Exception" could be removed, thus resolving a sonar issue. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I21eb8798acfbc636ff1bd8741b21c7278365b6e4
2020-02-18Validate request content of various actorsJim Hahn8-185/+310
Created common junit superclass, BasicOperation, containing verifyRequest() method, among others. Issue-ID: POLICY-2363 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I7ff4428e94bfd301ff4194e1766ef61906714dcf
2020-02-17More changes to actor codeJim Hahn3-1/+322
Use Coder.convert() from policy-common. Passed response to setOutcome(). Changed class names from XxxOperator to XxxOperation. Modified SDNC junits to invoke start() instead of startOperationAsync(). Changed context obtain() to re-run if the future was canceled. Added junit support class, BasicBidirectionalTopicOperation. Modified HttpOperation to allow subsequent requests to be issued. Some actors, like SO, send an initial HTTP request and then follow it with HTTP "are you done?" requests. Issue-ID: POLICY-2363-prop Change-Id: I12b5c2d4f07254e0cb79fabfe1ccf844b70a0654 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-02-17Use BidirectionalTopicClient from policy-commonJim Hahn2-2/+10
Also modified "target" to sink in various places, and renamed various uses of "pair" to "bidirectional" (e.g., TopicPairParams => BidirectionalTopicParams). Also replaced MyExec with PseudoExecutor, from policy-common. As part of this, extracted the logRequest and logResponse methods from the Http and Topic classes, moving them into the common OperationPartial class. Modified A&AI, SDNC junit tests to use PseudoExecutor. Added support for incomplete responses on Topics, where multiple responses may be received for one request Fixed a duplicate entry in actor.aai pom. As the changes were already big enough, went ahead and also did the following to support the APPC Actor: - Reorganized parameter classes and content. - Modified anyOf, allOf to take functions instead of futures and handle exceptions thrown by any of the functions. Also added sequence() method. - Deleted doTask. - Modified ActorService.config to take a map of maps, not just a map. - Decided NOT to move anyOf, allOf, and sequence from OperationPartial to a utility class, because they depend on "params". Issue-ID: POLICY-2363 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I5a8bae05dfef22fe71c57c58f265b9dac20df5c5
2020-02-12Add A&AI actor and some operatorsJim Hahn2-1/+39
Added A&AI Actor, as well as operators for the "custom query" and the "tenant" query (on which the custom query depends). Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ic9dadc07a6057cb1abb9698da86eb9431fc9ed3e
2020-02-11Add more code to facilitate actor implementationJim Hahn2-0/+273
Added obtain() to Context Added startGuardAsync(), in anticipation of adding guards. Moved logRestXxx() from Util to HttpOperation. Added actor.test to facilitate testing of actors. Changed timeoutSec from long to int in various places. Made a couple of methods public to support junit testing. Most of the methods required Params to be passed, which indicated a design issue. Split Operator and Operation so that the Params could be kept in a field and thus need not be passed to every method. Basically, renamed OperatorPartial.java to OperationPartial.java and created a new OperatorPartial.java. Of course, this makes it look to gerrit like it's all new code, when in fact, most of it is unchanged, other than removing the Params argument to the method calls. That accounts for about half of the "lines changed" count. Issue-ID: POLICY-1625 Change-Id: I9e98c9dadcbed145bf84deb06c9db1c864a3c24a Signed-off-by: Jim Hahn <jrh3@att.com>