空手道-数据库测试-将时间戳显示为nano [英] Karate - Database testing - getting timestamp displayed as nano
本文介绍了空手道-数据库测试-将时间戳显示为nano的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Karate和Spring JDBC运行一些基本的数据库测试(如在Demo Project中的DBUtils类中提到的那样).
I am trying to run some basic database tests using Karate and Spring JDBC ( as mentioned in DBUtils class in Demo Project).
这是我在做什么:
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
这是它返回的内容:
com.intuit.karate - [print] [{"crtd_ts":{"nanos":0}},{"crtd_ts":{"nanos":0}}
不确定为什么为什么要将时间戳返回为"nanos":0,这对我来说似乎是个错误.请确认,我将在github中打开一个.
Not sure why it should return timestamp as "nanos":0 , seems a bug to me . Please confirm and I will open one in github.
推荐答案
空手道不是问题,它是DbUtils
的实现.您可以自行编写适合您的环境和数据库等内容的内容.请记住,这只是karate-demo
的一部分.
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.
这篇关于空手道-数据库测试-将时间戳显示为nano的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文