summaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/test
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2018-05-07 16:58:20 +0200
committerpwielebs <piotr.wielebski@nokia.com>2018-05-11 12:29:25 +0200
commita393ae34963a919b842127cc8943a94f2d7c1bc7 (patch)
tree666c78e8d10b0fd65e55494e2e27d52643cf92a2 /prh-app-server/src/test
parent8c88efe7a0abe051e8a4c4d271c84eb8e68c29f0 (diff)
AAI client configuration & tasks changed
Change-Id: I86a2f2ed62565263f2be2c9078a092f993234a19 Issue-ID: DCAEGEN2-451 Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-app-server/src/test')
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/IT/ScheduledXmlContextITest.java6
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfigTest.java6
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParserTest.java4
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIConsumerTaskSpy.java1
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIPublisherTaskSpy.java1
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduleControllerSpy.java5
-rw-r--r--prh-app-server/src/test/resources/prh_endpoints.json14
7 files changed, 20 insertions, 17 deletions
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/IT/ScheduledXmlContextITest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/IT/ScheduledXmlContextITest.java
index 8094c993..38a4436d 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/IT/ScheduledXmlContextITest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/IT/ScheduledXmlContextITest.java
@@ -28,10 +28,10 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
+import org.onap.dcaegen2.services.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.IT.junit5.mockito.MockitoExtension;
import org.onap.dcaegen2.services.prh.configuration.PrhAppConfig;
import org.onap.dcaegen2.services.prh.tasks.ScheduledTasks;
-import org.onap.dcaegen2.services.utils.HttpRequestDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@@ -75,8 +75,8 @@ class ServiceMockProvider {
}
@Bean
- public HttpRequestDetails getRequestDetails() {
- return mock(HttpRequestDetails.class);
+ public ConsumerDmaapModel getRequestDetails() {
+ return mock(ConsumerDmaapModel.class);
}
}
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfigTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfigTest.java
index e7d55419..2efffd80 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfigTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfigTest.java
@@ -44,8 +44,8 @@ import org.onap.dcaegen2.services.prh.IT.junit5.mockito.MockitoExtension;
class PrhAppConfigTest {
private static final String PRH_ENDPOINTS = "prh_endpoints.json";
- private static final String jsonString = "{\"configs\":{\"aai\":{\"aaiHttpClientConfiguration\":{\"aaiHost\":\"\",\"aaiHostPortNumber\":8080,\"aaiIgnoreSSLCertificateErrors\":true,\"aaiProtocol\":\"https\",\"aaiUserName\":\"admin\",\"aaiUserPassword\":\"admin\"}},\"dmaap\":{\"dmaapConsumerConfiguration\":{\"consumerGroup\":\"other\",\"consumerId\":\"1\",\"dmaapContentType\":\"application/json\",\"dmaapHostName\":\"localhost\",\"dmaapPortNumber\":2222,\"dmaapProtocol\":\"http\",\"dmaapTopicName\":\"temp\",\"dmaapUserName\":\"admin\",\"dmaapUserPassword\":\"admin\",\"messageLimit\":1000,\"timeoutMS\":1000},\"dmaapProducerConfiguration\":{\"dmaapContentType\":\"application/json\",\"dmaapHostName\":\"localhost\",\"dmaapPortNumber\":2223,\"dmaapProtocol\":\"http\",\"dmaapTopicName\":\"temp\",\"dmaapUserName\":\"admin\",\"dmaapUserPassword\":\"admin\"}}}}";
- private static final String incorrectJsonString = "{\"configs\":{\"aai\":{\"aaiHttpClientConfiguration\":{\"aaiHost\":\"\",\"aaiHostPortNumber\":8080,\"aaiIgnoreSSLCertificateErrors\":true,\"aaiProtocol\":\"https\",\"aaiUserName\":\"admin\",\"aaiUserPassword\":\"admin\"}},\"dmaap\":{\"dmaapConsumerConfiguration\":{\"consumerGroup\":\"other\",\"consumerId\":\"1\",\"dmaapContentType\":\"application/json\",\"dmaapHostName\":\"localhost\",\"dmaapPortNumber\":2222,\"dmaapProtocol\":\"http\",\"dmaapTopicName\":\"temp\",\"dmaapUserName\":\"admin\",\"dmaapUserPassword\":\"admin\",\"messageLimit\":1000,\"timeoutMS\":1000},\"dmaapProducerConfiguration\":{\"dmaapContentType\":\"application/json\",\"dmaapHostName\":\"localhost\",\"dmaapPortNumber\":2223,\"dmaapProtocol\":\"http\",\"dmaaptopicName\":\"temp\",\"dmaapuserName\":\"admin\",\"dmaapuserPassword\":\"admin\"}}}}";
+ private static final String jsonString = "{\"configs\":{\"aai\":{\"aaiClientConfiguration\":{\"aaiHost\":\"localhost\",\"aaiHostPortNumber\":8080,\"aaiIgnoreSSLCertificateErrors\":true,\"aaiProtocol\":\"https\",\"aaiUserName\":\"admin\",\"aaiUserPassword\":\"admin\",\"aaiBasePath\":\"/aai/v11\",\"aaiPnfPath\":\"/network/pnfs/pnf\",\"aaiHeaders\":{\"X-FromAppId\":\"prh\",\"X-TransactionId\":\"9999\",\"Accept\":\"application/json\",\"Real-Time\":\"true\",\"Authorization\":\"Basic QUFJOkFBSQ==\"}}},\"dmaap\":{\"dmaapConsumerConfiguration\":{\"consumerGroup\":\"other\",\"consumerId\":\"1\",\"dmaapContentType\":\"application/json\",\"dmaapHostName\":\"localhost\",\"dmaapPortNumber\":2222,\"dmaapProtocol\":\"http\",\"dmaapTopicName\":\"temp\",\"dmaapUserName\":\"admin\",\"dmaapUserPassword\":\"admin\",\"messageLimit\":1000,\"timeoutMS\":1000},\"dmaapProducerConfiguration\":{\"dmaapContentType\":\"application/json\",\"dmaapHostName\":\"localhost\",\"dmaapPortNumber\":2223,\"dmaapProtocol\":\"http\",\"dmaapTopicName\":\"temp\",\"dmaapUserName\":\"admin\",\"dmaapUserPassword\":\"admin\"}}}}";
+ private static final String incorrectJsonString = "{\"configs\":{\"aai\":{\"aaiClientConfiguration\":{\"aaiHost\":\"localhost\",\"aaiHostPortNumber\":8080,\"aaiIgnoreSSLCertificateErrors\":true,\"aaiProtocol\":\"https\",\"aaiUserName\":\"admin\",\"aaiUserPassword\":\"admin\",\"aaiBasePath\":\"/aai/v11\",\"aaiPnfPath\":\"/network/pnfs/pnf\",\"aaiHeaders\":{\"X-FromAppId\":\"prh\",\"X-TransactionId\":\"9999\",\"Accept\":\"application/json\",\"Real-Time\":\"true\",\"Authorization\":\"Basic QUFJOkFBSQ==\"}}},\"dmaap\":{\"dmaapConsumerConfiguration\":{\"consumerGroup\":\"other\",\"consumerId\":\"1\",\"dmaapContentType\":\"application/json\",\"dmaapHostName\":\"localhost\",\"dmaapPortNumber\":2222,\"dmaapProtocol\":\"http\",\"dmaapTopicName\":\"temp\",\"dmaapUserName\":\"admin\",\"dmaapUserPassword\":\"admin\",\"messageLimit\":1000,\"timeoutMS\":1000},\"dmaapProducerConfiguration\":{\"dmaapContentType\":\"application/json\",\"dmaapHostName\":\"localhost\",\"dmaapPortNumber\":2223,\"dmaapProtocol\":\"http\",\"dmaaptopicName\":\"temp\",\"dmaapuserName\":\"admin\",\"dmaapuserPassword\":\"admin\"}}}}";
private static PrhAppConfig prhAppConfig;
private static AppConfig appConfig;
@@ -107,7 +107,7 @@ class PrhAppConfigTest {
}
@Test
- public void whenFileIsNotExist_ThrowFileNotFoundExcepton() {
+ public void whenFileIsNotExist_ThrowFileNotFoundException() {
//
// Given
//
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParserTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParserTest.java
index a0970374..aad3c2fc 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParserTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParserTest.java
@@ -22,8 +22,8 @@ package org.onap.dcaegen2.services.prh.service;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.onap.dcaegen2.services.prh.exceptions.DmaapNotFoundException;
-import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
-import org.onap.dcaegen2.services.prh.model.ImmutableConsumerDmaapModel;
+import org.onap.dcaegen2.services.model.ConsumerDmaapModel;
+import org.onap.dcaegen2.services.model.ImmutableConsumerDmaapModel;
/**
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 5/8/18
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIConsumerTaskSpy.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIConsumerTaskSpy.java
index 929e5a48..288a8961 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIConsumerTaskSpy.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIConsumerTaskSpy.java
@@ -22,7 +22,6 @@ package org.onap.dcaegen2.services.prh.tasks;
import org.onap.dcaegen2.services.config.AAIClientConfiguration;
import org.onap.dcaegen2.services.prh.configuration.AppConfig;
-import org.onap.dcaegen2.services.utils.HttpRequestDetails;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIPublisherTaskSpy.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIPublisherTaskSpy.java
index 9564bf9e..77323ab2 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIPublisherTaskSpy.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIPublisherTaskSpy.java
@@ -21,7 +21,6 @@ package org.onap.dcaegen2.services.prh.tasks;
import org.onap.dcaegen2.services.config.AAIClientConfiguration;
import org.onap.dcaegen2.services.prh.configuration.AppConfig;
-import org.onap.dcaegen2.services.utils.HttpRequestDetails;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduleControllerSpy.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduleControllerSpy.java
index 73f21a26..27083c04 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduleControllerSpy.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduleControllerSpy.java
@@ -42,13 +42,10 @@ public class ScheduleControllerSpy {
@Autowired
private AAIProducerTask aaiPublisherTaskImplSpy;
- @Autowired
- private AAIConsumerTask aaiConsumerTaskImplSpy;
@Bean
@Primary
public ScheduledTasks registerSimpleScheduledTask() {
- return spy(new ScheduledTasks(dmaapConsumerTaskImplSpy, dmaapPublisherTaskImplSpy, aaiPublisherTaskImplSpy,
- aaiConsumerTaskImplSpy));
+ return spy(new ScheduledTasks(dmaapConsumerTaskImplSpy, dmaapPublisherTaskImplSpy, aaiPublisherTaskImplSpy));
}
}
diff --git a/prh-app-server/src/test/resources/prh_endpoints.json b/prh-app-server/src/test/resources/prh_endpoints.json
index b401b90d..a67ee02b 100644
--- a/prh-app-server/src/test/resources/prh_endpoints.json
+++ b/prh-app-server/src/test/resources/prh_endpoints.json
@@ -7,7 +7,15 @@
"aaiIgnoreSSLCertificateErrors": true,
"aaiProtocol": "https",
"aaiUserName": "admin",
- "aaiUserPassword": "admin"
+ "aaiUserPassword": "admin",
+ "aaiBasePath": "/aai/v11",
+ "aaiPnfPath": "/network/pnfs/pnf",
+ "aaiHeaders": {
+ "X-FromAppId": "prh",
+ "X-TransactionId": "9999",
+ "Accept": "application/json",
+ "Real-Time": "true"
+ }
}
},
"dmaap": {
@@ -18,7 +26,7 @@
"dmaapHostName": "localhost",
"dmaapPortNumber": 2222,
"dmaapProtocol": "http",
- "dmaapTopicName": "temp",
+ "dmaapTopicName": "/events/pnfReady",
"dmaapUserName": "admin",
"dmaapUserPassword": "admin",
"messageLimit": 1000,
@@ -29,7 +37,7 @@
"dmaapHostName": "localhost",
"dmaapPortNumber": 2223,
"dmaapProtocol": "http",
- "dmaapTopicName": "temp",
+ "dmaapTopicName": "/events/pnfReady",
"dmaapUserName": "admin",
"dmaapUserPassword": "admin"
}