Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii committed Sep 29, 2023
1 parent 18efab8 commit 5d0cf0a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.getquill.context.jasync.postgres

import java.time.{LocalDate, LocalDateTime}

import io.getquill.context.sql.EncodingSpec

import scala.concurrent.ExecutionContext.Implicits.global
Expand All @@ -11,6 +10,8 @@ import java.util.Date
import java.util.UUID
import io.getquill.Query

import java.time.temporal.ChronoUnit

class PostgresAsyncEncodingSpec extends EncodingSpec {

val context = testContext
Expand Down Expand Up @@ -92,7 +93,7 @@ class PostgresAsyncEncodingSpec extends EncodingSpec {

"decodes LocalDate and LocalDateTime types" in {
case class DateEncodingTestEntity(v1: LocalDate, v2: LocalDateTime)
val entity = DateEncodingTestEntity(LocalDate.now, LocalDateTime.now)
val entity = DateEncodingTestEntity(LocalDate.now, LocalDateTime.now.truncatedTo(ChronoUnit.MICROS)) // https://stackoverflow.com/a/74781779/2431728
val r = for {
_ <- testContext.run(query[DateEncodingTestEntity].delete)
_ <- testContext.run(query[DateEncodingTestEntity].insertValue(lift(entity)))
Expand Down

0 comments on commit 5d0cf0a

Please sign in to comment.