Hello, I'm a 17-year-old developer living in South Korea. I'm looking at the actuator part of the Spring Boot project, and I found something that I think would be good to improve and I'm giving you a suggestion!
I found a string literal used repeatedly in the DataSourceHealthIndicator and ConnectionFactoryHealthIndicator classes and managed it as a constant.
I also modified the Indicator class and test code.
public static final String DATABASE = "database";
public static final String VALIDATION_QUERY = "validationQuery";
I would really appreciate it if you could check it.
Please understand that my English is not good enough
Comment From: pivotal-cla
@tlsgmltjd Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-cla
@tlsgmltjd Thank you for signing the Contributor License Agreement!
Comment From: wilkinsona
Unfortunately, I don't think this improves the readability of the code. It's also debatable that it improves the maintainability as those values aren't something that we change. FWIW, I'm also not keen on using constants in tests as it increases the chance that a typo will go unnoticed. Thanks anyway for the proposal.
Comment From: tlsgmltjd
Thank you for your confirmation!