This commit is contained in:
Phillip Webb
2023-05-12 13:00:38 -07:00
parent 54e294c5c2
commit e9c4a5d663
3 changed files with 12 additions and 20 deletions

View File

@@ -39,8 +39,8 @@ public class MailHealthIndicator extends AbstractHealthIndicator {
@Override
protected void doHealthCheck(Builder builder) throws Exception {
int port = this.mailSender.getPort();
builder.withDetail("location", (port == JavaMailSenderImpl.DEFAULT_PORT) ? this.mailSender.getHost()
: this.mailSender.getHost() + ":" + this.mailSender.getPort());
builder.withDetail("location", (port != JavaMailSenderImpl.DEFAULT_PORT)
? this.mailSender.getHost() + ":" + this.mailSender.getPort() : this.mailSender.getHost());
this.mailSender.testConnection();
builder.up();
}