1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00
This commit is contained in:
fangjian0423
2018-12-05 12:45:02 +08:00
parent 0c8bd1b58a
commit 53643b94ce
5 changed files with 44 additions and 38 deletions

View File

@@ -22,7 +22,7 @@ import org.junit.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.cloud.alibaba.sentinel.annotation.SentinelProtect;
import org.springframework.cloud.alibaba.sentinel.annotation.SentinelRestTemplate;
import org.springframework.cloud.alibaba.sentinel.custom.SentinelAutoConfiguration;
import org.springframework.cloud.alibaba.sentinel.custom.SentinelBeanPostProcessor;
import org.springframework.cloud.alibaba.sentinel.custom.SentinelProtectInterceptor;
@@ -92,13 +92,13 @@ public class SentinelAutoConfigurationTests {
static class SentinelTestConfiguration {
@Bean
@SentinelProtect
@SentinelRestTemplate
RestTemplate restTemplate() {
return new RestTemplate();
}
@Bean
@SentinelProtect(blockHandlerClass = ExceptionUtil.class, blockHandler = "handleException")
@SentinelRestTemplate(blockHandlerClass = ExceptionUtil.class, blockHandler = "handleException")
RestTemplate restTemplateWithBlockClass() {
return new RestTemplate();
}