diff options
author | Jim Hahn <jrh3@att.com> | 2020-02-12 13:01:57 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-02-12 14:29:21 -0500 |
commit | 3b4884e5688a71116b3935e3a4ad243ab6287c80 (patch) | |
tree | dfd320bef72050eabfb43e449cf644d4b3824b54 /models-interactions/model-actors/actor.test/src/test | |
parent | 35867f2e63c26d47417bfefc9a0912f17c4a873a (diff) |
Add A&AI actor and some operators
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
Diffstat (limited to 'models-interactions/model-actors/actor.test/src/test')
-rw-r--r-- | models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java b/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java index c33483d26..1de2f923d 100644 --- a/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java +++ b/models-interactions/model-actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/BasicHttpOperationTest.java @@ -24,7 +24,11 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; +import javax.ws.rs.client.InvocationCallback; +import javax.ws.rs.core.Response; import org.junit.Before; import org.junit.Test; @@ -55,7 +59,7 @@ public class BasicHttpOperationTest { } @Test - public void testSetUp() { + public void testSetUp() throws Exception { assertNotNull(oper.client); assertSame(oper.client, oper.factory.get(BasicHttpOperation.MY_CLIENT)); assertEquals(200, oper.rawResponse.getStatus()); @@ -101,4 +105,23 @@ public class BasicHttpOperationTest { assertTrue(oper.makeEnrichment().isEmpty()); } + @Test + public void testProvideResponse() throws Exception { + InvocationCallback<Response> cb = new InvocationCallback<>() { + @Override + public void completed(Response response) { + // do nothing + } + + @Override + public void failed(Throwable throwable) { + // do nothing + } + }; + + + when(oper.client.get(any(), any(), any())).thenAnswer(oper.provideResponse(oper.rawResponse)); + + assertSame(oper.rawResponse, oper.client.get(cb, null, null).get()); + } } |