Skip to content

Commit

Permalink
Added externalHosts config setting, refactored RSocketClientTranspo…
Browse files Browse the repository at this point in the history
…rt to support connection on multiple addresses
  • Loading branch information
artem-v committed Sep 2, 2023
1 parent 7f57054 commit 6706f87
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions services/src/test/java/io/scalecube/services/ErrorFlowTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -67,27 +64,35 @@ public static void shutdownNodes() {

@Test
public void testCorruptedRequest() {
Publisher<ServiceMessage> 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<ServiceMessage> 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<ServiceMessage> 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
Expand Down

0 comments on commit 6706f87

Please sign in to comment.