326925 (5) [Avatar] Offline
#1
build.gradle
[ 682 bytes ]
package ch06.ex1_8_1_LateinitializedProperties

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

class MyService {
fun performAction(): String = "foo"
}

class MyTest {
private var myService: MyService? = null

@Before fun setUp() {
myService = MyService()
}

@Test fun testAction() {
Assert.assertEquals("foo",
myService!!.performAction())
}
}
The compiler says it can't find junit. I have tried adding the jar files(junit and hamcrest core but this has not helped.
It is the same gradle script which I will attach.
Dmitry Jemerov (39) [Avatar] Offline
#2
How exactly are you compiling the project?
326925 (5) [Avatar] Offline
#3
I am compiling using Intellij. The compiler says it does not recognise junit.
Thanks
Norman
326925 (5) [Avatar] Offline
#4
I have resolved this issue. You had to get the junit jar files from mavan.