This started happening recently, but I'm not sure what changed to cause it.
The config class looks like (Kotlin):
@Component
@ConfigurationProperties(prefix = "api")
public open class ApiConfigImpl : ApiConfig
{
A test looks like:
@RunWith(SpringJUnit4ClassRunner::class)
@ContextConfiguration(classes = arrayOf(ApplicationAssembly::class), loader = SpringApplicationContextLoader::class)
@WebIntegrationTest
open class CandidateProfileControllerTest
{
@Inject lateinit var profileRepo: CandidateProfileRepository
//etc a few more deps used to setup test data
@Test
open fun getById()
{
val greg = CandidateProfile("123", "12312", "Greg", "Jones", dateOfBirth = Date(), gender = Gender.MALE,
biography = "ABC", maxMatchableAge = null, maxMatchableDistance = null)
profileRepo.save(greg)
val auth = given().header("content-type", "application/json")
.body(testCredentials)
.post("/authorization/social").peek().asString()
val accessToken: String = from(auth).get("accessToken")
given().header("Access-Token", accessToken).
header("API-Key", testAPIKey()).
get("/profile/${greg.id}").
peek().then().
body("stageName", notNullValue())
}
I'm not sure what information I can add. Based on the limited information provided:
Right-click a test on the Test Runner tab of the Run tool window and select Run 'test name'.
Check in Project settings -> Modules that you test package is marked as Tests. Right click on the test class name either in the code window or in the project panel, and select Run <classname>. If you don't see the run menu in the popup then you haven't selected a test or you don't have junit plugin installed.
Open the class where the tests are located and check the part where inteliJ shows the the number of lines, at the beginning of each test method there is a green icon (looks like a play button) just hit that icon and the specific test method will be executed.
This is a bug, logged in the IntelliJ/Kotlin tracker, with a pending fix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With