private void unionFailResponse(final ServletResponse response) throws IOException {
        HttpServletResponse httpResponse = (HttpServletResponse) response;
        httpResponse.setContentType("application/json;charset=utf-8");
        httpResponse.setCharacterEncoding("utf-8");
        wrapCorsResponse(httpResponse);
        httpResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        ShenyuAdminResult result = ShenyuAdminResult.error(CommonErrorCode.TOKEN_ERROR,
                ShenyuResultMessage.TOKEN_IS_ERROR);
        httpResponse.getWriter().println(GsonUtils.getInstance().toJson(result));
    }
@Test
    public void testUnionFailResponse() {
        PrintWriter printWriter = mock(PrintWriter.class);
        try {
            when(httpServletResponse.getWriter()).thenReturn(printWriter);
            doNothing().when(printWriter).println();
            Method testMethod = statelessAuthFilter.getClass().getDeclaredMethod("unionFailResponse", ServletResponse.class);
            testMethod.setAccessible(true);
            testMethod.invoke(statelessAuthFilter, httpServletResponse);
            verify(httpServletResponse).setContentType("application/json;charset=utf-8");
            verify(httpServletResponse).setCharacterEncoding("utf-8");
            verify(httpServletResponse).setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        } catch (Exception e) {
            throw new ShenyuException(e.getCause());
        }
    }