Moving common polling code into HttpOperation
[policy/models.git] / models-interactions / model-actors / actor.vfc / src / test / java / org / onap / policy / controlloop / actor / vfc / RestartTest.java
index d8ba7e4..ed072f7 100644 (file)
@@ -32,6 +32,8 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
+import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpPollingConfig;
+import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpPollingParams;
 import org.onap.policy.controlloop.policy.PolicyResult;
 import org.onap.policy.vfc.VfcRequest;
 import org.onap.policy.vfc.VfcResponse;
@@ -66,10 +68,12 @@ public class RestartTest extends BasicVfcOperation {
      */
     @Test
     public void testSuccess() throws Exception {
-        VfcParams opParams = VfcParams.builder().clientName(MY_CLIENT).path("ns").pathGet("jobs").maxGets(1).build();
-        config = new VfcConfig(blockingExecutor, opParams, HttpClientFactoryInstance.getClientFactory());
+        HttpPollingParams opParams = HttpPollingParams.builder().clientName(MY_CLIENT).path("ns").pollPath("jobs")
+                        .maxPolls(1).build();
+        config = new HttpPollingConfig(blockingExecutor, opParams, HttpClientFactoryInstance.getClientFactory());
 
         params = params.toBuilder().retry(0).timeoutSec(5).executor(blockingExecutor).build();
+
         restartOper = new Restart(params, config);
 
         outcome = restartOper.start().get();
@@ -81,7 +85,7 @@ public class RestartTest extends BasicVfcOperation {
     public void testConstructor() {
         CompletableFuture<OperationOutcome> futureRes = restartOper.startOperationAsync(1, outcome);
         assertNotNull(futureRes);
-        assertEquals(0, restartOper.getGetCount());
+        assertEquals(0, restartOper.getPollCount());
     }
 
     @Test