feature:support spring cloud configData

pull/451/head
wulingxiao 3 years ago
parent c682cb2e53
commit 0bb65fcc9e

@ -47,13 +47,10 @@ public class PolarisConfigFileLocator implements PropertySourceLocator {
private final PolarisConfigFilePuller polarisConfigFilePuller; private final PolarisConfigFilePuller polarisConfigFilePuller;
private final Environment environment;
public PolarisConfigFileLocator(PolarisConfigProperties polarisConfigProperties, public PolarisConfigFileLocator(PolarisConfigProperties polarisConfigProperties,
PolarisContextProperties polarisContextProperties, ConfigFileService configFileService, PolarisContextProperties polarisContextProperties, ConfigFileService configFileService,
PolarisPropertySourceManager polarisPropertySourceManager, Environment environment) { PolarisPropertySourceManager polarisPropertySourceManager, Environment environment) {
this.polarisConfigProperties = polarisConfigProperties; this.polarisConfigProperties = polarisConfigProperties;
this.environment = environment;
this.polarisConfigFilePuller = PolarisConfigFilePuller.get(polarisContextProperties, configFileService, this.polarisConfigFilePuller = PolarisConfigFilePuller.get(polarisContextProperties, configFileService,
polarisPropertySourceManager); polarisPropertySourceManager);
} }

@ -1,3 +1,21 @@
/*
* 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.polaris.config.configdata; package com.tencent.cloud.polaris.config.configdata;
import java.util.ArrayList; import java.util.ArrayList;
@ -40,7 +58,6 @@ import static org.mockito.Mockito.when;
* Test for {@link PolarisConfigDataLoader}. * Test for {@link PolarisConfigDataLoader}.
* *
* @author wlx * @author wlx
* @date 2022/7/16 4:09
*/ */
@RunWith(MockitoJUnitRunner.class) @RunWith(MockitoJUnitRunner.class)
public class PolarisConfigDataLoaderTest { public class PolarisConfigDataLoaderTest {

@ -1,3 +1,21 @@
/*
* 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.polaris.config.configdata; package com.tencent.cloud.polaris.config.configdata;
import org.junit.Test; import org.junit.Test;
@ -18,7 +36,6 @@ import static org.mockito.Mockito.when;
* Test for {@link PolarisConfigDataLocationResolver}. * Test for {@link PolarisConfigDataLocationResolver}.
* *
* @author wlx * @author wlx
* @date 2022/7/16 4:10
*/ */
@RunWith(MockitoJUnitRunner.class) @RunWith(MockitoJUnitRunner.class)
public class PolarisConfigDataLocationResolverTest { public class PolarisConfigDataLocationResolverTest {

@ -1,3 +1,21 @@
/*
* 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.polaris.config.configdata; package com.tencent.cloud.polaris.config.configdata;
import org.junit.Test; import org.junit.Test;
@ -13,7 +31,6 @@ import static org.mockito.Mockito.mock;
* Test for {@link PolarisConfigDataMissingEnvironmentPostProcessor}. * Test for {@link PolarisConfigDataMissingEnvironmentPostProcessor}.
* *
* @author wlx * @author wlx
* @date 2022/7/16 4:09
*/ */
public class PolarisConfigDataMissingEnvironmentPostProcessorTest { public class PolarisConfigDataMissingEnvironmentPostProcessorTest {

@ -1,3 +1,21 @@
/*
* 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.polaris.config.configdata; package com.tencent.cloud.polaris.config.configdata;
import com.tencent.polaris.api.utils.StringUtils; import com.tencent.polaris.api.utils.StringUtils;
@ -16,7 +34,6 @@ import static org.mockito.Mockito.mock;
* Test for {@link PolarisImportExceptionFailureAnalyzer}. * Test for {@link PolarisImportExceptionFailureAnalyzer}.
* *
* @author wlx * @author wlx
* @date 2022/7/16 4:11
*/ */
public class PolarisImportExceptionFailureAnalyzerTest { public class PolarisImportExceptionFailureAnalyzerTest {

@ -30,7 +30,7 @@ import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Test for {@link PolarisLoadBalancerAutoConfiguration} * Test for {@link PolarisLoadBalancerAutoConfiguration}.
* *
* @author Haotian Zhang * @author Haotian Zhang
*/ */

Loading…
Cancel
Save