Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
Signed-off-by: drake_wang <[email protected]>
  • Loading branch information
wxl24life committed Sep 25, 2024
1 parent 4d986dc commit 01918b1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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");
}
}
}

0 comments on commit 01918b1

Please sign in to comment.