【问题标题】:Mock a REST-request with a custom content-type with restito使用 restito 模拟具有自定义内容类型的 REST 请求
【发布时间】:2014-03-26 10:15:20
【问题描述】:

是否可以使用具有自定义 Content-Type 的 restito 创建一个模拟?我的意思不是应用程序/xml 和应用程序/json。我不知道该怎么做?

【问题讨论】:

    标签: java rest testing mocking tdd


    【解决方案1】:

    例如

        whenHttp(server).
        match(Condition.get("/" + SOME_URI), Condition.withHeader("Accept", "application/xml") ).
        then(Action.ok(), Action.contentType("application/xml"), stringContent(xml)); 
    

    【讨论】:

      猜你喜欢
      • 2012-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多