From c5241f0e82f481fa0aa8df64a0cb7b813b875eff Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 9 Jul 2019 14:01:57 +0100 Subject: [PATCH] Remove accidental usage of com.hazelcast.util.Base64 Closes gh-17461 --- .../autoconfigure/data/neo4j/Neo4jPropertiesTests.java | 9 ++++----- src/checkstyle/checkstyle.xml | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jPropertiesTests.java index 8aad7f69725..5ce22aa9a6f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jPropertiesTests.java @@ -16,7 +16,8 @@ package org.springframework.boot.autoconfigure.data.neo4j; -import com.hazelcast.util.Base64; +import java.util.Base64; + import org.junit.After; import org.junit.Test; import org.neo4j.ogm.config.AutoIndexMode; @@ -149,10 +150,8 @@ public class Neo4jPropertiesTests { assertThat(credentials).isNotNull(); Object content = credentials.credentials(); assertThat(content).isInstanceOf(String.class); - String[] auth = new String(Base64.decode(((String) content).getBytes())).split(":"); - assertThat(auth[0]).isEqualTo(username); - assertThat(auth[1]).isEqualTo(password); - assertThat(auth).hasSize(2); + String[] auth = new String(Base64.getDecoder().decode((String) content)).split(":"); + assertThat(auth).containsExactly(username, password); } } diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index f1989bb4911..88ff7c9be58 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -14,7 +14,7 @@ + value="^com\.hazelcast\.util\.Base64, ^org\.junit\.rules\.ExpectedException, ^org\.slf4j\.LoggerFactory, ^reactor\.core\.support\.Assert" />