Use AssertJ in spring-boot-samples
See gh-5083
This commit is contained in:
@@ -30,7 +30,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Basic integration tests for service demo application.
|
||||
@@ -51,10 +51,10 @@ public class SampleActuatorApplicationTests {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = new TestRestTemplate()
|
||||
.getForEntity("http://localhost:" + port, Map.class);
|
||||
assertEquals(HttpStatus.OK, entity.getStatusCode());
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> body = entity.getBody();
|
||||
assertEquals("Hello Daniel", body.get("message"));
|
||||
assertThat(body.get("message")).isEqualTo("Hello Daniel");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user