-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
修复由于毫秒数导致断言失败的问题 #491
base: master-jdk17
Are you sure you want to change the base?
修复由于毫秒数导致断言失败的问题 #491
Conversation
@@ -114,7 +114,7 @@ public void testCleanJobLog() { | |||
assertEquals(1, count); | |||
List<JobLogDO> logs = jobLogMapper.selectList(); | |||
assertEquals(1, logs.size()); | |||
assertEquals(log02, logs.get(0)); | |||
assertPojoEquals(log02, logs.get(0),"createTime"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个我测试了下,貌似不加也没问题哈?
另外,在 , 有个空格,代码排版哈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把 h2 的 createTime 改成 timestamp 类型并不能解决这个问题.
@@ -91,7 +91,7 @@ public void testCleanJobLog() { | |||
assertEquals(1, count); | |||
List<ApiAccessLogDO> logs = apiAccessLogMapper.selectList(); | |||
assertEquals(1, logs.size()); | |||
assertEquals(log02, logs.get(0)); | |||
assertPojoEquals(log02, logs.get(0), "createTime"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个我测试了下,貌似不加也没问题哈?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
貌似不加也没问题
🤣 莫非遇到玄学环境问题了.
@@ -157,7 +157,7 @@ public void testCleanJobLog() { | |||
assertEquals(1, count); | |||
List<ApiErrorLogDO> logs = apiErrorLogMapper.selectList(); | |||
assertEquals(1, logs.size()); | |||
assertEquals(log02, logs.get(0)); | |||
assertPojoEquals(log02, logs.get(0),"createTime"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个我测试了下,貌似不加也没问题哈?
@@ -355,9 +355,9 @@ public void testSubmitOrder_channelError() { | |||
when(client.unifiedOrder(argThat(payOrderUnifiedReqDTO -> { | |||
assertNotNull(payOrderUnifiedReqDTO.getOutTradeNo()); | |||
assertThat(payOrderUnifiedReqDTO) | |||
.extracting("subject", "body", "notifyUrl", "returnUrl", "price", "expireTime") | |||
.extracting("subject", "body", "notifyUrl", "returnUrl", "price") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是还是倾向,解决 expireTime 可以被比较哈?
OAuth2ApproveDO approve = randomPojo(OAuth2ApproveDO.class).setUserId(userId) | ||
.setUserType(userType).setClientId(clientId).setExpiresTime(LocalDateTimeUtil.offset(LocalDateTime.now(), 1L, ChronoUnit.DAYS)); | ||
.setUserType(userType).setClientId(clientId).setExpiresTime(localDateTime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以考虑把 h2 对应的字段,改成 timestamp,提供到 nanoseconds,这样更简单一点
@@ -251,7 +251,7 @@ public void testRemoveAccessToken_null() { | |||
public void testRemoveAccessToken_success() { | |||
// mock 数据(访问令牌) | |||
OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class) | |||
.setExpiresTime(LocalDateTime.now().plusDays(1)); | |||
.setExpiresTime(LocalDateTime.now().plusDays(1).withNano(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以考虑把 h2 对应的字段,改成 timestamp,提供到 nanoseconds,这样更简单一点
哈罗~我看已经改动完了。 是不是一些地方强制 nanoseconds 为 0,貌似可以去掉了哈。 |
包括 createtime 忽略,是不是可以试试,不忽略哈。 |
只修改 timestamp 并更换 JDK 成 Oracle 17.0.6 依然无法通过单元测试. |
方便加下 wangwenbin-server 我有点复现补出单测跑失败的情况 |
你本机是什么操作系统? 不确定是不是跟操作系统有点关系。我跑 mac 倒是没碰到过。 |
应该是 win11 会存在 这块我要找个 win11 电脑折腾下 |
🤔 要不要给开发环境配一个 dev container 配置? |
我主要没 windows11 环境 = = 嘿嘿 |
# Conflicts: # yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImplTest.java # yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java # yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java # yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2CodeServiceImplTest.java # yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2TokenServiceImplTest.java
No description provided.