执行第一次错误,但是存入数据,执行第二成功
来源:9-26 编写用户功能服务测试用例

nano深空彼方
2020-07-21
但是执行第二次就test通过了是为什么啊
执行部分
System.out.println(JSON.toJSONString(
userService.findCouponsByStatus(
fakeUserId,
CouponStatus.USABLE.getCode()
)
));
第一次失败报错内容
2020-07-21 05:29:56.408 INFO 2832 — [ main] c.s.c.service.impl.RedisServiceImpl : save empty list to cache for User: 20001, status: [1]
2020-07-21 05:29:56.454 INFO 2832 — [ main] c.s.c.service.impl.RedisServiceImpl : Pipeline Exe Result: []
2020-07-21 05:29:56.475 INFO 2832 — [ main] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
Hibernate:
select
coupon0_.id as id1_0_,
coupon0_.assign_time as assign_t2_0_,
coupon0_.coupon_code as coupon_c3_0_,
coupon0_.status as status4_0_,
coupon0_.templated_id as template5_0_,
coupon0_.user_id as user_id6_0_
from
coupon coupon0_
where
coupon0_.user_id=?
and coupon0_.status=?
2020-07-21 05:29:56.605 WARN 2832 — [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1054, SQLState: 42S22
2020-07-21 05:29:56.605 ERROR 2832 — [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : Unknown column ‘coupon0_.templated_id’ in ‘field list’
org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
1回答
-
nano深空彼方
提问者
2020-07-21
数据库映射表明的时候有个字段填写错误了 已找到
00
相似问题