@@ -489,24 +489,25 @@ private <T> void testInferDataType42P18(TestContext ctx, Class<T> type, T value,
489489 }
490490
491491 private <T > void testInferDataType42P18 (TestContext ctx , Class <T > type , T value , String suffix1 , String suffix2 ) {
492+ PgConnection .connect (vertx , options ()).onComplete (ctx .asyncAssertSuccess (conn -> {
493+ conn
494+ .preparedQuery ("SELECT CONCAT('HELLO ', $1)" ).execute (Tuple .of (value ))
495+ .map (rows -> rows .iterator ().next ().getString (0 ))
496+ .eventually (() -> conn .close ())
497+ .onComplete (ctx .asyncAssertSuccess (str -> {
498+ ctx .assertEquals ("HELLO " + suffix1 , str );
499+ }));
500+ }));
492501 Object array = Array .newInstance (type , 1 );
493502 Array .set (array , 0 , value );
494- PgConnection .connect (vertx , options (), ctx .asyncAssertSuccess (conn -> {
503+ PgConnection .connect (vertx , options ()). onComplete ( ctx .asyncAssertSuccess (conn -> {
495504 conn
496- .preparedQuery ("SELECT CONCAT('HELLO ', $1)" ).execute (Tuple .of (value ))
497- .map (result1 -> {
498- Row row1 = result1 .iterator ().next ();
499- ctx .assertEquals ("HELLO " + suffix1 , row1 .getString (0 ));
500- return "" ;
501- })
502- .compose (v -> conn .preparedQuery ("SELECT CONCAT('HELLO ', $1)" ).execute (Tuple .of (array )))
503- .map (result2 -> {
504- Row row2 = result2 .iterator ().next ();
505- String v = row2 .getString (0 );
506- ctx .assertEquals ("HELLO " + suffix2 , row2 .getString (0 ));
507- return "" ;
508- })
509- .eventually (v -> conn .close ());
505+ .preparedQuery ("SELECT CONCAT('HELLO ', $1)" ).execute (Tuple .of (array ))
506+ .map (rows -> rows .iterator ().next ().getString (0 ))
507+ .eventually (() -> conn .close ())
508+ .onComplete (ctx .asyncAssertSuccess (str -> {
509+ ctx .assertEquals ("HELLO " + suffix2 , str );
510+ }));
510511 }));
511512 }
512513
0 commit comments