diff --git a/services-transport-parent/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/ConnectionSetup.java b/services-transport-parent/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/ConnectionSetup.java index 596f49499..d8e251e9a 100644 --- a/services-transport-parent/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/ConnectionSetup.java +++ b/services-transport-parent/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/ConnectionSetup.java @@ -11,7 +11,6 @@ import java.util.Map.Entry; import java.util.Objects; import java.util.StringJoiner; -import java.util.stream.Collectors; public final class ConnectionSetup implements Externalizable { @@ -49,15 +48,10 @@ public boolean hasCredentials() { @Override public String toString() { return new StringJoiner(", ", ConnectionSetup.class.getSimpleName() + "[", "]") - .add("credentials=" + mask(credentials)) + .add("credentials=" + MaskUtil.mask(credentials)) .toString(); } - private static Map mask(Map creds) { - return creds.entrySet().stream() - .collect(Collectors.toMap(Entry::getKey, entry -> MaskUtil.mask(entry.getValue()))); - } - @Override public void writeExternal(ObjectOutput out) throws IOException { // credentials diff --git a/services-transport-parent/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/RSocketClientTransport.java b/services-transport-parent/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/RSocketClientTransport.java index 20d58ba9e..f5b41c34f 100644 --- a/services-transport-parent/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/RSocketClientTransport.java +++ b/services-transport-parent/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/RSocketClientTransport.java @@ -24,9 +24,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Map; -import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import reactor.core.publisher.Mono; @@ -94,7 +92,7 @@ private Mono> getCredentials(ServiceReference serviceReferen creds -> LOGGER.debug( "[credentialsSupplier] Got credentials ({}) for service: {}", - mask(creds), + MaskUtil.mask(creds), serviceReference)) .doOnError( ex -> @@ -138,11 +136,6 @@ private Mono connect( "[rsocket][client][{}] Failed to connect, cause: {}", address, th.toString())); } - private static Map mask(Map creds) { - return creds.entrySet().stream() - .collect(Collectors.toMap(Entry::getKey, entry -> MaskUtil.mask(entry.getValue()))); - } - private Payload encodeConnectionSetup(ConnectionSetup connectionSetup) { ByteBuf byteBuf = ByteBufAllocator.DEFAULT.buffer(); try { diff --git a/services/src/test/java/io/scalecube/services/BaseTest.java b/services/src/test/java/io/scalecube/services/BaseTest.java index c6e2744f9..d8f995871 100644 --- a/services/src/test/java/io/scalecube/services/BaseTest.java +++ b/services/src/test/java/io/scalecube/services/BaseTest.java @@ -5,11 +5,17 @@ import org.junit.jupiter.api.TestInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import reactor.core.publisher.Hooks; public abstract class BaseTest { protected static final Logger LOGGER = LoggerFactory.getLogger(BaseTest.class); + static { + Hooks.onErrorDropped( + throwable -> LOGGER.warn("[onErrorDropped] error: {}", throwable.toString())); + } + @BeforeEach public final void baseSetUp(TestInfo testInfo) { LOGGER.info(