Skip to content

Commit

Permalink
Add integration tests for null decode
Browse files Browse the repository at this point in the history
[resolves #163]
  • Loading branch information
mp911de committed Jul 9, 2020
1 parent cdfe52c commit 33e90fc
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

import java.util.Optional;

/**
* Integration tests for {@link ParametrizedMssqlStatement}.
*
Expand Down Expand Up @@ -54,4 +56,20 @@ void shouldExecuteBatch() {
.expectNext(1, 1, 1)
.verifyComplete();
}

@Test
void shouldDecodeNull() {

shouldExecuteBatch();

Flux.from(connection.createStatement("SELECT null, first_name FROM r2dbc_example")
.execute())
.flatMap(result -> result.map((row, rowMetadata) -> {
return Optional.ofNullable(row.get(0));
}))
.as(StepVerifier::create)
.expectNext(Optional.empty(), Optional.empty(), Optional.empty())
.verifyComplete();
}

}

0 comments on commit 33e90fc

Please sign in to comment.