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

@@ -42,7 +42,7 @@ import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.client.RestTemplate;
import static org.junit.Assert.assertEquals;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Basic integration tests for {@link SampleTomcatTwoConnectorsApplication}.
@@ -111,13 +111,13 @@ public class SampleTomcatTwoConnectorsApplicationTests {
ResponseEntity<String> entity = template.getForEntity(
"http://localhost:" + this.context.getBean("port") + "/hello",
String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertEquals("hello", entity.getBody());
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("hello");
ResponseEntity<String> httpsEntity = template
.getForEntity("https://localhost:" + this.port + "/hello", String.class);
assertEquals(HttpStatus.OK, httpsEntity.getStatusCode());
assertEquals("hello", httpsEntity.getBody());
assertThat(httpsEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(httpsEntity.getBody()).isEqualTo("hello");
}