diff options
author | Jim Hahn <jrh3@att.com> | 2020-03-06 18:22:28 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-03-06 19:04:13 -0500 |
commit | 2440b81428fa4bfa28a51f87c58e12c78ced744b (patch) | |
tree | 61ca5668446ed47301ee3b2cca520cc7a83d46aa /models-interactions/model-actors/actor.aai/src | |
parent | 3c1fb89886d7ebf2efe1183e92b4ed8191f506b4 (diff) |
Add subrequest ID to OperationOutcome
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
Diffstat (limited to 'models-interactions/model-actors/actor.aai/src')
4 files changed, 6 insertions, 0 deletions
diff --git a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java index 5b4aa0527..9f8d30a26 100644 --- a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java +++ b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java @@ -92,6 +92,7 @@ public class AaiCustomQueryOperation extends HttpOperation<String> { @Override protected CompletableFuture<OperationOutcome> startOperationAsync(int attempt, OperationOutcome outcome) { + outcome.setSubRequestId(String.valueOf(attempt)); final Map<String, String> request = makeRequest(); Map<String, Object> headers = makeHeaders(); diff --git a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java index b527abc36..9ff56d61f 100644 --- a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java +++ b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java @@ -91,6 +91,7 @@ public class AaiGetOperation extends HttpOperation<StandardCoderObject> { @Override protected CompletableFuture<OperationOutcome> startOperationAsync(int attempt, OperationOutcome outcome) { + outcome.setSubRequestId(String.valueOf(attempt)); Map<String, Object> headers = makeHeaders(); diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java index c24e45db7..dae443593 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java @@ -127,6 +127,8 @@ public class AaiCustomQueryOperationTest extends BasicAaiOperation<Map<String, S // custom query response should have been cached within the context AaiCqResponse cqData = context.getProperty(AaiCqResponse.CONTEXT_KEY); assertNotNull(cqData); + + assertEquals("1", future2.get().getSubRequestId()); } /** diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java index 8e2633141..b0420456e 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java @@ -91,6 +91,8 @@ public class AaiGetOperationTest extends BasicAaiOperation<Void> { StandardCoderObject data = context.getProperty(AaiGetOperation.getTenantKey(TARGET_ENTITY)); assertNotNull(data); assertEquals(TEXT, data.getString(INPUT_FIELD)); + + assertEquals("1", future2.get().getSubRequestId()); } /** |