To do this, open the Spring application's test class and use an @ContextConfiguration annotation to specify the configuration classes to be used by the test class. Open PlaceReviewerApplicationTests.kt (located in the com.example.placereviewer package of your project's src/test/kotlin directory). Now, set its configuration class as follows:
package com.example.placereviewer
import com.example.placereviewer.config.TestConfig
import org.junit.runner.RunWith
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.junit4.SpringRunner
@RunWith(SpringRunner::class)
@SpringBootTest
@ContextConfiguration(classes = [TestConfig::class])
class PlaceReviewerApplicationTests
Great work! You are now ready to write some application tests.