Karate - Database testing - getting timestamp displayed as nano

孤者浪人 提交于 2019-12-11 07:06:45

问题


I am trying to run some basic database tests using Karate and Spring JDBC ( as mentioned in DBUtils class in Demo Project).

Here is what I am doing:

 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

Here is what it returns:

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

Not sure why it should return timestamp as "nanos":0 , seems a bug to me . Please confirm and I will open one in github.


回答1:


This is not a problem with Karate it is the implementation of DbUtils. It is up to you to write something that is right for your environment and database etc. Remember this is just part of the karate-demo as an example.



来源:https://stackoverflow.com/questions/46961265/karate-database-testing-getting-timestamp-displayed-as-nano

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!