In a nutshell, Spring auto wiring failed on one field of my Java class.
I have a class which has a field set by Spring auto wiring. This field is of boolean type (not Boolean!). However, when unit testing it, I got an error saying,
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type [java.lang.String] to required type [boolean]; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [${enable.pipe}] at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:77)
The code is here,
@Value("${enable.pipe}")
private boolean isPipeEnabled;
This class runs well when loaded in a container, but failed and reports the error when running in a unit test. I've tried but failed to find a way to dump the value wired into.