|
|
|
@ -16,11 +16,8 @@
|
|
|
|
|
|
|
|
|
|
package com.alibaba.cloud.sentinel;
|
|
|
|
|
|
|
|
|
|
import static com.alibaba.cloud.sentinel.SentinelConstants.BLOCK_PAGE_URL_CONF_KEY;
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
|
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.cloud.sentinel.annotation.SentinelRestTemplate;
|
|
|
|
|
import com.alibaba.cloud.sentinel.custom.SentinelAutoConfiguration;
|
|
|
|
@ -36,11 +33,10 @@ import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager;
|
|
|
|
|
import com.alibaba.csp.sentinel.transport.config.TransportConfig;
|
|
|
|
|
import com.alibaba.csp.sentinel.transport.endpoint.Endpoint;
|
|
|
|
|
import com.alibaba.csp.sentinel.transport.endpoint.Protocol;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import org.junit.Before;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
|
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
|
|
|
@ -57,6 +53,12 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
import org.springframework.web.client.RestClientException;
|
|
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
|
|
|
|
import static com.alibaba.cloud.sentinel.SentinelConstants.BLOCK_PAGE_URL_CONF_KEY;
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
|
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author <a href="mailto:fangjian0423@gmail.com">Jim</a>
|
|
|
|
|
* @author jiashuai.xie
|
|
|
|
|