[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: fix test
From: |
gnunet |
Subject: |
[libeufin] branch master updated: fix test |
Date: |
Sat, 23 Oct 2021 08:41:21 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new c1a218f fix test
c1a218f is described below
commit c1a218fa71a971c0d5317eb91b442bd4a2b88f06
Author: ms <ms@taler.net>
AuthorDate: Sat Oct 23 08:41:13 2021 +0200
fix test
---
sandbox/src/test/kotlin/DBTest.kt | 13 +++++++------
util/src/main/kotlin/time.kt | 5 -----
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/sandbox/src/test/kotlin/DBTest.kt
b/sandbox/src/test/kotlin/DBTest.kt
index 9a08727..0cb5bf2 100644
--- a/sandbox/src/test/kotlin/DBTest.kt
+++ b/sandbox/src/test/kotlin/DBTest.kt
@@ -22,7 +22,6 @@ import org.jetbrains.exposed.sql.transactions.transaction
import org.junit.Test
import tech.libeufin.sandbox.*
import tech.libeufin.util.millis
-import tech.libeufin.util.parseDashedDate
import java.io.File
import java.time.LocalDateTime
@@ -97,16 +96,18 @@ class DBTest {
this.demobank = demobank
}
}
- val result = transaction {
+ // The block below tests the date range in the database query
+ transaction {
addLogger(StdOutSqlLogger)
BankAccountTransactionEntity.find {
BankAccountTransactionsTable.date.between(
-
parseDashedDate("1970-01-01").toInstant().toEpochMilli(),
- LocalDateTime.now().millis()
+ 0, // 1970-01-01
+ LocalDateTime.now().millis() //
)
- }.firstOrNull()
+ }.apply {
+ assert(this.count() == 1L)
+ }
}
- assert(result != null)
}
}
}
\ No newline at end of file
diff --git a/util/src/main/kotlin/time.kt b/util/src/main/kotlin/time.kt
index 767194a..bbdb314 100644
--- a/util/src/main/kotlin/time.kt
+++ b/util/src/main/kotlin/time.kt
@@ -42,11 +42,6 @@ fun ZonedDateTime.toDashedDate(): String {
return DateTimeFormatter.ISO_DATE.format(this)
}
-fun parseDashedDate(date: String): ZonedDateTime {
- val dtf = DateTimeFormatter.ISO_DATE
- return ZonedDateTime.parse(date, dtf)
-}
-
fun importDateFromMillis(millis: Long): ZonedDateTime {
return ZonedDateTime.ofInstant(
Instant.ofEpochMilli(millis),
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: fix test,
gnunet <=