summaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/test/java
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2019-06-04 16:11:37 +0200
committerpwielebs <piotr.wielebski@nokia.com>2019-06-04 16:11:37 +0200
commit1ec97f5a0f3585cb2709cab0bebd571cd4bc9e9e (patch)
tree2f84454f63adacd4b1313ed58fe13c07405e4d5a /prh-app-server/src/test/java
parent7c8f795a243d1b68c5f1595933aa564b513a23fd (diff)
Fix attachment-point issue
Change-Id: Iba52e54e09774a54d23c410c0081aae0643e76c3 Issue-ID: DCAEGEN2-1596 Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-app-server/src/test/java')
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java22
1 files changed, 3 insertions, 19 deletions
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 c8b3a92b..3733a48c 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,10 +20,7 @@
package org.onap.dcaegen2.services.prh.tasks;
-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 org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
@@ -37,12 +34,8 @@ 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 java.io.InputStreamReader;
-
-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;
@@ -78,7 +71,7 @@ class BbsActionsTaskTest {
given(cbsConfiguration.getAaiClientConfiguration()).willReturn(aaiClientConfiguration);
JsonObject additionalFields = new JsonObject();
- additionalFields.addProperty("attachmentPoint", "");
+ additionalFields.addProperty("attachment-point", "");
ConsumerDmaapModel consumerDmaapModel = buildConsumerDmaapModel(additionalFields);
// when
@@ -95,7 +88,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)));
@@ -114,7 +107,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)));
@@ -155,13 +148,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