Skip to content

Instantly share code, notes, and snippets.

@AlexeySoshin
Created October 22, 2017 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexeySoshin/7ac6ccdd15bfc19b18edefad5cc0218b to your computer and use it in GitHub Desktop.
Save AlexeySoshin/7ac6ccdd15bfc19b18edefad5cc0218b to your computer and use it in GitHub Desktop.
@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