0

The error is thrown while trying to unit test the Service class that contains an autowired Dao object which internally uses an Autowired JdbcTemplate in Spring boot Rest service using Junit and Mockito

Arun
  • 1

1 Answers1

0

in you `SpringBootTest you should pass config classes or properties files where all configs are.

Probably dataSource is missing

@SpringBootTest(classes = YouAppRunnerOrConfig.class, properties = "...")

ValerioMC
  • 2,926
  • 13
  • 24
  • Hi, I have added my service and dao classes as mentioned. Also I have added the properties from the application.config file in the annotation properties. I'm still getting the same error – Arun Oct 04 '18 at 09:18
  • try to add you class annotated with `@SpringBootApplication` – ValerioMC Oct 04 '18 at 09:22