File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
vertx-db2-client/src/test/java/io/vertx/db2client Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 19
19
20
20
import java .sql .RowId ;
21
21
import java .time .LocalDateTime ;
22
+ import java .time .temporal .ChronoField ;
22
23
import java .util .Arrays ;
23
24
24
25
import org .junit .Test ;
@@ -124,8 +125,10 @@ public void testTimestamp(TestContext ctx) {
124
125
.execute (Tuple .of (5 ), ctx .asyncAssertSuccess (rows -> {
125
126
ctx .assertEquals (1 , rows .size ());
126
127
Row row = rows .iterator ().next ();
128
+ int nowNanos = now .getNano () - (1000 * now .get (ChronoField .MICRO_OF_SECOND ));
129
+ int dbNanos = row .getLocalDateTime (1 ).getNano () - (1000 * row .getLocalDateTime (1 ).get (ChronoField .MICRO_OF_SECOND ));
127
130
ctx .assertEquals (5 , row .getInteger (0 ));
128
- ctx .assertEquals (now , row .getLocalDateTime (1 ));
131
+ ctx .assertEquals (dbNanos > 0 ? now : now . minusNanos ( nowNanos ) , row .getLocalDateTime (1 ));
129
132
}));
130
133
}));
131
134
}));
You can’t perform that action at this time.
0 commit comments