May 2018
Intermediate to advanced
310 pages
6h 18m
English
In this section, we will continue towards test implementation and will be testing Spring-specific topics. First of all, we will specify the SprintRunner class, which is going to be used as the test runner for our tests:
package com.journaler
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.test.context.junit4.SpringRunner
@RunWith(SpringRunner::class)
class NoteTest {
...
}
By annotating @RunWith(SpringRunner::class), we specified that SpringRunner will be used for test running and will be initializing TestContextManager to provide Spring testing functionality to standard tests. Let's run the test once more. Observe the output ...
Read now
Unlock full access