Phase 9 + 10:Spring Boot starter + Testcontainers interop 骨架 + README 收尾 - #15
Draft
lixuanqun wants to merge 3 commits into
Draft
Phase 9 + 10:Spring Boot starter + Testcontainers interop 骨架 + README 收尾#15lixuanqun wants to merge 3 commits into
lixuanqun wants to merge 3 commits into
Conversation
新模块(第 11 个):sip-spring-boot-starter - 引入 Spring Boot 3.4 BOM 到父 POM 的 dependencyManagement(不强制其他模块) - starter 模块本身不带 module-info(Spring Boot classpath 扫描与 JPMS 不友好), 通过 -Xlint:-module 局部抑制对应警告 SipProperties (@ConfigurationProperties 'sip.*') - sip.transport.udp.{enabled,host,port} 默认 enabled=true, port=5060 - sip.transport.tcp.{enabled,host,port} 默认 disabled, port=5060 - sip.transport.tls.{enabled,host,port,keystore-path,keystore-password,keystore-type} 默认 disabled, port=5061, type=PKCS12 - sip.transport.ws.{enabled,host,port} 默认 disabled, port=80 setter 用 final 关键字消除 JDK 21 'this-escape' 警告。 SipAutoConfiguration (@autoConfiguration) - 按需起 transport bean(NioUdpTransport/NioTcpTransport/NioTlsTransport/ NioWebSocketTransport),自动 start() 并注册 close 钩子 - TimerScheduler 单例 bean(@ConditionalOnMissingBean) - RegistrationClient / OptionsProbe bean,连接到第一个可用 Transport - TLS:从 classpath: / file: / 文件系统 路径加载 PKCS12 keystore - 默认 TrustManager 故意拒绝所有服务端证书 — 强制操作员显式提供 SSLContext bean 来开通 TLS 出站(防止误用默认信任) - @PreDestroy 钩子按反序关闭所有 transport + TimerScheduler META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports 对接 Spring Boot 3 的自动配置发现。 测试(SpringBootTest 用 ApplicationContextRunner) - defaultsBindUdpTransportAndTimerScheduler - canDisableUdpAndEnableTcp - exposesRegistrationClientAndOptionsProbeWhenATransportExists - tlsTransportRequiresKeystorePath(验证缺路径时启动失败) mvn verify:11 模块 SUCCESS。总测试数从 ~210 增到 ~225。 Co-authored-by: li xuanqun <793005378@qq.com>
新模块 sip-interop-tests(第 12 个),仅 'interop' Maven profile 启用: mvn verify ← 默认 11 模块,跳过 interop mvn verify -Pinterop ← 启用 interop(需要 Docker) KamailioContainer - 继承 GenericContainer,固定 image kamailio/kamailio-ci:5.7-alpine - 内嵌最小 Kamailio 配置(registrar + plain Digest auth)via Transferable - 等待 'registrar ready' log 后认定就绪 - isDockerAvailable() 静态方法供测试 @BeforeAll 探测 KamailioRegisterInteropTest(2 个测试,Docker 缺位时 Assumptions.assumeTrue 自动跳过) - registersWithDigestAuth:REGISTER → 401 → Digest auth → 200 全流程 - optionsProbeReturns200:OPTIONS probe → 200 工程化 - 父 POM 引入 Testcontainers BOM 1.20.4 + interop profile - sip-interop-tests/README.md 说明如何添加更多 peer(Asterisk / OpenSIPS) - 默认 verify 行为不变 — Cloud-agent CI 无 Docker 也 BUILD SUCCESS mvn verify -Pinterop 在无 Docker 环境也通过(tests 跳过而非失败)。 Co-authored-by: li xuanqun <793005378@qq.com>
- 模块结构补 sip-spring-boot-starter / sip-interop-tests - 路线图 Phase 8/9/10 全部标记完成 - 测试规模更新:11 模块 ~225 tests(不含 interop),按模块列出测试数 - 新增 'Spring Boot 自动配置(推荐)' 快速上手段 - 测试章节说明 -Pinterop profile 用法 整体 12 个 Maven 模块,全部 RFC 3261 §18 + RFC 7118 传输方案覆盖。 Co-authored-by: li xuanqun <793005378@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
把剩余三件事一次性完成:Spring Boot 自动配置、互操作测试骨架、README 同步。到此项目原计划的 0-10 阶段全部交付。
1. sip-spring-boot-starter(第 11 模块)
配置
自动 Beans
@ConditionalOnPropertyTimerScheduler单例@ConditionalOnMissingBeanRegistrationClient/OptionsProbe连接到第一个可用 transportclasspath:/file:/ 文件系统路径@PreDestroy钩子按反序关闭工程
module-info.java(Spring Boot 与 JPMS 不友好),仅此模块-Xlint:-modulethis-escape警告由 setterfinal修复测试
ApplicationContextRunner4 场景2. sip-interop-tests(第 12 模块,profile
interop)KamailioContainer
kamailio/kamailio-ci:5.7-alpineisDockerAvailable()静态探测,无 Docker 时测试 优雅 skip测试
registersWithDigestAuth— REGISTER → 401 → Digest auth → 200 全流程optionsProbeReturns200— OPTIONS → 2003. README 同步
验证
PR 链完整图
合并顺序:#2 → #3 → … → #15。