自定义Arquillian ArquillianResteasyResource应用程序路径-该URL不支持错误的HTTP方法POST

问题描述

部署后,我的REST API可以正常工作,但是使用Jersey Arquillian扩展程序,我的测试失败:

notebook

我得到了错误:

@Test
@RunAsClient
public void postTest(@ArquillianResteasyResource final WebTarget webTarget) {

    MyRequest request = new MyRequest();

    String response = webTarget.path("/demo").request(MediaType.APPLICATION_JSON)
            .post(Entity.json(request)).readEntity(String.class);

    Assert.assertEquals("OK",response);

}

我的JAX-RS程序看起来不错:

Error HTTP method POST is not supported by this URL

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)