package org.onap.policy.controlloop.actor.so;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.mockito.Mock;
+import org.onap.policy.aai.AaiCqResponse;
import org.onap.policy.controlloop.actor.test.BasicHttpOperation;
import org.onap.policy.controlloop.actorserviceprovider.Util;
import org.onap.policy.controlloop.policy.Target;
public static final String MODEL_VERSION = "my-model-version";
public static final String MODEL_VERS_ID = "my-model-version-id";
public static final String SUBSCRIPTION_SVC_TYPE = "my-subscription-service-type";
+ public static final String MY_PATH = "my-path";
public static final String PATH_GET = "my-path-get/";
public static final int MAX_GETS = 3;
public static final int WAIT_SEC_GETS = 20;
+ public static final Integer VF_COUNT = 10;
@Mock
- protected SoOperator soOperator;
+ protected SoConfig config;
protected Target target;
protected SoResponse response;
* Initializes mocks and sets up.
*/
public void setUp() throws Exception {
- super.setUp();
+ super.setUpBasic();
response = new SoResponse();
when(rawResponse.getStatus()).thenReturn(200);
when(rawResponse.readEntity(String.class)).thenReturn(coder.encode(response));
- operator = soOperator;
-
- initOperator();
+ initConfig();
}
@Override
- protected void initOperator() {
- super.initOperator();
- when(soOperator.getMaxGets()).thenReturn(MAX_GETS);
- when(soOperator.getPathGet()).thenReturn(PATH_GET);
- when(soOperator.getWaitSecGet()).thenReturn(WAIT_SEC_GETS);
+ protected void initConfig() {
+ super.initConfig();
+ when(config.getClient()).thenReturn(client);
+ when(config.getPath()).thenReturn(MY_PATH);
+ when(config.getMaxGets()).thenReturn(MAX_GETS);
+ when(config.getPathGet()).thenReturn(PATH_GET);
+ when(config.getWaitSecGet()).thenReturn(WAIT_SEC_GETS);
}
@Override
}
@Override
- protected Map<String, String> makePayload() {
- Map<String, String> payload = new HashMap<>();
+ protected Map<String, Object> makePayload() {
+ Map<String, Object> payload = new HashMap<>();
// request parameters
SoRequestParameters reqParams = new SoRequestParameters();
return payload;
}
+
+ protected AaiCqResponse makeCqResponse() {
+ when(cqResponse.getVfModuleCount(any(), any(), any())).thenReturn(VF_COUNT);
+ return cqResponse;
+ }
}