From f68336408f5b5141c2062031ddf3e04ca865e6fa Mon Sep 17 00:00:00 2001 From: Jiangnan Jia Date: Tue, 14 Feb 2023 17:33:06 +0800 Subject: [PATCH] check conditions of build() in OpenSergoClient.Builder Signed-off-by: Jiangnan Jia --- src/main/java/io/opensergo/OpenSergoClient.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/opensergo/OpenSergoClient.java b/src/main/java/io/opensergo/OpenSergoClient.java index 1bf3b29..2197097 100644 --- a/src/main/java/io/opensergo/OpenSergoClient.java +++ b/src/main/java/io/opensergo/OpenSergoClient.java @@ -53,7 +53,7 @@ public class OpenSergoClient implements AutoCloseable { public static class Builder { private String host; - private int port; + private int port = 10246; private OpenSergoClientConfig openSergoConfig; public OpenSergoClient.Builder endpoint(String host, int port) { @@ -68,6 +68,7 @@ public OpenSergoClient.Builder openSergoConfig(OpenSergoClientConfig openSergoCo } public OpenSergoClient build() { + AssertUtils.notEmpty(this.host, "host cannot be empty, maybe need to invoke endpoint(host, port)"); if (this.openSergoConfig == null) { this.openSergoConfig = new OpenSergoClientConfig(); }