如何 Mock 一个 SipServletRequest 对象

2017-10-06 10:37:45 +08:00
 hqtc

如题, 现在的项目使用了 mobicents 的 Sip 协议 Java 实现,需要进行单元测试。但是怎么 mock 一个请求对象呢,使用 jMOckit 搞不出来。mobisents 提供了一个依赖:

http://www.mobicents.org/mss/ssf/sf-api/site/en/mock-test.html

<dependency>
        <groupId>org.mobicents.ssf</groupId>
        <artifactId>sf-mock</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <scope>test</scope>
        <optional>false</optional>
</dependency>

但是 Maven 仓库中找不到这个 jar 了,有谁搞过这个或者有办法搞到 jar ?

2198 次点击
所在节点    Java
3 条回复
hqtc
2017-10-06 11:24:02 +08:00
算了,玛德我自己搞一个!

```
public class HqSipRequest implements SipServletRequest
```
xgfan
2017-10-06 11:49:00 +08:00
应该要把 snapshot 去掉吧。
或者添加一下仓库。一般 snapshot 都不在主仓库里。
xgfan
2017-10-06 12:31:04 +08:00
查了一下。
http://www.mobicents.org/community.html
点 Forums 进去就会发现
```
Mobicents was rebranded to RestComm. Read more at http://www.telestax.com/restcomm-developer-mobicents/.

As such there is a new Google Group at http://www.telestax.com/restcomm-developer-mobicents/ or you can also use http://stackoverflow.com/questions/tagged/restcomm
```
所以 lz 的这些资料应该是很久以前的了。
可以去
https://github.com/RestComm/sip-servlets
看看新的。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/395610

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX