@Test
    public void testOriginRegex() {
        ServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest
                .get("http://localhost:8080")
                .header("Origin", "http://abc.com")
                .build());
        ServerHttpResponse exchangeResponse = exchange.getResponse();
        exchangeResponse.getHeaders().add(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "0");
        exchangeResponse.getHeaders().add(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "*");
        WebFilterChain chainNoHeader = mock(WebFilterChain.class);
        when(chainNoHeader.filter(exchange)).thenReturn(Mono.empty());
        CrossFilterConfig crossFilterConfig = new CrossFilterConfig();
        final String regex = "^http(|s)://(.*\\.|)abc.com$";
        crossFilterConfig.getAllowedOrigin().setOriginRegex(regex);
        CrossFilter filterNoHeader = new CrossFilter(crossFilterConfig);
        StepVerifier.create(filterNoHeader.filter(exchange, chainNoHeader))
                .expectSubscription()
                .verifyComplete();
        Assertions.assertTrue(Pattern.matches(regex, "http://console.ada.abc.com"));
        Assertions.assertTrue(Pattern.matches(regex, "http://console.abc.com"));
        Assertions.assertTrue(Pattern.matches(regex, "http://abc.com"));
        Assertions.assertFalse(Pattern.matches(regex, "http://aabc.com"));
    }
test method for {@link CrossFilter#filter(ServerWebExchange, WebFilterChain)}.
shenyu-web/src/test/java/org/apache/shenyu/web/filter/CrossFilterTest.java