我尝试在Sping Boot 中实现QR Code Generator的示例。我在服务测试和控制器测试中遇到问题。在服务测试中,我无法解码QRCodeReader().decode(binaryBitmap)
中的字节值,当我运行任何测试方法时,都会收到以下错误消息
`com.google.zxing.NotFoundException`
在控制器测试中,当我运行任何测试方法时,我得到如下所示的错误消息
MockHttpServletResponse:
Status = 400
Error message = null
Headers = [Content-Type:"application/problem+json"]
Content type = application/problem+json
Body = {"type":"about:blank","title":"Bad Request","status":400,"detail":"Required part 'text' is not present.","instance":"/api/v1/qr-generator"}
Forwarded URL = null
Redirected URL = null
Cookies = []
java.lang.AssertionError: Status expected:<201> but was:<400>
Expected :201
Actual :400
我该怎么修呢?
下面是链接:Link
1条答案
按热度按时间c3frrgcw1#
修改虚拟数据类后,问题消失。