From 6706f87f74f1abef3e698e097e77ed9ea617ddad Mon Sep 17 00:00:00 2001 From: Artem Vysochyn Date: Sat, 2 Sep 2023 17:47:24 +0300 Subject: [PATCH] Added `externalHosts` config setting, refactored RSocketClientTransport to support connection on multiple addresses --- .../io/scalecube/services/ErrorFlowTest.java | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/services/src/test/java/io/scalecube/services/ErrorFlowTest.java b/services/src/test/java/io/scalecube/services/ErrorFlowTest.java index f17d67b7d..5a91dc993 100644 --- a/services/src/test/java/io/scalecube/services/ErrorFlowTest.java +++ b/services/src/test/java/io/scalecube/services/ErrorFlowTest.java @@ -1,9 +1,7 @@ package io.scalecube.services; import static org.junit.jupiter.api.Assertions.assertThrows; -import static reactor.core.publisher.Mono.from; -import io.scalecube.services.api.ServiceMessage; import io.scalecube.services.discovery.ScalecubeServiceDiscovery; import io.scalecube.services.exceptions.BadRequestException; import io.scalecube.services.exceptions.ForbiddenException; @@ -17,7 +15,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.reactivestreams.Publisher; import reactor.test.StepVerifier; public class ErrorFlowTest extends BaseTest { @@ -67,27 +64,35 @@ public static void shutdownNodes() { @Test public void testCorruptedRequest() { - Publisher req = - consumer - .call() - .requestOne(TestRequests.GREETING_CORRUPTED_PAYLOAD_REQUEST, GreetingResponse.class); - assertThrows(InternalServiceException.class, () -> from(req).block()); + assertThrows( + InternalServiceException.class, + () -> + consumer + .call() + .requestOne(TestRequests.GREETING_CORRUPTED_PAYLOAD_REQUEST, GreetingResponse.class) + .block()); } @Test public void testNotAuthorized() { - Publisher req = - consumer - .call() - .requestOne(TestRequests.GREETING_UNAUTHORIZED_REQUEST, GreetingResponse.class); - assertThrows(ForbiddenException.class, () -> from(req).block()); + assertThrows( + ForbiddenException.class, + () -> + consumer + .call() + .requestOne(TestRequests.GREETING_UNAUTHORIZED_REQUEST, GreetingResponse.class) + .block()); } @Test public void testNullRequestPayload() { - Publisher req = - consumer.call().requestOne(TestRequests.GREETING_NULL_PAYLOAD, GreetingResponse.class); - assertThrows(BadRequestException.class, () -> from(req).block()); + assertThrows( + BadRequestException.class, + () -> + consumer + .call() + .requestOne(TestRequests.GREETING_NULL_PAYLOAD, GreetingResponse.class) + .block()); } @Test