summaryrefslogtreecommitdiffstats
path: root/so-monitoring/so-monitoring-handler/src/test
diff options
context:
space:
mode:
authorwaqas.ikram <waqas.ikram@est.tech>2019-03-22 14:39:44 +0000
committerwaqas.ikram <waqas.ikram@est.tech>2019-03-22 14:39:44 +0000
commit314bba3a72c1b1122668950005a2e754f8c5c5cc (patch)
tree7e7e84a3808c243dc185f0cfc8f797dfd2961425 /so-monitoring/so-monitoring-handler/src/test
parent34261b6425e1a8e22b172be2b5d9e1c2d8d243a9 (diff)
Created new BB for so-etsi
Change-Id: I9bf6b4019c280b816925ee5e0d826bff69cb1583 Issue-ID: SO-1621 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
Diffstat (limited to 'so-monitoring/so-monitoring-handler/src/test')
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java2
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java12
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java19
3 files changed, 17 insertions, 16 deletions
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java
index 1b3e168c12..9df24c1921 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java
@@ -23,7 +23,7 @@ import static org.junit.Assert.assertNotNull;
import org.junit.Test;
import org.onap.so.monitoring.configuration.rest.HttpServiceProviderConfiguration;
-import org.onap.so.monitoring.rest.service.HttpRestServiceProvider;
+import org.onap.so.rest.service.HttpRestServiceProvider;
import org.springframework.web.client.RestTemplate;
/**
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java
index 58666671a7..3a7ce18bf7 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java
@@ -38,7 +38,7 @@ import org.onap.so.monitoring.configuration.database.DatabaseUrlProvider;
import org.onap.so.monitoring.db.service.DatabaseServiceProvider;
import org.onap.so.monitoring.db.service.DatabaseServiceProviderImpl;
import org.onap.so.monitoring.model.SoInfraRequest;
-import org.onap.so.monitoring.rest.service.HttpRestServiceProvider;
+import org.onap.so.rest.service.HttpRestServiceProvider;
import com.google.common.base.Optional;
@@ -57,8 +57,8 @@ public class DatabaseServiceProviderTest {
final String searchUrl = URL_PROVIDER.getSearchUrl(0, 0, null);
final Optional<SoActiveInfraRequests[]> response = Optional.of(new SoActiveInfraRequests[] {});
- when(mockServiceProvider.postHttpRequest(eq(Collections.emptyMap()), eq(searchUrl),
- eq(SoActiveInfraRequests[].class))).thenReturn(response);
+ when(mockServiceProvider.post(eq(Collections.emptyMap()), eq(searchUrl), eq(SoActiveInfraRequests[].class)))
+ .thenReturn(response);
final DatabaseServiceProvider objUnderTest = new DatabaseServiceProviderImpl(URL_PROVIDER, mockServiceProvider);
@@ -71,8 +71,8 @@ public class DatabaseServiceProviderTest {
final String searchUrl = URL_PROVIDER.getSearchUrl(0, 0, null);
final Optional<SoActiveInfraRequests[]> response = Optional.absent();
- when(mockServiceProvider.postHttpRequest(eq(Collections.emptyMap()), eq(searchUrl),
- eq(SoActiveInfraRequests[].class))).thenReturn(response);
+ when(mockServiceProvider.post(eq(Collections.emptyMap()), eq(searchUrl), eq(SoActiveInfraRequests[].class)))
+ .thenReturn(response);
final DatabaseServiceProvider objUnderTest = new DatabaseServiceProviderImpl(URL_PROVIDER, mockServiceProvider);
@@ -94,7 +94,7 @@ public class DatabaseServiceProviderTest {
final HttpRestServiceProvider mockServiceProvider = mock(HttpRestServiceProvider.class);
- when(mockServiceProvider.postHttpRequest(eq(filters), eq(searchUrl), eq(SoActiveInfraRequests[].class)))
+ when(mockServiceProvider.post(eq(filters), eq(searchUrl), eq(SoActiveInfraRequests[].class)))
.thenReturn(response);
final DatabaseServiceProvider objUnderTest = new DatabaseServiceProviderImpl(URL_PROVIDER, mockServiceProvider);
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java
index c3930df196..d21cf6d02b 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java
@@ -38,6 +38,7 @@ import org.onap.so.monitoring.model.ActivityInstanceDetail;
import org.onap.so.monitoring.model.ProcessDefinitionDetail;
import org.onap.so.monitoring.model.ProcessInstanceIdDetail;
import org.onap.so.monitoring.model.ProcessInstanceVariableDetail;
+import org.onap.so.rest.service.HttpRestServiceProvider;
import com.google.common.base.Optional;
@@ -65,7 +66,7 @@ public class CamundaProcessDataServiceProviderTest {
public void test_GetProcessInstanceDetail_EmptyResponse() {
final Optional<ProcessInstance[]> response = Optional.<ProcessInstance[]>absent();
final String url = CAMUNDA_REST_API_URL + DEFAULT + "/history/process-instance?variables=requestId_eq_" + ID;
- when(httpRestServiceProvider.getHttpResponse(url, ProcessInstance[].class)).thenReturn(response);
+ when(httpRestServiceProvider.get(url, ProcessInstance[].class)).thenReturn(response);
final CamundaProcessDataServiceProvider objUnderTest =
new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
@@ -77,7 +78,7 @@ public class CamundaProcessDataServiceProviderTest {
public void test_GetProcessInstanceDetail_NonEmptyResponseWithSuperProcessIdNull() {
final Optional<ProcessInstance[]> response = Optional.of(getProcessInstance());
final String url = CAMUNDA_REST_API_URL + DEFAULT + "/history/process-instance?variables=requestId_eq_" + ID;
- when(httpRestServiceProvider.getHttpResponse(url, ProcessInstance[].class)).thenReturn(response);
+ when(httpRestServiceProvider.get(url, ProcessInstance[].class)).thenReturn(response);
final CamundaProcessDataServiceProvider objUnderTest =
new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
@@ -92,7 +93,7 @@ public class CamundaProcessDataServiceProviderTest {
public void test_GetProcessInstanceDetail_NonEmptyResponseWithSuperProcessIdNotNull() {
final Optional<ProcessInstance[]> response = Optional.of(getProcessInstance(SUPER_PROCESS_ID));
final String url = CAMUNDA_REST_API_URL + DEFAULT + "/history/process-instance?variables=requestId_eq_" + ID;
- when(httpRestServiceProvider.getHttpResponse(url, ProcessInstance[].class)).thenReturn(response);
+ when(httpRestServiceProvider.get(url, ProcessInstance[].class)).thenReturn(response);
final CamundaProcessDataServiceProvider objUnderTest =
new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
@@ -105,7 +106,7 @@ public class CamundaProcessDataServiceProviderTest {
public void test_GetProcessDefinition_EmptyResponse() {
final Optional<ProcessDefinition> response = Optional.<ProcessDefinition>absent();
final String url = CAMUNDA_REST_API_URL + DEFAULT + "/process-definition/" + ID + "/xml";
- when(httpRestServiceProvider.getHttpResponse(url, ProcessDefinition.class)).thenReturn(response);
+ when(httpRestServiceProvider.get(url, ProcessDefinition.class)).thenReturn(response);
final CamundaProcessDataServiceProvider objUnderTest =
new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
@@ -117,7 +118,7 @@ public class CamundaProcessDataServiceProviderTest {
public void test_GetProcessDefinition_NonEmptyResponse() {
final Optional<ProcessDefinition> response = getProcessDefinition();
final String url = CAMUNDA_REST_API_URL + DEFAULT + "/process-definition/" + PROCESS_ID + "/xml";
- when(httpRestServiceProvider.getHttpResponse(url, ProcessDefinition.class)).thenReturn(response);
+ when(httpRestServiceProvider.get(url, ProcessDefinition.class)).thenReturn(response);
final CamundaProcessDataServiceProvider objUnderTest =
new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
@@ -132,7 +133,7 @@ public class CamundaProcessDataServiceProviderTest {
final Optional<ActivityInstance[]> response = Optional.<ActivityInstance[]>absent();
final String url = CAMUNDA_REST_API_URL + DEFAULT + "/history/activity-instance?processInstanceId=" + PROCESS_ID
+ "&sortBy=startTime&sortOrder=asc";
- when(httpRestServiceProvider.getHttpResponse(url, ActivityInstance[].class)).thenReturn(response);
+ when(httpRestServiceProvider.get(url, ActivityInstance[].class)).thenReturn(response);
final CamundaProcessDataServiceProvider objUnderTest =
new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
@@ -146,7 +147,7 @@ public class CamundaProcessDataServiceProviderTest {
final Optional<ActivityInstance[]> response = getActivityInstance();
final String url = CAMUNDA_REST_API_URL + DEFAULT + "/history/activity-instance?processInstanceId=" + PROCESS_ID
+ "&sortBy=startTime&sortOrder=asc";
- when(httpRestServiceProvider.getHttpResponse(url, ActivityInstance[].class)).thenReturn(response);
+ when(httpRestServiceProvider.get(url, ActivityInstance[].class)).thenReturn(response);
final CamundaProcessDataServiceProvider objUnderTest =
new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
@@ -164,7 +165,7 @@ public class CamundaProcessDataServiceProviderTest {
final Optional<ProcessInstanceVariable[]> response = Optional.<ProcessInstanceVariable[]>absent();
final String url =
CAMUNDA_REST_API_URL + DEFAULT + "/history/variable-instance?processInstanceId=" + PROCESS_ID;
- when(httpRestServiceProvider.getHttpResponse(url, ProcessInstanceVariable[].class)).thenReturn(response);
+ when(httpRestServiceProvider.get(url, ProcessInstanceVariable[].class)).thenReturn(response);
final CamundaProcessDataServiceProvider objUnderTest =
new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);
@@ -178,7 +179,7 @@ public class CamundaProcessDataServiceProviderTest {
final Optional<ProcessInstanceVariable[]> response = getProcessInstanceVariable();
final String url =
CAMUNDA_REST_API_URL + DEFAULT + "/history/variable-instance?processInstanceId=" + PROCESS_ID;
- when(httpRestServiceProvider.getHttpResponse(url, ProcessInstanceVariable[].class)).thenReturn(response);
+ when(httpRestServiceProvider.get(url, ProcessInstanceVariable[].class)).thenReturn(response);
final CamundaProcessDataServiceProvider objUnderTest =
new CamundaProcessDataServiceProviderImpl(camundaRestUrlProvider, httpRestServiceProvider);