Remove test dependencies(google.guava, apache.commons.lang3) usage from runtime code 11/119811/2
authortkogut <tomasz.kogut@nokia.com>
Thu, 25 Mar 2021 11:31:56 +0000 (12:31 +0100)
committertkogut <tomasz.kogut@nokia.com>
Thu, 25 Mar 2021 16:57:39 +0000 (17:57 +0100)
Issue-ID: DCAEGEN2-2670
Signed-off-by: tkogut <tomasz.kogut@nokia.com>
Change-Id: I8ef7a1ea6e61cb1232476e6f82238a3124e52160

28 files changed:
Changelog.md
pom.xml
rest-services/cbs-client/pom.xml
rest-services/dmaap-client/pom.xml
rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/impl/Commons.java
rest-services/http-client/pom.xml
rest-services/model/pom.xml
rest-services/pom.xml
security/crypt-password/pom.xml
security/pom.xml
security/ssl/pom.xml
services/external-schema-manager/pom.xml
services/hv-ves-client/pom.xml
services/hv-ves-client/producer/api/pom.xml
services/hv-ves-client/producer/ct/pom.xml
services/hv-ves-client/producer/impl/pom.xml
services/hv-ves-client/producer/pom.xml
services/hv-ves-client/protobuf/pom.xml
services/pom.xml
standardization/api-custom-header/pom.xml
standardization/moher-api/healthstate/pom.xml
standardization/moher-api/metrics/pom.xml
standardization/moher-api/pom.xml
standardization/moher-api/server-adapters/pom.xml
standardization/moher-api/server-adapters/reactor-netty/pom.xml
standardization/moher-api/server-adapters/spring-webflux/pom.xml
standardization/pom.xml
version.properties

index 7a6ddb0..2cd07b1 100644 (file)
@@ -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
diff --git a/pom.xml b/pom.xml
index a68d6e5..79b781c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -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>
index 5040509..febfb58 100644 (file)
@@ -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>
index 813e44d..b5ac8fc 100644 (file)
@@ -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>
index 2bb04df..9f534d8 100644 (file)
 
 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]);
     }
 }
index 516c800..a84425b 100644 (file)
@@ -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>
index 4f086fb..0aa7993 100644 (file)
@@ -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>
index f54a88f..b2929ea 100644 (file)
@@ -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>
index 465a91a..18c3a6d 100644 (file)
@@ -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>
 
index 4980b31..8ac4389 100644 (file)
@@ -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>
index 23fee06..68f430b 100644 (file)
@@ -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>
index b409324..6496e37 100644 (file)
@@ -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>
index ac7f898..9c35bff 100644 (file)
@@ -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>
index 2ad2bb3..958c065 100644 (file)
@@ -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>
index ac61a8b..c354224 100644 (file)
@@ -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>
index 135df27..7ff6a06 100644 (file)
@@ -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>
index 268a0dc..0832e59 100644 (file)
@@ -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>
index 650d01c..aba2fe6 100644 (file)
@@ -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>
index 6e84352..3ba1fe0 100644 (file)
@@ -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>
index eee165b..c9c3f3c 100644 (file)
@@ -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>
   
index cddf79d..f5c7cc8 100644 (file)
@@ -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>
index 8bd51a7..b3cbc68 100644 (file)
@@ -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>
index 02dd52a..15c1eb3 100644 (file)
@@ -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>
index 8d99849..c223ace 100644 (file)
@@ -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>
index 445680a..f070262 100644 (file)
@@ -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>
index d8deb0e..3992a69 100644 (file)
@@ -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>
index 25b9552..05b2993 100644 (file)
@@ -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>
 
index 6db90f2..dfe1ef3 100644 (file)
@@ -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