Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@RunWith(SpringRunner::class)
@SpringBootTest(webEnvironment=WebEnvironment.RANDOM_PORT)
class NoCatsTest {
@Autowired lateinit var restTemplate: TestRestTemplate
@Test
fun indexShouldReturnEmptyListWhenNoCatsExist() {
val response = restTemplate.getForEntity("/", CatsList::class.java)
assertThat(response.statusCode).isEqualTo(HttpStatus.OK)
assertThat(response.body).isNotNull.isEmpty()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.