import org.mockito.stubbing.Answer;
import org.onap.policy.common.endpoints.http.client.HttpClient;
import org.onap.policy.common.endpoints.http.client.HttpClientFactory;
-import org.onap.policy.controlloop.actorserviceprovider.impl.HttpOperator;
+import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig;
/**
* Superclass for various HttpOperation tests.
@Captor
protected ArgumentCaptor<InvocationCallback<Response>> callbackCaptor;
-
@Captor
protected ArgumentCaptor<Entity<Q>> requestCaptor;
-
@Captor
protected ArgumentCaptor<Map<String, Object>> headerCaptor;
+ @Mock
+ protected HttpConfig config;
@Mock
protected HttpClient client;
-
@Mock
protected HttpClientFactory factory;
-
@Mock
protected Response rawResponse;
- @Mock
- protected HttpOperator operator;
-
/**
* Constructs the object using a default actor and operation name.
/**
* Initializes mocks and sets up.
*/
- public void setUp() throws Exception {
- super.setUp();
+ @Override
+ public void setUpBasic() {
+ super.setUpBasic();
when(factory.get(MY_CLIENT)).thenReturn(client);
when(client.getBaseUrl()).thenReturn(BASE_URI);
- initOperator();
+ initConfig();
}
/**
- * Initializes an operator so that it is "alive" and has the given names.
+ * Initializes a configuration.
*/
- protected void initOperator() {
- when(operator.isAlive()).thenReturn(true);
- when(operator.getFullName()).thenReturn(actorName + "." + operationName);
- when(operator.getActorName()).thenReturn(actorName);
- when(operator.getName()).thenReturn(operationName);
- when(operator.getClient()).thenReturn(client);
- when(operator.getPath()).thenReturn(PATH);
+ protected void initConfig() {
+ when(config.getClient()).thenReturn(client);
+ when(config.getPath()).thenReturn(PATH);
}
/**