Skip to content

#4052 完善 NFC 小程序 scheme 接口测试#4053

Merged
binarywang merged 1 commit into
developfrom
codex/issue-4052-nfc-scheme
Jun 12, 2026
Merged

#4052 完善 NFC 小程序 scheme 接口测试#4053
binarywang merged 1 commit into
developfrom
codex/issue-4052-nfc-scheme

Conversation

@binarywang

Copy link
Copy Markdown
Owner

变更内容

  • 补充 WxMaGenerateNfcSchemeRequest 的 JSON 序列化测试,覆盖 jump_wxamodel_idsn 等官方字段
  • 将 NFC scheme 接口 JavaDoc 链接更新为 issue 中提供的官方文档地址
  • 修复 miniapp 测试中的 List.of 用法,避免 Java 8 testCompile 失败

验证

  • mvn -pl weixin-java-miniapp -Dtest=WxMaGenerateNfcSchemeRequestTest test:首次因既有 List.of Java 8 兼容性问题失败,已修复
  • mvn -pl weixin-java-miniapp -Dtest=WxMaGenerateNfcSchemeRequestTest test:编译通过,但项目 surefire 默认配置跳过测试执行
  • java -cp "weixin-java-miniapp/target/test-classes:weixin-java-miniapp/target/classes:$(cat weixin-java-miniapp/target/test-classpath.txt)" org.testng.TestNG -testclass cn.binarywang.wx.miniapp.bean.scheme.WxMaGenerateNfcSchemeRequestTest:1 个测试通过

Closes #4052

Copilot AI review requested due to automatic review settings June 11, 2026 13:23
@augmentcode

augmentcode Bot commented Jun 11, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: 完善 miniapp NFC 小程序 scheme 接口相关测试与文档说明。

Changes:

  • 新增 WxMaGenerateNfcSchemeRequest 的 JSON 序列化测试,覆盖 jump_wxa / model_id / sn 等字段
  • 更新 NFC scheme 接口的 JavaDoc 文档链接到新的官方地址
  • 修复测试中 List.of 的使用,改为 Java 8 兼容写法以避免编译失败

Technical Notes: 序列化基于 WxMaGsonBuilder,测试使用 TestNG + AssertJ。

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

+ " \"sn\": \"sn-demo\"\n"
+ "}";

assertThat(request.toJson()).isEqualTo(GsonParser.parse(expectedJson).toString());

@augmentcode augmentcode Bot Jun 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里直接断言 request.toJson() 的字符串相等,会受 JSON 字段顺序影响(JSON 语义上是无序的),后续若序列化顺序变化/新增字段可能导致非预期的测试失败。建议把两边都 parse 成 JSON 结构后做语义比较,以减少脆弱性。

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@binarywang

Copy link
Copy Markdown
Owner Author

@codex 请review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@binarywang binarywang merged commit 24d20b3 into develop Jun 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

集成小程序NFC的相关接口

2 participants