I'm trying to execute tests but only the first call to findBy() is successful. Running with Spring Boot v2.6.7, Spring v5.3.19, hibernate jar = 5.6.8.
Application application = Application.builder()
.appName("APP1")
.productName("PRD1")
.build();
applicationDao.save(application);
Application app1 = applicationDao.findByAppNameIgnoreCaseAndProductNameIgnoreCaseContaining("APP1","PRD");
assertEquals("APP1", app1.getAppName());
The second calls fails in JUnit when called subsequently in the same JUnit test method
Application app2= applicationDao.findByAppNameIgnoreCaseAndProductNameIgnoreCaseContaining("APP1","PRD");
assertEquals("APP1", app2.getAppName());
Error:
org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [APP1] did not match expected type [java.lang.Character (n/a)]; nested exception is java.lang.IllegalArgumentException: Parameter value [APP1] did not match expected type [java.lang.Character (n/a)]