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

Fixes #89 - Fixed assertThat line which was always returning true #90

Closed ccaspanello closed 4 years ago

pivotal-issuemaster commented 4 years ago

@ccaspanello Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

dsyer commented 4 years ago

I don’t think it’s actually broken. I agree that using the assertion api is better style , so I don’t mind merging if you can sign the CLA.

ccaspanello commented 4 years ago

Check out https://github.com/spring-guides/gs-spring-boot/issues/89 It is actually broken in the sense that the assertion is not actually happening. If you change the original implementation to a bad string it will essentially read assertThat(false).

I found this out by mistake because I renamed my path location and realized when I went to the URL it was giving me a bad request error . . . but my unit tests were still "passing"

Optionally you could change assertThat to assertTrue and the test would work as intended; though the assertion API would give you better error messages when/if it fails.

pivotal-issuemaster commented 4 years ago

@ccaspanello Thank you for signing the Contributor License Agreement!