diff options
author | pwielebs <piotr.wielebski@nokia.com> | 2019-01-07 13:48:18 +0100 |
---|---|---|
committer | elinuxhenrik <henrik.b.andersson@est.tech> | 2019-01-25 14:04:43 +0100 |
commit | 8a84a9d39fe71984bd5d861e8c865e748ca3df30 (patch) | |
tree | 76e50367dffde229a5f2bc427f3544bf60002d3a /datafile-commons | |
parent | a224b4adbe65b476cdbd74efb3169aacbf292382 (diff) |
Integration with SDK
* New fields added to DmaapPublisherConfiguraion
* New fields added to DmaapConsumerConfiguration
* Dmaap Consumer web client replaced by SDK's consumer web client
* UTs aligned
* Disable enforcer plugin in DFC
* Update oparent to 1.2.1
Change-Id: I3569180c15227bc2c8df74fd070571b0aa56fa04
Issue-ID: DCAEGEN2-1096
Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'datafile-commons')
4 files changed, 10 insertions, 6 deletions
diff --git a/datafile-commons/pom.xml b/datafile-commons/pom.xml index 4ef2c686..400ca28a 100644 --- a/datafile-commons/pom.xml +++ b/datafile-commons/pom.xml @@ -33,6 +33,10 @@ <dependencies> <dependency> + <groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId> + <artifactId>common-dependency</artifactId> + </dependency> + <dependency> <groupId>org.immutables</groupId> <artifactId>value</artifactId> </dependency> diff --git a/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctions.java b/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctions.java index 3be7bcf6..801f1705 100644 --- a/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctions.java +++ b/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctions.java @@ -20,15 +20,14 @@ package org.onap.dcaegen2.collectors.datafile.model; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import org.onap.dcaegen2.services.sdk.rest.services.model.JsonBodyBuilder; -public class CommonFunctions { +public class CommonFunctions implements JsonBodyBuilder<ConsumerDmaapModel> { private static Gson gson = new GsonBuilder().serializeNulls().create(); - private CommonFunctions() {} - - public static String createJsonBody(ConsumerDmaapModel consumerDmaapModel) { + public String createJsonBody(ConsumerDmaapModel consumerDmaapModel) { return gson.toJson(consumerDmaapModel); } } diff --git a/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/ConsumerDmaapModel.java b/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/ConsumerDmaapModel.java index 62315602..883a73af 100644 --- a/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/ConsumerDmaapModel.java +++ b/datafile-commons/src/main/java/org/onap/dcaegen2/collectors/datafile/model/ConsumerDmaapModel.java @@ -20,6 +20,7 @@ import com.google.gson.annotations.SerializedName; import org.immutables.gson.Gson; import org.immutables.value.Value; +import org.onap.dcaegen2.services.sdk.rest.services.model.DmaapModel; /** * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 5/8/18 @@ -28,7 +29,7 @@ import org.immutables.value.Value; @Value.Immutable @Gson.TypeAdapters -public interface ConsumerDmaapModel { +public interface ConsumerDmaapModel extends DmaapModel { @SerializedName("productName") String getProductName(); diff --git a/datafile-commons/src/test/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctionsTest.java b/datafile-commons/src/test/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctionsTest.java index 572bca85..cb6c48d9 100644 --- a/datafile-commons/src/test/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctionsTest.java +++ b/datafile-commons/src/test/java/org/onap/dcaegen2/collectors/datafile/model/CommonFunctionsTest.java @@ -53,6 +53,6 @@ class CommonFunctionsTest { // @formatter:on @Test void createJsonBody_shouldReturnJsonInString() { - assertEquals(EXPECTED_RESULT, CommonFunctions.createJsonBody(model)); + assertEquals(EXPECTED_RESULT, new CommonFunctions().createJsonBody(model)); } } |