Skip to content

Commit

Permalink
Added WS gateway tests
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-v committed Dec 21, 2024
1 parent 3607c01 commit db09b49
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.scalecube.services.gateway.websocket;

import static io.scalecube.services.gateway.GatewayErrorMapperImpl.ERROR_MAPPER;
import static org.junit.jupiter.api.Assertions.assertEquals;

import io.scalecube.services.Address;
import io.scalecube.services.Microservices;
Expand Down Expand Up @@ -241,4 +242,16 @@ void shouldHeartbeat() {
.assertNext(pongValue -> Assertions.assertEquals(value, pongValue))
.verifyComplete();
}

@Test
void shouldWorkWithDynamicQualifier() {
final var value = "12345";
final var data = System.currentTimeMillis();
final var request =
ServiceMessage.builder().qualifier("greeting/hello/" + value).data(data).build();

StepVerifier.create(serviceCall.requestOne(request, String.class).map(ServiceMessage::data))
.assertNext(result -> assertEquals(value + "@" + data, result))
.verifyComplete();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.scalecube.services.gateway.websocket;

import static io.scalecube.services.gateway.GatewayErrorMapperImpl.ERROR_MAPPER;
import static org.junit.jupiter.api.Assertions.assertEquals;

import io.scalecube.services.Address;
import io.scalecube.services.Microservices;
Expand Down Expand Up @@ -212,4 +213,16 @@ void shouldReturnSomeExceptionOnFlux() {
void shouldReturnSomeExceptionOnMono() {
StepVerifier.create(errorService.oneError()).expectError(SomeException.class).verify(TIMEOUT);
}

@Test
void shouldWorkWithDynamicQualifier() {
final var value = "12345";
final var data = System.currentTimeMillis();
final var request =
ServiceMessage.builder().qualifier("greeting/hello/" + value).data(data).build();

StepVerifier.create(serviceCall.requestOne(request, String.class).map(ServiceMessage::data))
.assertNext(result -> assertEquals(value + "@" + data, result))
.verifyComplete();
}
}

0 comments on commit db09b49

Please sign in to comment.