V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hqtc
V2EX  ›  Java

如何 Mock 一个 SipServletRequest 对象

  •  
  •   hqtc · 2017-10-06 10:37:45 +08:00 · 2190 次点击
    这是一个创建于 2385 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如题, 现在的项目使用了 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 ?

    3 条回复    2017-10-06 12:31:04 +08:00
    hqtc
        1
    hqtc  
    OP
       2017-10-06 11:24:02 +08:00
    算了,玛德我自己搞一个!

    ```
    public class HqSipRequest implements SipServletRequest
    ```
    xgfan
        2
    xgfan  
       2017-10-06 11:49:00 +08:00
    应该要把 snapshot 去掉吧。
    或者添加一下仓库。一般 snapshot 都不在主仓库里。
    xgfan
        3
    xgfan  
       2017-10-06 12:31:04 +08:00   ❤️ 1
    查了一下。
    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
    看看新的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5360 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 01:22 · PVG 09:22 · LAX 18:22 · JFK 21:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.