Skip to content

Commit

Permalink
Polishing.
Browse files Browse the repository at this point in the history
Reformat integration test.

See #573
Original pull request: #574.
  • Loading branch information
mp911de committed Apr 6, 2021
1 parent b7f9d7c commit 5397152
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ void shouldReadAndWriteGeoTypes() {

@Test // gh-573
void shouldReadAndWriteInterval() {

EntityWithInterval entityWithInterval = new EntityWithInterval();
entityWithInterval.interval = Interval.of(Duration.ofHours(3));

Expand All @@ -261,11 +262,12 @@ void shouldReadAndWriteInterval() {
R2dbcEntityTemplate template = new R2dbcEntityTemplate(client,
new DefaultReactiveDataAccessStrategy(PostgresDialect.INSTANCE));

EntityWithInterval saved = template.insert(entityWithInterval).block();
EntityWithInterval loaded = template.select(Query.empty(), EntityWithInterval.class) //
.blockLast();
template.insert(entityWithInterval).thenMany(template.select(Query.empty(), EntityWithInterval.class)) //
.as(StepVerifier::create) //
.consumeNextWith(actual -> {

assertThat(saved.interval).isEqualTo(loaded.interval);
assertThat(actual.getInterval()).isEqualTo(entityWithInterval.interval);
}).verifyComplete();
}

private void insert(EntityWithArrays object) {
Expand Down

0 comments on commit 5397152

Please sign in to comment.