From 0e0366e8bb35fc53627865225e577d6e44dc5650 Mon Sep 17 00:00:00 2001 From: huangsimin Date: Tue, 23 Jul 2019 11:42:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=B0=91=E4=BA=86=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../factory/DubboGatewayFilterFactory.java | 3 --- .../service/usergw/config/ConfigGateway.java | 3 ++- .../service/usergw/TestHttp2DubboConfig.java | 2 -- .../service/usergw/TestHttp2DubboConfig4.java | 15 ++++----------- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/usergw-service/src/main/java/cn/ecpark/service/usergw/biz/filters/factory/DubboGatewayFilterFactory.java b/usergw-service/src/main/java/cn/ecpark/service/usergw/biz/filters/factory/DubboGatewayFilterFactory.java index aa6bccc..34d0631 100644 --- a/usergw-service/src/main/java/cn/ecpark/service/usergw/biz/filters/factory/DubboGatewayFilterFactory.java +++ b/usergw-service/src/main/java/cn/ecpark/service/usergw/biz/filters/factory/DubboGatewayFilterFactory.java @@ -14,7 +14,6 @@ import org.springframework.cloud.gateway.filter.GatewayFilter; import org.springframework.cloud.gateway.filter.GatewayFilterChain; import org.springframework.cloud.gateway.filter.OrderedGatewayFilter; import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory; -import org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory; import org.springframework.context.ApplicationContext; import org.springframework.core.Ordered; import org.springframework.http.HttpHeaders; @@ -25,11 +24,9 @@ import org.springframework.stereotype.Component; import org.springframework.web.server.ServerWebExchange; import cn.ecpark.service.usergw.biz.filters.bean.GenericServicePool; -import lombok.extern.slf4j.Slf4j; import reactor.core.publisher.Mono;; @Component -@Slf4j public class DubboGatewayFilterFactory extends AbstractGatewayFilterFactory { @Autowired diff --git a/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigGateway.java b/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigGateway.java index 3de6efa..cafb945 100644 --- a/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigGateway.java +++ b/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigGateway.java @@ -387,6 +387,7 @@ public class ConfigGateway implements RouteDefinitionLocator { * @param iter dubbo.routes.filters * @param yamlField 根据域的key 获取 filters 字符串列 */ + @SuppressWarnings("unchecked") private void parseAndAddDubboFilters(String dubboUri, List filters, LinkedHashMap> iter, String yamlField) { List filtersYaml = iter.get(yamlField); @@ -404,7 +405,7 @@ public class ConfigGateway implements RouteDefinitionLocator { filters.add(fd); } } else if (filterObject.getClass() == LinkedHashMap.class) { - Map filterMap = (LinkedHashMap)filterObject; + Map filterMap = (LinkedHashMap)filterObject; FilterDefinition fd = new FilterDefinition(); fd.setName((String)filterMap.get("name")); diff --git a/usergw-service/src/test/java/cn/ecpark/service/usergw/TestHttp2DubboConfig.java b/usergw-service/src/test/java/cn/ecpark/service/usergw/TestHttp2DubboConfig.java index 78e352a..75922c6 100644 --- a/usergw-service/src/test/java/cn/ecpark/service/usergw/TestHttp2DubboConfig.java +++ b/usergw-service/src/test/java/cn/ecpark/service/usergw/TestHttp2DubboConfig.java @@ -1,7 +1,5 @@ package cn.ecpark.service.usergw; -import java.util.LinkedHashMap; - import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/usergw-service/src/test/java/cn/ecpark/service/usergw/TestHttp2DubboConfig4.java b/usergw-service/src/test/java/cn/ecpark/service/usergw/TestHttp2DubboConfig4.java index 8828e33..37c79ac 100644 --- a/usergw-service/src/test/java/cn/ecpark/service/usergw/TestHttp2DubboConfig4.java +++ b/usergw-service/src/test/java/cn/ecpark/service/usergw/TestHttp2DubboConfig4.java @@ -1,18 +1,11 @@ package cn.ecpark.service.usergw; -import java.util.Map; - -import com.alibaba.fastjson.JSON; - import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.web.server.LocalServerPort; -import org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory; -import org.springframework.cloud.gateway.filter.factory.SetRequestHeaderGatewayFilterFactory; -import org.springframework.data.redis.core.ReactiveRedisTemplate; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; @@ -55,12 +48,12 @@ public class TestHttp2DubboConfig4 { } - @Test - @SuppressWarnings("unchecked") - public void Test3RestfulFilters() { + // @Test + // @SuppressWarnings("unchecked") + // public void Test3RestfulFilters() { - } + // } } \ No newline at end of file