解决:Elasticsearch failed to map source
Error message
[INFO] Results: [INFO] [ERROR] Errors: [ERROR] CarDoaTest.testQueryByAggs:57 » Elasticsearch failed to map source [ {"color":... [INFO] [ERROR] Tests run: 11, Failures: 0, Errors: 1, Skipped: 0
Screenshot:
analysis
As you can see, something went wrong in the use of generics
In class Car, there is only parameter construction, and no parameterless construction, but jackson deserialization needs to use parameterless construction, so it will report an error
Solution
Just add a parameterless constructor
effect
testing successfully!