@@ -31,6 +31,7 @@ import reactor.core.publisher.Mono
|
||||
* Unit tests for [ReactiveGeoOperationsExtensions].
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
class ReactiveGeoOperationsExtensionsUnitTests {
|
||||
|
||||
@@ -109,6 +110,21 @@ class ReactiveGeoOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `distance returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveGeoOperations<String, String>>()
|
||||
every { operations.distance(any(), any(), any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.distanceAndAwait("foo", "from", "to")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.distance("foo", "from", "to")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun distanceWithMetric() {
|
||||
|
||||
@@ -124,6 +140,21 @@ class ReactiveGeoOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `distance with Metric returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveGeoOperations<String, String>>()
|
||||
every { operations.distance(any(), any(), any(), any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.distanceAndAwait("foo", "from", "to", Metrics.KILOMETERS)).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.distance("foo", "from", "to", Metrics.KILOMETERS)
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun hash() {
|
||||
|
||||
@@ -139,6 +170,21 @@ class ReactiveGeoOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `hash returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveGeoOperations<String, String>>()
|
||||
every { operations.hash(any(), any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.hashAndAwait("foo", "bar")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.hash("foo", "bar")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun hashVararg() {
|
||||
|
||||
@@ -170,6 +216,21 @@ class ReactiveGeoOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `position returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveGeoOperations<String, String>>()
|
||||
every { operations.position(any(), any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.positionAndAwait("foo", "bar")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.position("foo", "bar")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun positionVararg() {
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import reactor.core.publisher.Mono
|
||||
* Unit tests for [ReactiveHashOperationsExtensions].
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
class ReactiveHashOperationsExtensionsUnitTests {
|
||||
|
||||
@@ -60,6 +61,21 @@ class ReactiveHashOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `get returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveHashOperations<String, String, String>>()
|
||||
every { operations.get(any(), any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.getAndAwait("foo", "bar")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.get("foo", "bar")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun multiGet() {
|
||||
|
||||
@@ -179,4 +195,19 @@ class ReactiveHashOperationsExtensionsUnitTests {
|
||||
operations.remove("foo", "bar")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun delete() {
|
||||
|
||||
val operations = mockk<ReactiveHashOperations<String, String, String>>()
|
||||
every { operations.delete(any()) } returns Mono.just(true)
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.deleteAndAwait("foo")).isTrue()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.delete("foo")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import reactor.core.publisher.Mono
|
||||
import java.time.Duration
|
||||
|
||||
/**
|
||||
* Unit tests for [ReactiveHyperLogLogOperationsExtensions]
|
||||
* Unit tests for [ReactiveListOperationsExtensions]
|
||||
*
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.time.Instant
|
||||
* Unit tests for [ReactiveRedisOperationsExtensions].
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
class ReactiveRedisOperationsExtensionsUnitTests {
|
||||
|
||||
@@ -93,6 +94,21 @@ class ReactiveRedisOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `randomKey returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveRedisOperations<String, String>>()
|
||||
every { operations.randomKey() } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.randomKeyAndAwait()).isNull();
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.randomKey()
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun rename() {
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import reactor.core.publisher.Mono
|
||||
* Unit tests for [ReactiveSetOperationsExtensions].
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
class ReactiveSetOperationsExtensionsUnitTests {
|
||||
|
||||
@@ -75,6 +76,21 @@ class ReactiveSetOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `pop returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveSetOperations<String, String>>()
|
||||
every { operations.pop(any()) } returns Mono.empty();
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.popAndAwait("foo")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.pop("foo")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun move() {
|
||||
|
||||
@@ -225,6 +241,21 @@ class ReactiveSetOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `randomMember returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveSetOperations<String, String>>()
|
||||
every { operations.randomMember(any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.randomMemberAndAwait("foo")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.randomMember("foo")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun delete() {
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.time.Duration
|
||||
* Unit tests for [ReactiveValueOperationsExtensions].
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
class ReactiveValueOperationsExtensionsUnitTests {
|
||||
|
||||
@@ -167,6 +168,21 @@ class ReactiveValueOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `get returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveValueOperations<String, String>>()
|
||||
every { operations.get(any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.getAndAwait("foo")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.get("foo")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun getAndSet() {
|
||||
|
||||
@@ -182,6 +198,21 @@ class ReactiveValueOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `getAndSet returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveValueOperations<String, String>>()
|
||||
every { operations.getAndSet(any(), any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.getAndSetAndAwait("foo", "bar")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.getAndSet("foo", "bar")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun multiGet() {
|
||||
|
||||
@@ -302,6 +333,21 @@ class ReactiveValueOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `getSubstring returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveValueOperations<String, String>>()
|
||||
every { operations.get(any(), any(), any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.getAndAwait("foo", 1, 2)).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.get("foo", 1, 2)
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun setSubstring() {
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import reactor.core.publisher.Mono
|
||||
* Unit tests for [ReactiveZSetOperationsExtensions].
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
class ReactiveZSetOperationsExtensionsUnitTests {
|
||||
|
||||
@@ -108,6 +109,21 @@ class ReactiveZSetOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `rank returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveZSetOperations<String, String>>()
|
||||
every { operations.rank(any(), any()) } returns Mono.empty();
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.rankAndAwait("foo", "bar")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.rank("foo", "bar")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun reverseRank() {
|
||||
|
||||
@@ -123,6 +139,21 @@ class ReactiveZSetOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `reverseRank returning an enpty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveZSetOperations<String, String>>()
|
||||
every { operations.reverseRank(any(), any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.reverseRankAndAwait("foo", "bar")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.reverseRank("foo", "bar")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun count() {
|
||||
|
||||
@@ -153,6 +184,21 @@ class ReactiveZSetOperationsExtensionsUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun `score returning an empty Mono`() {
|
||||
|
||||
val operations = mockk<ReactiveZSetOperations<String, String>>()
|
||||
every { operations.score(any(), any()) } returns Mono.empty()
|
||||
|
||||
runBlocking {
|
||||
assertThat(operations.scoreAndAwait("foo", "bar")).isNull()
|
||||
}
|
||||
|
||||
verify {
|
||||
operations.score("foo", "bar")
|
||||
}
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-937
|
||||
fun removeRange() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user