Created
May 26, 2020 06:20
-
-
Save lucapiccinelli/43d69e6c96801c0b8b804a18f2c9d4bd to your computer and use it in GitHub Desktop.
A test that tests the state preservation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = [MainApplication::class]) | |
class HelloTests(@Autowired val restTemplate: TestRestTemplate) { | |
@Test | |
fun `GIVEN springboot in certain state WHEN a restart happens THEN it should preserve the state`(){ | |
restTemplate.getForObject<String>("/hello") shouldBe "Ok 0" | |
restart() | |
restTemplate.getForObject<String>("/hello") shouldBe "Ok 1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment