aboutsummaryrefslogtreecommitdiffstats
path: root/prh-app-server
diff options
context:
space:
mode:
Diffstat (limited to 'prh-app-server')
-rw-r--r--prh-app-server/pom.xml4
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskImpl.java5
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java36
3 files changed, 12 insertions, 33 deletions
diff --git a/prh-app-server/pom.xml b/prh-app-server/pom.xml
index ffab7cbf..cd71cb51 100644
--- a/prh-app-server/pom.xml
+++ b/prh-app-server/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.dcaegen2.services</groupId>
<artifactId>prh</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.2.4-SNAPSHOT</version>
</parent>
<groupId>org.onap.dcaegen2.services.prh</groupId>
@@ -173,7 +173,7 @@
<dependency>
<groupId>org.onap.dcaegen2.services.prh</groupId>
<artifactId>prh-commons</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.2.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId>
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskImpl.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskImpl.java
index 02691446..7b88e21b 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskImpl.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskImpl.java
@@ -38,15 +38,12 @@ import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.RequestBody;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.RxHttpClient;
import org.onap.dcaegen2.services.sdk.rest.services.uri.URI.URIBuilder;
import org.onap.dcaegen2.services.sdk.security.ssl.SslFactory;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;
-
-
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
@@ -57,7 +54,7 @@ import static org.onap.dcaegen2.services.sdk.rest.services.adapters.http.HttpMet
public class BbsActionsTaskImpl implements BbsActionsTask {
private static final Logger LOGGER = LoggerFactory.getLogger(BbsActionsTaskImpl.class);
- private static final String ATTACHMENT_POINT = "attachmentPoint";
+ private static final String ATTACHMENT_POINT = "attachment-point";
private static final String LOGICAL_LINK_URI = "/network/logical-links/logical-link/";
private static final String PNF_URI = "/network/pnfs/pnf/";
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java
index 5edf15a8..798b5ea3 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java
@@ -20,23 +20,8 @@
package org.onap.dcaegen2.services.prh.tasks;
-import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
-
-import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.http.HttpResponseStatus;
-import java.io.InputStreamReader;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.onap.dcaegen2.services.prh.TestAppConfiguration;
@@ -49,9 +34,15 @@ import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.HttpRequest;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.HttpResponse;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.ImmutableHttpResponse;
import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.RxHttpClient;
-import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.*;
+
class BbsActionsTaskTest {
private static final String CORRECT_LOGICAL_LINK_JSON = "bbs_action/correct_logical_link.json";
@@ -99,7 +90,7 @@ class BbsActionsTaskTest {
given(cbsConfiguration.getAaiClientConfiguration()).willReturn(aaiClientConfiguration);
JsonObject additionalFields = new JsonObject();
- additionalFields.addProperty("attachmentPoint", "some-link");
+ additionalFields.addProperty("attachment-point", "some-link");
ConsumerDmaapModel consumerDmaapModel = buildConsumerDmaapModel(additionalFields);
given(httpClient.call(any())).willReturn(Mono.just(buildAaiResponse(HttpResponseStatus.OK)));
@@ -118,7 +109,7 @@ class BbsActionsTaskTest {
given(cbsConfiguration.getAaiClientConfiguration()).willReturn(aaiClientConfiguration);
JsonObject additionalFields = new JsonObject();
- additionalFields.addProperty("attachmentPoint", "some-link");
+ additionalFields.addProperty("attachment-point", "some-link");
ConsumerDmaapModel consumerDmaapModel = buildConsumerDmaapModel(additionalFields);
given(httpClient.call(any())).willReturn(Mono.just(buildAaiResponse(HttpResponseStatus.INTERNAL_SERVER_ERROR)));
@@ -159,13 +150,4 @@ class BbsActionsTaskTest {
.rawBody("".getBytes())
.build();
}
-
- private void assertJsonEquals(Publisher<ByteBuf> requestBody, String path) {
- JsonParser parser = new JsonParser();
- JsonElement result = parser.parse(Mono.from(requestBody).block().toString(UTF_8));
- JsonElement expected = parser
- .parse(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(path)));
-
- assertThat(result).isEqualTo(expected);
- }
} \ No newline at end of file