Skip to content

Commit 33e90fc

Browse files
committed
Add integration tests for null decode
[resolves #163]
1 parent cdfe52c commit 33e90fc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/java/io/r2dbc/mssql/ParametrizedMssqlStatementIntegrationTests.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import reactor.core.publisher.Mono;
2424
import reactor.test.StepVerifier;
2525

26+
import java.util.Optional;
27+
2628
/**
2729
* Integration tests for {@link ParametrizedMssqlStatement}.
2830
*
@@ -54,4 +56,20 @@ void shouldExecuteBatch() {
5456
.expectNext(1, 1, 1)
5557
.verifyComplete();
5658
}
59+
60+
@Test
61+
void shouldDecodeNull() {
62+
63+
shouldExecuteBatch();
64+
65+
Flux.from(connection.createStatement("SELECT null, first_name FROM r2dbc_example")
66+
.execute())
67+
.flatMap(result -> result.map((row, rowMetadata) -> {
68+
return Optional.ofNullable(row.get(0));
69+
}))
70+
.as(StepVerifier::create)
71+
.expectNext(Optional.empty(), Optional.empty(), Optional.empty())
72+
.verifyComplete();
73+
}
74+
5775
}

0 commit comments

Comments
 (0)