我在 Play 2.6 上,使用 Java
我的控制器返回:
public Result xml() {
return Results.ok(new ByteArrayInputStream("<someXml />".getBytes()));
}
我想在测试中解析结果:
Result result = new MyController().xml();
play.test.Helpers.contentAsString(result)
这抛出
failed: java.lang.UnsupportedOperationException: Tried to extract body from a non strict HTTP entity without a materializer, use the version of this method that accepts a materializer instead
如何检索测试中输入流发出的结果内容?