File tree 1 file changed +20
-0
lines changed
hibernate-reactive-core/src/test/java/org/hibernate/reactive
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,26 @@ public void testBatching(VertxTestContext context) {
145
145
);
146
146
}
147
147
148
+ @ Test
149
+ public void testBatchingWithStateless (VertxTestContext context ) {
150
+ final GuineaPig [] pigs = {
151
+ new GuineaPig ( 11 , "One" ),
152
+ new GuineaPig ( 22 , "Two" ),
153
+ new GuineaPig ( 33 , "Three" )
154
+ };
155
+ test ( context , getMutinySessionFactory ()
156
+ .withStatelessTransaction ( s -> s .insertAll ( 10 , pigs ) )
157
+ .invoke ( () -> {
158
+ // We expect only one insert query
159
+ assertThat ( sqlTracker .getLoggedQueries () ).hasSize ( 1 );
160
+ // Parameters are different for different dbs, so we cannot do an exact match
161
+ assertThat ( sqlTracker .getLoggedQueries ().get ( 0 ) )
162
+ .matches ("insert into pig \\ (name,version,id\\ ) values (.*)" );
163
+ sqlTracker .clear ();
164
+ } )
165
+ );
166
+ }
167
+
148
168
@ Test
149
169
public void testBatchingConnection (VertxTestContext context ) {
150
170
test ( context , openSession ()
You can’t perform that action at this time.
0 commit comments