spring-guides / gs-spring-boot

Building an Application with Spring Boot :: Learn how to build an application with minimal configuration.
https://spring.io/guides/gs/spring-boot/
Apache License 2.0
890 stars 4.51k forks source link

HelloControllerIT assertion is always returning true #89

Closed ccaspanello closed 4 years ago

ccaspanello commented 4 years ago

The test assertion is written incorrectly and always returns true. You can verify this by changing the expected string to a bad value.

assertThat(response.getBody().equals("Greetings from Spring Boot!")); should be changed to assertThat(response.getBody()).isEqualTo("Greetings from Spring Boot!");