diff --git a/fe/fe-core/src/test/java/com/starrocks/http/StarManagerHttpServiceActionTest.java b/fe/fe-core/src/test/java/com/starrocks/http/StarManagerHttpServiceActionTest.java index 7b108873f9115..0cd7335af898f 100644 --- a/fe/fe-core/src/test/java/com/starrocks/http/StarManagerHttpServiceActionTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/http/StarManagerHttpServiceActionTest.java @@ -31,6 +31,7 @@ import io.netty.handler.codec.http.HttpResponse; import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.handler.codec.http.HttpVersion; +import mockit.Expectations; import mockit.Mock; import mockit.MockUp; import org.junit.Assert; @@ -99,6 +100,12 @@ public HttpResponse starmgrHttpService(HttpRequest request) { @Mock void writeResponse(BaseRequest request, BaseResponse response, HttpResponseStatus status) {} }; + new Expectations(request) { + { + request.getRequest().uri(); + result = "http://test_uri"; + } + }; starManagerHttpServiceAction.executeWithoutPassword(request, response); } { // Internal error case @@ -114,7 +121,7 @@ public HttpResponse starmgrHttpService(HttpRequest request) { }; DdlException ddlException = Assert.assertThrows(DdlException.class, () -> starManagerHttpServiceAction.executeWithoutPassword(request, response)); - Assert.assertEquals(ddlException.getMessage(), "Internal Error"); + Assert.assertEquals(ddlException.getMessage(), "Failed to access star manager's http service"); } } }