feat:enable stat reporting as default. (#862)
parent
3392076668
commit
02fa19e857
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the BSD 3-Clause License (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://opensource.org/licenses/BSD-3-Clause
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software distributed
|
||||||
|
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||||
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.tencent.cloud.rpc.enhancement.stat.config;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test for {@link PolarisStatProperties}.
|
||||||
|
*
|
||||||
|
* @author Haotian Zhang
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(classes = PolarisStatPropertiesDisableTest.TestApplication.class)
|
||||||
|
@ActiveProfiles("disable")
|
||||||
|
public class PolarisStatPropertiesDisableTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PolarisStatProperties polarisStatProperties;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDefaultInitialization() {
|
||||||
|
assertThat(polarisStatProperties).isNotNull();
|
||||||
|
assertThat(polarisStatProperties.isEnabled()).isFalse();
|
||||||
|
assertThat(polarisStatProperties.getHost()).isBlank();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
protected static class TestApplication {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
spring.cloud.polaris.stat.enabled=false
|
||||||
|
spring.cloud.polaris.stat.port=20000
|
||||||
|
spring.cloud.polaris.stat.path=/xxx
|
||||||
|
spring.cloud.tencent.rpc-enhancement.reporter.ignore-internal-server-error=false
|
||||||
|
spring.cloud.tencent.rpc-enhancement.reporter.series[0]=CLIENT_ERROR
|
||||||
|
spring.cloud.tencent.rpc-enhancement.reporter.series[1]=SERVER_ERROR
|
||||||
|
spring.cloud.tencent.rpc-enhancement.reporter.statuses[0]=MULTIPLE_CHOICES
|
||||||
|
spring.cloud.tencent.rpc-enhancement.reporter.statuses[1]=MOVED_PERMANENTLY
|
Loading…
Reference in new issue