@@ -37,6 +37,7 @@ import org.springframework.data.redis.connection.stream.StreamRecords;
|
||||
* @author Christoph Strobl
|
||||
* @author Ninad Divadkar
|
||||
* @author Mark Paluch
|
||||
* @author dengliming
|
||||
*/
|
||||
public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedisConnectionTests {
|
||||
|
||||
@@ -514,8 +515,7 @@ public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedi
|
||||
@Test
|
||||
public void testLPopBytes() {
|
||||
doReturn(Arrays.asList(new Object[] { barBytes })).when(nativeConnection).closePipeline();
|
||||
actual.add(connection.lPop(fooBytes));
|
||||
verifyResults(Arrays.asList(new Object[] { barBytes }));
|
||||
super.testLPopBytes();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -524,6 +524,18 @@ public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedi
|
||||
super.testLPop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLPopCountBytes() {
|
||||
doReturn(Collections.singletonList(bytesList)).when(nativeConnection).closePipeline();
|
||||
super.testLPopCountBytes();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLPopCount() {
|
||||
doReturn(Collections.singletonList(bytesList)).when(nativeConnection).closePipeline();
|
||||
super.testLPopCount();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLPushBytes() {
|
||||
doReturn(Collections.singletonList(8L)).when(nativeConnection).closePipeline();
|
||||
@@ -668,6 +680,18 @@ public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedi
|
||||
super.testRPop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRPopCountBytes() {
|
||||
doReturn(Collections.singletonList(bytesList)).when(nativeConnection).closePipeline();
|
||||
super.testRPopCountBytes();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRPopCount() {
|
||||
doReturn(Collections.singletonList(bytesList)).when(nativeConnection).closePipeline();
|
||||
super.testRPopCount();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRPopLPushBytes() {
|
||||
doReturn(Arrays.asList(new Object[] { barBytes })).when(nativeConnection).closePipeline();
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.springframework.data.redis.connection.stream.StreamRecords;
|
||||
* @author Christoph Strobl
|
||||
* @author Ninad Divadkar
|
||||
* @author Mark Paluch
|
||||
* @author dengliming
|
||||
*/
|
||||
public class DefaultStringRedisConnectionPipelineTxTests extends DefaultStringRedisConnectionTxTests {
|
||||
|
||||
@@ -547,8 +548,7 @@ public class DefaultStringRedisConnectionPipelineTxTests extends DefaultStringRe
|
||||
public void testLPopBytes() {
|
||||
doReturn(Collections.singletonList(Arrays.asList(new Object[] { barBytes }))).when(nativeConnection)
|
||||
.closePipeline();
|
||||
actual.add(connection.lPop(fooBytes));
|
||||
verifyResults(Arrays.asList(new Object[] { barBytes }));
|
||||
super.testLPopBytes();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -558,6 +558,18 @@ public class DefaultStringRedisConnectionPipelineTxTests extends DefaultStringRe
|
||||
super.testLPop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLPopCountBytes() {
|
||||
doReturn(Collections.singletonList(Collections.singletonList(bytesList))).when(nativeConnection).closePipeline();
|
||||
super.testLPopCountBytes();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLPopCount() {
|
||||
doReturn(Collections.singletonList(Collections.singletonList(bytesList))).when(nativeConnection).closePipeline();
|
||||
super.testLPopCount();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLPushBytes() {
|
||||
doReturn(Collections.singletonList(Collections.singletonList(8L))).when(nativeConnection).closePipeline();
|
||||
@@ -718,6 +730,18 @@ public class DefaultStringRedisConnectionPipelineTxTests extends DefaultStringRe
|
||||
super.testRPop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRPopCountBytes() {
|
||||
doReturn(Collections.singletonList(Collections.singletonList(bytesList))).when(nativeConnection).closePipeline();
|
||||
super.testRPopCountBytes();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRPopCount() {
|
||||
doReturn(Collections.singletonList(Collections.singletonList(bytesList))).when(nativeConnection).closePipeline();
|
||||
super.testRPopCount();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRPopLPushBytes() {
|
||||
doReturn(Collections.singletonList(Arrays.asList(new Object[] { barBytes }))).when(nativeConnection)
|
||||
|
||||
@@ -70,6 +70,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
* @author Christoph Strobl
|
||||
* @author Ninad Divadkar
|
||||
* @author Mark Paluch
|
||||
* @author dengliming
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
@MockitoSettings(strictness = Strictness.LENIENT)
|
||||
@@ -669,6 +670,20 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(bar));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLPopCountBytes() {
|
||||
doReturn(Collections.singletonList(barBytes)).when(nativeConnection).lPop(fooBytes, 2);
|
||||
actual.add(connection.lPop(fooBytes, 2));
|
||||
verifyResults(Collections.singletonList(bytesList));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLPopCount() {
|
||||
doReturn(Collections.singletonList(barBytes)).when(nativeConnection).lPop(fooBytes, 2);
|
||||
actual.add(connection.lPop(foo, 2));
|
||||
verifyResults(Collections.singletonList(stringList));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLPushBytes() {
|
||||
doReturn(8L).when(nativeConnection).lPush(fooBytes, barBytes);
|
||||
@@ -837,6 +852,20 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(bar));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRPopCountBytes() {
|
||||
doReturn(Collections.singletonList(barBytes)).when(nativeConnection).rPop(fooBytes, 2);
|
||||
actual.add(connection.rPop(fooBytes, 2));
|
||||
verifyResults(Collections.singletonList(bytesList));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRPopCount() {
|
||||
doReturn(Collections.singletonList(barBytes)).when(nativeConnection).rPop(fooBytes, 2);
|
||||
actual.add(connection.rPop(foo, 2));
|
||||
verifyResults(Collections.singletonList(stringList));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRPopLPushBytes() {
|
||||
doReturn(barBytes).when(nativeConnection).rPopLPush(fooBytes, barBytes);
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.springframework.data.redis.test.extension.parametrized.ParameterizedR
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
* @author Michele Mancioppi
|
||||
* @author dengliming
|
||||
*/
|
||||
public class LettuceReactiveListCommandIntegrationTests extends LettuceReactiveCommandsTestSupport {
|
||||
|
||||
@@ -245,6 +246,9 @@ public class LettuceReactiveListCommandIntegrationTests extends LettuceReactiveC
|
||||
|
||||
assertThat(connection.listCommands().lPop(KEY_1_BBUFFER).block()).isEqualTo(VALUE_1_BBUFFER);
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1)).containsExactly(VALUE_2, VALUE_3);
|
||||
|
||||
assertThat(connection.listCommands().lPop(KEY_1_BBUFFER, 2).collectList().block()).isEqualTo(Arrays.asList(VALUE_2_BBUFFER, VALUE_3_BBUFFER));
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1)).isEmpty();
|
||||
}
|
||||
|
||||
@ParameterizedRedisTest // DATAREDIS-525
|
||||
|
||||
Reference in New Issue
Block a user