@@ -145,6 +145,29 @@ public void testBatching(VertxTestContext context) {
145145 );
146146 }
147147
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+ new GuineaPig ( 44 , "Four" ),
155+ new GuineaPig ( 55 , "Five" ),
156+ new GuineaPig ( 66 , "Six" ),
157+ };
158+ test ( context , getMutinySessionFactory ()
159+ .withStatelessTransaction ( s -> s .insertAll ( 10 , pigs ) )
160+ .invoke ( () -> {
161+ // We expect only one insert query
162+ assertThat ( sqlTracker .getLoggedQueries () ).hasSize ( 1 );
163+ // Parameters are different for different dbs, so we cannot do an exact match
164+ assertThat ( sqlTracker .getLoggedQueries ().get ( 0 ) )
165+ .matches ("insert into pig \\ (name,version,id\\ ) values (.*)" );
166+ sqlTracker .clear ();
167+ } )
168+ );
169+ }
170+
148171 @ Test
149172 public void testBatchingConnection (VertxTestContext context ) {
150173 test ( context , openSession ()
0 commit comments