Arun
Arun

Reputation: 1

How to resove java.lang.IllegalArgumentException: Property 'dataSource' in Junit for Springboot Rest

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

Upvotes: 0

Views: 385

Answers (1)

ValerioMC
ValerioMC

Reputation: 3176

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

Probably dataSource is missing

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

Upvotes: 0

Related Questions