Use AssertJ in spring-boot-samples

See gh-5083
This commit is contained in:
Phillip Webb
2016-02-06 14:53:10 -08:00
parent 962a598531
commit 1cc1fc6431
97 changed files with 580 additions and 733 deletions

View File

@@ -30,10 +30,7 @@ import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link SampleSessionRedisApplication}.
@@ -73,12 +70,12 @@ public class SampleSessionRedisApplicationTests {
HttpMethod.GET, uri);
String uuid2 = restTemplate.exchange(request, String.class).getBody();
assertThat(uuid1, is(equalTo(uuid2)));
assertThat(uuid1).isEqualTo(uuid2);
Thread.sleep(5000);
String uuid3 = restTemplate.exchange(request, String.class).getBody();
assertThat(uuid2, is(not(equalTo(uuid3))));
assertThat(uuid2).isNotEqualTo(uuid3);
}
private boolean redisServerRunning(Throwable ex) {