I want to test small parts of the application that rely on properties loaded with @Autowired and @ConfigurationProperties. I am looking for a solut
@Autowired
@ConfigurationProperties
you can actually just add @EnableConfigurationProperties to your @SpringBootTest directly. eg:
@ActiveProfiles("test") @RunWith(SpringRunner.class) @SpringBootTest(classes = TestConfiguration.class) @EnableConfigurationProperties ...