Skip to content

Commit c201c41

Browse files
committed
Add test for processing LocalDateTime objects
1 parent 8d20500 commit c201c41

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

postgresql-async/src/test/scala/com/github/mauricio/async/db/postgresql/TimeAndDateSpec.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,22 @@ class TimeAndDateSpec extends Specification with DatabaseTestHelper {
200200

201201
}
202202

203+
"handle sending a LocalDateTime and return a LocalDateTime for a timestamp without timezone column" in {
204+
205+
withTimeHandler {
206+
conn =>
207+
val date1 = new LocalDateTime(2190319)
208+
209+
await(conn.sendPreparedStatement("CREATE TEMP TABLE TEST(T TIMESTAMP)"))
210+
await(conn.sendPreparedStatement("INSERT INTO TEST(T) VALUES(?)", Seq(date1)))
211+
val result = await(conn.sendPreparedStatement("SELECT T FROM TEST"))
212+
val date2 = result.rows.get.head(0)
213+
214+
date2 === date1
215+
}
216+
217+
}
218+
203219
"handle sending a date with timezone and retrieving the date with the same time zone" in {
204220

205221
withTimeHandler {

0 commit comments

Comments
 (0)