summaryrefslogtreecommitdiffstats
path: root/rest-services/cbs-client
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2018-11-20 16:46:32 +0100
committerpwielebs <piotr.wielebski@nokia.com>2018-11-26 16:02:51 +0100
commitb9f65858446ee35a652db53bbca20cc572857116 (patch)
tree9ac4f4a68d2f0a501d789429dd602c1efbc6608b /rest-services/cbs-client
parentec06ba416837d760e0d17de953f956ab87cd4248 (diff)
AAI client & common module added
* added module containing common code for other sdk modules * added reactive rest client for AAI data base with unit tests * improved poms * license text corrected accoriding to SDK Change-Id: I23ea5fbf0e45170b2a1d70ad300bd72121d16ec1 Issue-ID: DCAEGEN2-986 Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'rest-services/cbs-client')
-rw-r--r--rest-services/cbs-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/providers/ReactiveCloudConfigurationProvider.java6
-rw-r--r--rest-services/cbs-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/providers/ReactiveCloudConfigurationProviderTest.java8
2 files changed, 7 insertions, 7 deletions
diff --git a/rest-services/cbs-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/providers/ReactiveCloudConfigurationProvider.java b/rest-services/cbs-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/providers/ReactiveCloudConfigurationProvider.java
index 88072985..fdc966b3 100644
--- a/rest-services/cbs-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/providers/ReactiveCloudConfigurationProvider.java
+++ b/rest-services/cbs-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/providers/ReactiveCloudConfigurationProvider.java
@@ -52,7 +52,7 @@ final class ReactiveCloudConfigurationProvider implements CloudConfigurationProv
@Override
public Mono<JsonObject> callForServiceConfigurationReactive(EnvProperties envProperties) {
return callConsulForConfigBindingServiceEndpoint(envProperties)
- .flatMap(this::callConfigBindingServiceForPrhConfiguration);
+ .flatMap(this::callConfigBindingServiceForConfiguration);
}
@Override
@@ -82,8 +82,8 @@ final class ReactiveCloudConfigurationProvider implements CloudConfigurationProv
envProperties.cbsName());
}
- private Mono<JsonObject> callConfigBindingServiceForPrhConfiguration(String configBindingServiceUri) {
- LOGGER.info("Retrieving PRH configuration");
+ private Mono<JsonObject> callConfigBindingServiceForConfiguration(String configBindingServiceUri) {
+ LOGGER.info("Retrieving configuration");
return cloudHttpClient.callHttpGet(configBindingServiceUri, JsonObject.class);
}
diff --git a/rest-services/cbs-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/providers/ReactiveCloudConfigurationProviderTest.java b/rest-services/cbs-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/providers/ReactiveCloudConfigurationProviderTest.java
index afc5a255..5d6ef6bc 100644
--- a/rest-services/cbs-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/providers/ReactiveCloudConfigurationProviderTest.java
+++ b/rest-services/cbs-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/cbs/client/providers/ReactiveCloudConfigurationProviderTest.java
@@ -52,8 +52,8 @@ class ReactiveCloudConfigurationProviderTest {
+ "\"CreateIndex\":803,\"ModifyIndex\":803}]";
private static final JsonArray configBindingServiceJson = gson.fromJson(configBindingService, JsonArray.class);
private static final JsonArray emptyConfigBindingServiceJson = gson.fromJson("[]", JsonArray.class);
- private static final String prhMockConfiguration = "{\"test\":1}";
- private static final JsonObject prhMockConfigurationJson = gson.fromJson(prhMockConfiguration, JsonObject.class);
+ private static final String configurationMock = "{\"test\":1}";
+ private static final JsonObject configurationJsonMock = gson.fromJson(configurationMock, JsonObject.class);
private EnvProperties envProperties = ImmutableEnvProperties.builder()
.appName("dcae-prh")
@@ -70,13 +70,13 @@ class ReactiveCloudConfigurationProviderTest {
webClient.callHttpGet("http://consul:8500/v1/catalog/service/config-binding-service", JsonArray.class))
.thenReturn(Mono.just(configBindingServiceJson));
when(webClient.callHttpGet("http://config-binding-service:10000/service_component/dcae-prh", JsonObject.class))
- .thenReturn(Mono.just(prhMockConfigurationJson));
+ .thenReturn(Mono.just(configurationJsonMock));
ReactiveCloudConfigurationProvider provider = new ReactiveCloudConfigurationProvider(webClient);
//when/then
StepVerifier.create(provider.callForServiceConfigurationReactive(envProperties)).expectSubscription()
- .expectNext(prhMockConfigurationJson).verifyComplete();
+ .expectNext(configurationJsonMock).verifyComplete();
}
@Test