xenoterracide
@SpringBootTest @SpringJUnitConfig @ActiveProfiles("fhir", "schedule") internal class PeriodicDumpJobTest @Autowired constructor( private val dumpSvc: PeriodicService) { @Service open class PeriodicService { open fun findAll( start: LocalDateTime, stop: LocalDateTime ): List<String> { return listOf("a", "b", "c") } } @TestConfiguration open class MockConfig { @Bean @Primary open fun service() = mock<PeriodicService> { on { findAll( any(), any() ) } doReturn listOf() } } @Test fun testDump() { verify( dumpSvc, times( 10)).findAll( any(), any() ) } }
A modern programming language that makes developers happier.