Coding Global Background
Coding Global

com.google.zxing.NotFoundException Spring Boot QR Code Example JUnit Tests

Archived 3 years ago
_go2
0 messages
1 members
Created 3 years ago
Updated 3 years ago
Open in Discord
D
direct_x_34
Script Kiddie!
I tried to implement an example of QR Code Generator in Spring Boot.
I have a problem in Service Test and Controller Test.

In Service Test, I cannot decode the byte values in QRCodeReader().decode(binaryBitmap)
I get this error message shown below when I run any test method
com.google.zxing.NotFoundException

In Controller Test, I get this error message shown below when I run any test method
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

How can I fix it?
Here is the link : https://github.com/Rapter1990/qr-generator-example