summaryrefslogtreecommitdiffstats
path: root/prh-aai-client
diff options
context:
space:
mode:
authorwasala <przemyslaw.wasala@nokia.com>2018-04-12 13:37:41 +0200
committerwasala <przemyslaw.wasala@nokia.com>2018-04-12 14:29:12 +0200
commit3c2e8c9c4c32ad59be75a7500e628344c6dab5bf (patch)
tree98c4238f48612253435037c249e2929609933000 /prh-aai-client
parentda7aa97bebc796e898b9225d45a256f946d39f82 (diff)
Already added loading config for AAI and DMAAP
First of all we have defined a file in which we have pointer to configuration file for DMAAP and AAI After that added UT Change-Id: I7f9554a019b348a3460f5fa9d8dd3e4002a6686f Issue-ID: DCAEGEN2-407 Signed-off-by: wasala <przemyslaw.wasala@nokia.com>
Diffstat (limited to 'prh-aai-client')
-rw-r--r--prh-aai-client/pom.xml14
-rw-r--r--prh-aai-client/src/main/java/org/onap/dcaegen2/services/config/AAIHttpClientConfiguration.java7
-rw-r--r--prh-aai-client/src/test/java/org/onap/dcaegen2/services/service/config/AAIHttpClientConfigurationTest.java20
3 files changed, 23 insertions, 18 deletions
diff --git a/prh-aai-client/pom.xml b/prh-aai-client/pom.xml
index eaed6096..95d758e8 100644
--- a/prh-aai-client/pom.xml
+++ b/prh-aai-client/pom.xml
@@ -40,7 +40,7 @@
</properties>
<dependencies>
-
+
<!-- DEVELOPMENT DEPENDENCIES -->
<dependency>
<groupId>org.immutables</groupId>
@@ -61,14 +61,18 @@
<artifactId>spring-context</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.datatype</groupId>
+ <artifactId>jackson-datatype-jdk8</artifactId>
+ </dependency>
<!-- LOGGING DEPENDENCIES-->
<dependency>
diff --git a/prh-aai-client/src/main/java/org/onap/dcaegen2/services/config/AAIHttpClientConfiguration.java b/prh-aai-client/src/main/java/org/onap/dcaegen2/services/config/AAIHttpClientConfiguration.java
index 9f93f896..4b17b4b6 100644
--- a/prh-aai-client/src/main/java/org/onap/dcaegen2/services/config/AAIHttpClientConfiguration.java
+++ b/prh-aai-client/src/main/java/org/onap/dcaegen2/services/config/AAIHttpClientConfiguration.java
@@ -20,15 +20,16 @@
package org.onap.dcaegen2.services.config;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.immutables.value.Value;
-import org.springframework.stereotype.Component;
-
import java.io.Serializable;
+import org.springframework.stereotype.Component;
@Component
@Value.Immutable(prehash = true)
-@Value.Style(stagedBuilder = true)
+@Value.Style(builder = "new")
+@JsonDeserialize(builder = ImmutableAAIHttpClientConfiguration.Builder.class)
public abstract class AAIHttpClientConfiguration implements Serializable {
private static final long serialVersionUID = 1L;
diff --git a/prh-aai-client/src/test/java/org/onap/dcaegen2/services/service/config/AAIHttpClientConfigurationTest.java b/prh-aai-client/src/test/java/org/onap/dcaegen2/services/service/config/AAIHttpClientConfigurationTest.java
index a759aca5..76c2969a 100644
--- a/prh-aai-client/src/test/java/org/onap/dcaegen2/services/service/config/AAIHttpClientConfigurationTest.java
+++ b/prh-aai-client/src/test/java/org/onap/dcaegen2/services/service/config/AAIHttpClientConfigurationTest.java
@@ -36,21 +36,21 @@ public class AAIHttpClientConfigurationTest {
@BeforeAll
public static void init() {
- client = ImmutableAAIHttpClientConfiguration.builder()
- .aaiHost(AAI_HOST)
- .aaiHostPortNumber(PORT)
- .aaiProtocol(PROTOCOL)
- .aaiUserName(USER_NAME_PASSWORD)
- .aaiUserPassword(USER_NAME_PASSWORD)
- .aaiIgnoreSSLCertificateErrors(true)
- .build();
+ client = new ImmutableAAIHttpClientConfiguration.Builder()
+ .aaiHost(AAI_HOST)
+ .aaiHostPortNumber(PORT)
+ .aaiProtocol(PROTOCOL)
+ .aaiUserName(USER_NAME_PASSWORD)
+ .aaiUserPassword(USER_NAME_PASSWORD)
+ .aaiIgnoreSSLCertificateErrors(true)
+ .build();
}
@Test
public void testGetters_success() {
- Assertions.assertEquals(AAI_HOST,client.aaiHost());
+ Assertions.assertEquals(AAI_HOST, client.aaiHost());
Assertions.assertEquals(PORT, client.aaiHostPortNumber());
- Assertions.assertEquals(PROTOCOL,client.aaiProtocol());
+ Assertions.assertEquals(PROTOCOL, client.aaiProtocol());
Assertions.assertEquals(USER_NAME_PASSWORD, client.aaiUserName());
Assertions.assertEquals(USER_NAME_PASSWORD, client.aaiUserPassword());
Assertions.assertEquals(true, client.aaiIgnoreSSLCertificateErrors());