Skip to content

Commit f683364

Browse files
committed
check conditions of build() in OpenSergoClient.Builder
Signed-off-by: Jiangnan Jia <[email protected]>
1 parent bd5f15f commit f683364

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/io/opensergo/OpenSergoClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class OpenSergoClient implements AutoCloseable {
5353
public static class Builder {
5454

5555
private String host;
56-
private int port;
56+
private int port = 10246;
5757
private OpenSergoClientConfig openSergoConfig;
5858

5959
public OpenSergoClient.Builder endpoint(String host, int port) {
@@ -68,6 +68,7 @@ public OpenSergoClient.Builder openSergoConfig(OpenSergoClientConfig openSergoCo
6868
}
6969

7070
public OpenSergoClient build() {
71+
AssertUtils.notEmpty(this.host, "host cannot be empty, maybe need to invoke endpoint(host, port)");
7172
if (this.openSergoConfig == null) {
7273
this.openSergoConfig = new OpenSergoClientConfig();
7374
}

0 commit comments

Comments
 (0)