Skip to content

Commit c3fb8b3

Browse files
schaudermp911de
authored andcommitted
#189 - Polishing.
Made assertions in tests more strict.
1 parent 1675af7 commit c3fb8b3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: src/main/java/org/springframework/data/r2dbc/core/DefaultDatabaseClient.java

+1
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ class ExecuteSpecSupport {
343343

344344
ExecuteSpecSupport(Map<Integer, SettableValue> byIndex, Map<String, SettableValue> byName,
345345
Supplier<String> sqlSupplier, StatementFilterFunction filterFunction) {
346+
346347
this.byIndex = byIndex;
347348
this.byName = byName;
348349
this.sqlSupplier = sqlSupplier;

Diff for: src/test/java/org/springframework/data/r2dbc/core/DefaultDatabaseClientUnitTests.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ public void shouldApplyExecuteFunction() {
492492
.as(StepVerifier::create) //
493493
.expectNextCount(1).verifyComplete();
494494

495-
verify(statement, never()).execute();
495+
verifyNoInteractions(statement);
496496
}
497497

498498
@Test // gh-189
@@ -524,6 +524,7 @@ public void shouldApplyStatementFilterFunctions() {
524524
inOrder.verify(statement).returnGeneratedValues("foo");
525525
inOrder.verify(statement).returnGeneratedValues("bar");
526526
inOrder.verify(statement).execute();
527+
inOrder.verifyNoMoreInteractions();
527528
}
528529

529530
@Test // gh-189
@@ -551,7 +552,10 @@ public void shouldApplyStatementFilterFunctionsToTypedExecute() {
551552
.as(StepVerifier::create) //
552553
.verifyComplete();
553554

554-
verify(statement).returnGeneratedValues("foo");
555+
InOrder inOrder = inOrder(statement);
556+
inOrder.verify(statement).returnGeneratedValues("foo");
557+
inOrder.verify(statement).execute();
558+
inOrder.verifyNoMoreInteractions();
555559
}
556560

557561
@Test // gh-189
@@ -583,6 +587,7 @@ public void shouldApplySimpleStatementFilterFunctions() {
583587
inOrder.verify(statement).returnGeneratedValues("foo");
584588
inOrder.verify(statement).returnGeneratedValues("bar");
585589
inOrder.verify(statement).execute();
590+
inOrder.verifyNoMoreInteractions();
586591
}
587592

588593
static class Person {

0 commit comments

Comments
 (0)