public static String getSourceIpForHttpRequest(HttpServletRequest httpServletRequest) {
        String sourceIp = getSourceIp();
        // If can't get from request context, get from http request.
        if (StringUtils.isBlank(sourceIp)) {
            sourceIp = WebUtils.getRemoteIp(httpServletRequest);
        }
        return sourceIp;
    }
@Test
    void getSourceIpForHttpRequest() {
        when(request.getRemoteAddr()).thenReturn("3.3.3.3");
        assertEquals("2.2.2.2", NamingRequestUtil.getSourceIpForHttpRequest(request));
        RequestContextHolder.getContext().getBasicContext().getAddressContext().setSourceIp(null);
        assertEquals("1.1.1.1", NamingRequestUtil.getSourceIpForHttpRequest(request));
        RequestContextHolder.getContext().getBasicContext().getAddressContext().setRemoteIp(null);
        assertEquals("3.3.3.3", NamingRequestUtil.getSourceIpForHttpRequest(request));
    }