Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for SUNSUBSCRIBE #2759 #2851

Merged
merged 2 commits into from
May 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
replace junit.Assert with assertj
atakavci committed May 13, 2024
commit b7898376fcf597597a44e06496993eacbf831421
Original file line number Diff line number Diff line change
@@ -93,6 +93,7 @@ default void ssubscribed(K shardChannel, long count) {
*
* @param shardChannel Channel
* @param count Subscription count.
* @since 7.0
*/
default void sunsubscribed(K shardChannel, long count) {
unsubscribed(shardChannel, count);
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@

import static io.lettuce.core.protocol.CommandType.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
@@ -50,7 +49,7 @@ void psubscribe() throws ExecutionException, InterruptedException {
assertInstanceOf(PubSubOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("key<channelPattern>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

@Test
@@ -69,7 +68,7 @@ void punsubscribe() throws ExecutionException, InterruptedException {
assertInstanceOf(PubSubOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("key<channelPattern>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

@Test
@@ -88,7 +87,7 @@ void subscribe() throws ExecutionException, InterruptedException {
assertInstanceOf(PubSubOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("key<channelPattern>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

@Test
@@ -107,7 +106,7 @@ void unsubscribe() throws ExecutionException, InterruptedException {
assertInstanceOf(PubSubOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("key<channelPattern>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

@Test
@@ -128,7 +127,7 @@ void publish() throws ExecutionException, InterruptedException {
assertInstanceOf(IntegerOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("key<acmeChannel> value<acmeMessage>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

@Test
@@ -148,7 +147,7 @@ void pubsubChannels() throws ExecutionException, InterruptedException {
assertInstanceOf(KeyListOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("CHANNELS key<channelPattern>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

@Test
@@ -168,7 +167,7 @@ void pubsubNumsub() throws ExecutionException, InterruptedException {
assertInstanceOf(MapOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("NUMSUB key<channelPattern>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

@Test
@@ -188,7 +187,7 @@ void pubsubShardChannels() throws ExecutionException, InterruptedException {
assertInstanceOf(KeyListOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("SHARDCHANNELS key<channelPattern>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

@Test
@@ -208,7 +207,7 @@ void pubsubShardNumsub() throws ExecutionException, InterruptedException {
assertInstanceOf(MapOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("SHARDNUMSUB key<channelPattern>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

@Test
@@ -227,7 +226,7 @@ void ssubscribe() throws ExecutionException, InterruptedException {
assertInstanceOf(PubSubOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("key<channelPattern>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

@Test
@@ -246,7 +245,7 @@ void sunsubscribe() throws ExecutionException, InterruptedException {
assertInstanceOf(PubSubOutput.class, capturedCommand.getValue().getOutput());
assertThat(capturedCommand.getValue().getArgs().toCommandString()).isEqualTo("key<channelPattern>");

assertNotEquals(capturedCommand.getValue(), dispachedMock);
assertThat(capturedCommand.getValue()).isNotEqualTo(dispachedMock);
}

}