Skip to content

Commit

Permalink
Merge pull request #1130 from provenceee/fix-ut
Browse files Browse the repository at this point in the history
【fix】修复优雅上下线ut
  • Loading branch information
robotLJW authored Mar 20, 2023
2 parents 1dc84c7 + e88aac3 commit b3f86dd
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import org.junit.Test;
import org.mockito.Mockito;

import java.util.Collections;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

Expand All @@ -47,7 +49,8 @@ public void testZuul() throws NoSuchMethodException {
final RequestContext requestContext = new RequestContext();
RequestContext.testSetCurrentContext(requestContext);
final HttpServletResponse response = Mockito.mock(HttpServletResponse.class);
Mockito.when(response.getHeader(GraceConstants.MARK_SHUTDOWN_SERVICE_ENDPOINT)).thenReturn(SHUTDOWN_ENDPOINT);
Mockito.when(response.getHeaders(GraceConstants.MARK_SHUTDOWN_SERVICE_ENDPOINT))
.thenReturn(Collections.singletonList(SHUTDOWN_ENDPOINT));
Mockito.when(response.getHeader(GraceConstants.MARK_SHUTDOWN_SERVICE_NAME)).thenReturn("test");
final HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
final Object[] arguments = {request, response};
Expand Down

0 comments on commit b3f86dd

Please sign in to comment.