Use AssertJ in spring-boot-samples
See gh-5083
This commit is contained in:
@@ -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");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user