lundi 17 septembre 2018

How can I add tests to my Kotlin project?

I have an existing Kotlin project in IntelliJ that I am attempting to add a couple of tests to. I edited my Pom.xml file to include the following dependency:

<dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>4.11</version>
   <scope>test</scope>
</dependency>

and when I look at my "External Libraries" folder I do see an entry for JUnit in there. But when I go to my test code:

import org.junit.Assert
import org.junit.Test

class ATATest {
    @Test
    fun testGetMSAForPoint() {
        Assert.assertTrue("test" == "test")
    }
}

Neither of my imports are found so @Test and Assert. are not available when I try to reference them.

How can I import the needed libraries in order to get access to the test functionality that I am trying to hit?

Aucun commentaire:

Enregistrer un commentaire