空手道 - 数据库测试 - 获取显示为 nano 的时间戳

Karate - Database testing - getting timestamp displayed as nano

我正在尝试 运行 使用空手道和 Spring JDBC 进行一些基本的数据库测试(如演示项目中的 DBUtils class 所述)。

这是我正在做的事情:

 Background:
    # Read url/username/pwd and provide it to the class
    * def config = read('env_file.json')
    * def DbUtils = Java.type('DbConnection')
    * def db = new DbUtils(config)

 Scenario: Validate the modd_ts is present in lob table

    * def createdTs = db.readRows('SELECT crtd_ts FROM tableA ')
    * print createdTs

这是 returns:

com.intuit.karate - [print] [{"crtd_ts":{"nanos":0}},{"crtd_ts":{"nanos":0}}

不确定为什么它应该 return 时间戳为 "nanos":0,对我来说似乎是一个错误。请确认,我会在 github.

打开一个

这不是空手道的问题,而是 DbUtils 的实施。您可以自行编写适合您的环境和数据库等的内容。请记住,这只是 karate-demo 示例的一部分。