Skip to content

Commit 05ff22f

Browse files
authored
Merge pull request #810 from scalecube/cleanup
Cleanup
2 parents 7c4d0ae + 68f209f commit 05ff22f

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

services-transport-parent/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/ConnectionSetup.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import java.util.Map.Entry;
1212
import java.util.Objects;
1313
import java.util.StringJoiner;
14-
import java.util.stream.Collectors;
1514

1615
public final class ConnectionSetup implements Externalizable {
1716

@@ -49,15 +48,10 @@ public boolean hasCredentials() {
4948
@Override
5049
public String toString() {
5150
return new StringJoiner(", ", ConnectionSetup.class.getSimpleName() + "[", "]")
52-
.add("credentials=" + mask(credentials))
51+
.add("credentials=" + MaskUtil.mask(credentials))
5352
.toString();
5453
}
5554

56-
private static Map<String, String> mask(Map<String, String> creds) {
57-
return creds.entrySet().stream()
58-
.collect(Collectors.toMap(Entry::getKey, entry -> MaskUtil.mask(entry.getValue())));
59-
}
60-
6155
@Override
6256
public void writeExternal(ObjectOutput out) throws IOException {
6357
// credentials

services-transport-parent/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/RSocketClientTransport.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
import java.util.Collection;
2525
import java.util.Collections;
2626
import java.util.Map;
27-
import java.util.Map.Entry;
2827
import java.util.concurrent.ConcurrentHashMap;
29-
import java.util.stream.Collectors;
3028
import org.slf4j.Logger;
3129
import org.slf4j.LoggerFactory;
3230
import reactor.core.publisher.Mono;
@@ -94,7 +92,7 @@ private Mono<Map<String, String>> getCredentials(ServiceReference serviceReferen
9492
creds ->
9593
LOGGER.debug(
9694
"[credentialsSupplier] Got credentials ({}) for service: {}",
97-
mask(creds),
95+
MaskUtil.mask(creds),
9896
serviceReference))
9997
.doOnError(
10098
ex ->
@@ -138,11 +136,6 @@ private Mono<RSocket> connect(
138136
"[rsocket][client][{}] Failed to connect, cause: {}", address, th.toString()));
139137
}
140138

141-
private static Map<String, String> mask(Map<String, String> creds) {
142-
return creds.entrySet().stream()
143-
.collect(Collectors.toMap(Entry::getKey, entry -> MaskUtil.mask(entry.getValue())));
144-
}
145-
146139
private Payload encodeConnectionSetup(ConnectionSetup connectionSetup) {
147140
ByteBuf byteBuf = ByteBufAllocator.DEFAULT.buffer();
148141
try {

services/src/test/java/io/scalecube/services/BaseTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@
55
import org.junit.jupiter.api.TestInfo;
66
import org.slf4j.Logger;
77
import org.slf4j.LoggerFactory;
8+
import reactor.core.publisher.Hooks;
89

910
public abstract class BaseTest {
1011

1112
protected static final Logger LOGGER = LoggerFactory.getLogger(BaseTest.class);
1213

14+
static {
15+
Hooks.onErrorDropped(
16+
throwable -> LOGGER.warn("[onErrorDropped] error: {}", throwable.toString()));
17+
}
18+
1319
@BeforeEach
1420
public final void baseSetUp(TestInfo testInfo) {
1521
LOGGER.info(

0 commit comments

Comments
 (0)