i have service like :
public class ServiceImpl implements Service {
...
private Integer days;
//constructor
public UserServiceImpl(@Value("${test.days}") Integer days,
.....)
}
I pass varable from applicatin.yml and when i run my project it works fine. But when i run my tests i get exception :
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ServiceImpl#0': Unsatisfied dependency expressed through constructor parameter 11; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${test.days}"
seems like it cant see my value from application.yml and trying to wrap string "${test.days}" to Integer...how to avoid this ?