diff options
author | tkogut <tomasz.kogut@nokia.com> | 2021-03-25 12:31:56 +0100 |
---|---|---|
committer | tkogut <tomasz.kogut@nokia.com> | 2021-03-25 17:57:39 +0100 |
commit | b7c6e7af778acb904b0be44204532f388fd2492f (patch) | |
tree | a816615791497e7393c1a84cd4e7b4515ca042b2 | |
parent | 56d195e933b57360c6f23c95d91c048f76ca755c (diff) |
Remove test dependencies(google.guava, apache.commons.lang3) usage from runtime code
Issue-ID: DCAEGEN2-2670
Signed-off-by: tkogut <tomasz.kogut@nokia.com>
Change-Id: I8ef7a1ea6e61cb1232476e6f82238a3124e52160
28 files changed, 48 insertions, 37 deletions
diff --git a/Changelog.md b/Changelog.md index 7a6ddb0a..2cd07b19 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.8.1] - 25/03/2021 +### Fixed + - [DCAEGEN2-2670] (https://jira.onap.org/browse/DCAEGEN2-2670) - Support authorized topics in DMaaP-Client + - Remove test dependencies usage from runtime code + ## [1.8.0] - 10/03/2021 ### Added - [DCAEGEN2-2670] (https://jira.onap.org/browse/DCAEGEN2-2670) - Support authorized topics in DMaaP-Client @@ -11,7 +11,7 @@ <groupId>org.onap.dcaegen2.services</groupId> <artifactId>sdk</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> <name>dcaegen2-services-sdk</name> <description>Common SDK repo for all DCAE Services</description> diff --git a/rest-services/cbs-client/pom.xml b/rest-services/cbs-client/pom.xml index 50405092..febfb58a 100644 --- a/rest-services/cbs-client/pom.xml +++ b/rest-services/cbs-client/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>dcaegen2-services-sdk-rest-services</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId> diff --git a/rest-services/dmaap-client/pom.xml b/rest-services/dmaap-client/pom.xml index 813e44dd..b5ac8fc4 100644 --- a/rest-services/dmaap-client/pom.xml +++ b/rest-services/dmaap-client/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>dcaegen2-services-sdk-rest-services</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId> diff --git a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/impl/Commons.java b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/impl/Commons.java index 2bb04df4..9f534d8f 100644 --- a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/impl/Commons.java +++ b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/impl/Commons.java @@ -20,17 +20,15 @@ package org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.impl; -import com.google.common.primitives.Bytes; import io.vavr.Tuple; import io.vavr.Tuple2; import io.vavr.control.Option; -import org.apache.commons.lang3.ArrayUtils; import org.onap.dcaegen2.services.sdk.model.streams.AafCredentials; import org.onap.dcaegen2.services.sdk.rest.services.adapters.http.HttpResponse; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.Base64; +import java.util.Objects; /** * @author <a href="mailto:piotr.jaszczyk@nokia.com">Piotr Jaszczyk</a> @@ -47,18 +45,26 @@ final class Commons { } static Tuple2<String, String> basicAuthHeader(AafCredentials credentials) { - Charset utf8 = StandardCharsets.UTF_8; - byte[] username = toBytes(credentials.username(), utf8); - byte[] separator = ":".getBytes(utf8); - byte[] password = toBytes(credentials.password(), utf8); - byte[] combined = ArrayUtils.addAll(Bytes.concat(username, separator, password)); - String userCredentials = Base64.getEncoder().encodeToString(combined); + Objects.requireNonNull(credentials, "aafCredentials"); + String basicAuthFormat = basicAuthFormat(credentials); + byte[] utf8 = bytesUTF8(basicAuthFormat); + String userCredentials = Base64.getEncoder().encodeToString(utf8); return Tuple.of("Authorization", "Basic " + userCredentials); } - private static byte[] toBytes(String text, Charset charset) { + private static String basicAuthFormat(AafCredentials credentials) { + String username = getOrEmpty(credentials.username()); + String password = getOrEmpty(credentials.password()); + return username.concat(":").concat(password); + } + + private static String getOrEmpty(String text) { + return Option.of(text).getOrElse(""); + } + + private static byte[] bytesUTF8(String text) { return Option.of(text) - .map(s -> s.getBytes(charset)) + .map(s -> s.getBytes(StandardCharsets.UTF_8)) .getOrElse(new byte[0]); } } diff --git a/rest-services/http-client/pom.xml b/rest-services/http-client/pom.xml index 516c8005..a84425ba 100644 --- a/rest-services/http-client/pom.xml +++ b/rest-services/http-client/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>dcaegen2-services-sdk-rest-services</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId> diff --git a/rest-services/model/pom.xml b/rest-services/model/pom.xml index 4f086fb4..0aa7993d 100644 --- a/rest-services/model/pom.xml +++ b/rest-services/model/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>dcaegen2-services-sdk-rest-services</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId> diff --git a/rest-services/pom.xml b/rest-services/pom.xml index f54a88f6..b2929ea6 100644 --- a/rest-services/pom.xml +++ b/rest-services/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.onap.dcaegen2.services</groupId> <artifactId>sdk</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> diff --git a/security/crypt-password/pom.xml b/security/crypt-password/pom.xml index 465a91a8..18c3a6df 100644 --- a/security/crypt-password/pom.xml +++ b/security/crypt-password/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk.security</groupId> <artifactId>dcaegen2-services-sdk-security</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/security/pom.xml b/security/pom.xml index 4980b31c..8ac4389b 100644 --- a/security/pom.xml +++ b/security/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.onap.dcaegen2.services</groupId> <artifactId>sdk</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <groupId>org.onap.dcaegen2.services.sdk.security</groupId> diff --git a/security/ssl/pom.xml b/security/ssl/pom.xml index 23fee06b..68f430b7 100644 --- a/security/ssl/pom.xml +++ b/security/ssl/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk.security</groupId> <artifactId>dcaegen2-services-sdk-security</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <artifactId>ssl</artifactId> diff --git a/services/external-schema-manager/pom.xml b/services/external-schema-manager/pom.xml index b409324a..6496e379 100644 --- a/services/external-schema-manager/pom.xml +++ b/services/external-schema-manager/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>dcaegen2-services-sdk-services</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <artifactId>dcaegen2-services-sdk-services-external-schema-manager</artifactId> diff --git a/services/hv-ves-client/pom.xml b/services/hv-ves-client/pom.xml index ac7f8986..9c35bff7 100644 --- a/services/hv-ves-client/pom.xml +++ b/services/hv-ves-client/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>dcaegen2-services-sdk-services</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <artifactId>dcaegen2-services-sdk-services-hvvesclient</artifactId> diff --git a/services/hv-ves-client/producer/api/pom.xml b/services/hv-ves-client/producer/api/pom.xml index 2ad2bb38..958c0651 100644 --- a/services/hv-ves-client/producer/api/pom.xml +++ b/services/hv-ves-client/producer/api/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>hvvesclient-producer</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <artifactId>hvvesclient-producer-api</artifactId> diff --git a/services/hv-ves-client/producer/ct/pom.xml b/services/hv-ves-client/producer/ct/pom.xml index ac61a8b0..c3542244 100644 --- a/services/hv-ves-client/producer/ct/pom.xml +++ b/services/hv-ves-client/producer/ct/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>hvvesclient-producer</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <artifactId>hvvesclient-producer-ct</artifactId> diff --git a/services/hv-ves-client/producer/impl/pom.xml b/services/hv-ves-client/producer/impl/pom.xml index 135df271..7ff6a06e 100644 --- a/services/hv-ves-client/producer/impl/pom.xml +++ b/services/hv-ves-client/producer/impl/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>hvvesclient-producer</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <artifactId>hvvesclient-producer-impl</artifactId> diff --git a/services/hv-ves-client/producer/pom.xml b/services/hv-ves-client/producer/pom.xml index 268a0dcd..0832e596 100644 --- a/services/hv-ves-client/producer/pom.xml +++ b/services/hv-ves-client/producer/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>dcaegen2-services-sdk-services-hvvesclient</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <artifactId>hvvesclient-producer</artifactId> diff --git a/services/hv-ves-client/protobuf/pom.xml b/services/hv-ves-client/protobuf/pom.xml index 650d01c1..aba2fe68 100644 --- a/services/hv-ves-client/protobuf/pom.xml +++ b/services/hv-ves-client/protobuf/pom.xml @@ -26,7 +26,7 @@ <parent> <artifactId>dcaegen2-services-sdk-services-hvvesclient</artifactId> <groupId>org.onap.dcaegen2.services.sdk</groupId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <name>High Volume VES Collector Client :: Protobuf</name> diff --git a/services/pom.xml b/services/pom.xml index 6e843521..3ba1fe06 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.dcaegen2.services</groupId> <artifactId>sdk</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> diff --git a/standardization/api-custom-header/pom.xml b/standardization/api-custom-header/pom.xml index eee165b8..c9c3f3c7 100644 --- a/standardization/api-custom-header/pom.xml +++ b/standardization/api-custom-header/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.onap.dcaegen2.services.sdk</groupId> <artifactId>dcaegen2-services-sdk-standardization</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/standardization/moher-api/healthstate/pom.xml b/standardization/moher-api/healthstate/pom.xml index cddf79dd..f5c7cc89 100644 --- a/standardization/moher-api/healthstate/pom.xml +++ b/standardization/moher-api/healthstate/pom.xml @@ -25,7 +25,7 @@ <parent> <artifactId>dcaegen2-sdk-moher-api</artifactId> <groupId>org.onap.dcaegen2.services.sdk</groupId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <name>Monitoring and Healthcheck :: Health state</name> diff --git a/standardization/moher-api/metrics/pom.xml b/standardization/moher-api/metrics/pom.xml index 8bd51a79..b3cbc680 100644 --- a/standardization/moher-api/metrics/pom.xml +++ b/standardization/moher-api/metrics/pom.xml @@ -26,7 +26,7 @@ <parent> <artifactId>dcaegen2-sdk-moher-api</artifactId> <groupId>org.onap.dcaegen2.services.sdk</groupId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <name>Monitoring and Healthcheck :: Metrics</name> diff --git a/standardization/moher-api/pom.xml b/standardization/moher-api/pom.xml index 02dd52ac..15c1eb30 100644 --- a/standardization/moher-api/pom.xml +++ b/standardization/moher-api/pom.xml @@ -26,7 +26,7 @@ <parent> <artifactId>dcaegen2-services-sdk-standardization</artifactId> <groupId>org.onap.dcaegen2.services.sdk</groupId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <name>Monitoring and Healthcheck</name> diff --git a/standardization/moher-api/server-adapters/pom.xml b/standardization/moher-api/server-adapters/pom.xml index 8d99849c..c223aceb 100644 --- a/standardization/moher-api/server-adapters/pom.xml +++ b/standardization/moher-api/server-adapters/pom.xml @@ -25,7 +25,7 @@ <parent> <artifactId>dcaegen2-sdk-moher-api</artifactId> <groupId>org.onap.dcaegen2.services.sdk</groupId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <name>Monitoring and Healthcheck :: Server Adapters</name> diff --git a/standardization/moher-api/server-adapters/reactor-netty/pom.xml b/standardization/moher-api/server-adapters/reactor-netty/pom.xml index 445680a6..f0702627 100644 --- a/standardization/moher-api/server-adapters/reactor-netty/pom.xml +++ b/standardization/moher-api/server-adapters/reactor-netty/pom.xml @@ -25,7 +25,7 @@ <parent> <artifactId>dcaegen2-sdk-moher-server-adapters</artifactId> <groupId>org.onap.dcaegen2.services.sdk</groupId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <name>Monitoring and Healthcheck :: Server Adapters :: Reactor Netty</name> diff --git a/standardization/moher-api/server-adapters/spring-webflux/pom.xml b/standardization/moher-api/server-adapters/spring-webflux/pom.xml index d8deb0e4..3992a692 100644 --- a/standardization/moher-api/server-adapters/spring-webflux/pom.xml +++ b/standardization/moher-api/server-adapters/spring-webflux/pom.xml @@ -25,7 +25,7 @@ <parent> <artifactId>dcaegen2-sdk-moher-server-adapters</artifactId> <groupId>org.onap.dcaegen2.services.sdk</groupId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> </parent> <name>Monitoring and Healthcheck :: Server Adapters :: Spring Webflux</name> diff --git a/standardization/pom.xml b/standardization/pom.xml index 25b95520..05b29933 100644 --- a/standardization/pom.xml +++ b/standardization/pom.xml @@ -8,7 +8,7 @@ <parent> <groupId>org.onap.dcaegen2.services</groupId> <artifactId>sdk</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.8.1-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/version.properties b/version.properties index 6db90f27..dfe1ef3c 100644 --- a/version.properties +++ b/version.properties @@ -1,6 +1,6 @@ major=1 minor=8 -patch=0 +patch=1 base_version=${major}.${minor}.${patch} release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT |