summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.so/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-actors/actor.so/src/test')
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/BasicSoOperation.java4
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java17
2 files changed, 19 insertions, 2 deletions
diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/BasicSoOperation.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/BasicSoOperation.java
index 0232226e0..aaecb46a8 100644
--- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/BasicSoOperation.java
+++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/BasicSoOperation.java
@@ -96,11 +96,11 @@ public abstract class BasicSoOperation extends BasicHttpOperation<SoRequest> {
.serializationProvider(GsonMessageBodyHandler.class.getName()).build();
HttpClientFactoryInstance.getClientFactory().build(clientParams);
- SoSimulatorJaxRs.setYieldIncomplete(true);
+ SoSimulatorJaxRs.setRequirePolling(true);
}
protected static void destroyAfterClass() {
- SoSimulatorJaxRs.setYieldIncomplete(false);
+ SoSimulatorJaxRs.setRequirePolling(false);
HttpClientFactoryInstance.getClientFactory().destroy();
HttpServletServerFactoryInstance.getServerFactory().destroy();
}
diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java
index 70093967c..644521869 100644
--- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java
+++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoOperationTest.java
@@ -32,6 +32,8 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import java.time.LocalDateTime;
+import java.time.Month;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@@ -46,6 +48,7 @@ import org.onap.aai.domain.yang.GenericVnf;
import org.onap.aai.domain.yang.ServiceInstance;
import org.onap.aai.domain.yang.Tenant;
import org.onap.policy.aai.AaiCqResponse;
+import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.controlloop.ControlLoopOperation;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
@@ -422,4 +425,18 @@ public class SoOperationTest extends BasicSoOperation {
when(cq.getDefaultCloudRegion()).thenReturn(region);
assertSame(region, oper.getDefaultCloudRegion(cq));
}
+
+ @Test
+ public void testMakeCoder() throws CoderException {
+ Coder opcoder = oper.makeCoder();
+
+ // ensure we can decode an SO timestamp
+ String json = "{'request':{'finishTime':'Fri, 15 May 2020 12:14:21 GMT'}}";
+ SoResponse resp = opcoder.decode(json.replace('\'', '"'), SoResponse.class);
+
+ LocalDateTime tfinish = resp.getRequest().getFinishTime();
+ assertNotNull(tfinish);
+ assertEquals(2020, tfinish.getYear());
+ assertEquals(Month.MAY, tfinish.getMonth());
+ }
}