Skip to content

Commit

Permalink
Break from reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl committed Aug 25, 2023
1 parent 7511edb commit 85ddca6
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.List;

import static org.junit.jupiter.api.Assertions.*;

class RedisTransportTest {

@Test
Expand Down Expand Up @@ -88,14 +89,20 @@ void subscribe_thenSuccess() throws IOException, InterruptedException {
String topic = "test";
String channel = "test_implementation";

List<AssertionFailedError> assertionErrors = new ArrayList<>();

RedisServer server = RedisServer.newRedisServer()
.setOptions(ServiceOptions.withInterceptor((state, command, params) -> {
System.out.println("command: " + command);
System.out.println("params: " + params);

// if ("subscribe".equals(command)) {
// assertEquals(channel, params.get(0).toString(), "Channel name is not correct");
// }
try {
if ("subscribe".equals(command)) {
assertEquals(channel, params.get(0).toString(), "Channel name is not correct");
}
} catch (AssertionFailedError e) {
assertionErrors.add(e);
}
return MockExecutor.proceed(state, command, params);
}))
.start();
Expand All @@ -105,11 +112,17 @@ void subscribe_thenSuccess() throws IOException, InterruptedException {

test.close();
server.stop();

if (!assertionErrors.isEmpty()) {
throw assertionErrors.get(0);
}
}

@Test
void getTopicName() {

}

@Test
void close() {
}
Expand Down

0 comments on commit 85ddca6

Please sign in to comment.