parent
ddf841572b
commit
3ceac47d97
9
spring-cloud-tencent-plugin-starters/spring-cloud-starter-tencent-tsf-adapter-plugin/src/main/java/com/tencent/cloud/tsf/adapter/config/PolarisFlowConfigModifier.java → spring-cloud-tencent-plugin-starters/spring-cloud-starter-tencent-tsf-adapter-plugin/src/main/java/com/tencent/cloud/tsf/adapter/config/PolarisTsfFlowConfigModifier.java
9
spring-cloud-tencent-plugin-starters/spring-cloud-starter-tencent-tsf-adapter-plugin/src/main/java/com/tencent/cloud/tsf/adapter/config/PolarisFlowConfigModifier.java → spring-cloud-tencent-plugin-starters/spring-cloud-starter-tencent-tsf-adapter-plugin/src/main/java/com/tencent/cloud/tsf/adapter/config/PolarisTsfFlowConfigModifier.java
@ -0,0 +1,26 @@
|
|||||||
|
package com.tencent.cloud.tsf.adapter.config;
|
||||||
|
|
||||||
|
import com.tencent.cloud.polaris.context.config.PolarisContextAutoConfiguration;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||||
|
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
public class PolarisTsfAdapterAutoConfigurationTest {
|
||||||
|
|
||||||
|
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||||
|
.withConfiguration(AutoConfigurations.of(
|
||||||
|
PolarisContextAutoConfiguration.class,
|
||||||
|
PolarisTsfAdapterAutoConfiguration.class
|
||||||
|
));
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDefaultInitialization() {
|
||||||
|
this.contextRunner.run(context -> {
|
||||||
|
assertThat(context).hasSingleBean(PolarisTsfFlowConfigModifier.class);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.tencent.cloud.tsf.adapter.config;
|
||||||
|
|
||||||
|
import com.tencent.polaris.assembly.flow.AssemblyFlow;
|
||||||
|
import com.tencent.polaris.client.api.SDKContext;
|
||||||
|
|
||||||
|
public class TsfAssemblyFlow implements AssemblyFlow {
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return PolarisTsfFlowConfigModifier.TSF_FLOW_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSDKContext(SDKContext sdkContext) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.tencent.cloud.tsf.adapter.config;
|
||||||
|
|
||||||
|
import com.tencent.polaris.api.flow.DiscoveryFlow;
|
||||||
|
import com.tencent.polaris.client.api.SDKContext;
|
||||||
|
|
||||||
|
public class TsfDiscoveryFlow implements DiscoveryFlow {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return PolarisTsfFlowConfigModifier.TSF_FLOW_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSDKContext(SDKContext sdkContext) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.tencent.cloud.tsf.adapter.config;
|
||||||
|
|
||||||
|
import com.tencent.polaris.client.api.SDKContext;
|
||||||
|
import com.tencent.polaris.router.api.flow.RouterFlow;
|
||||||
|
|
||||||
|
public class TsfRouterFlow implements RouterFlow {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return PolarisTsfFlowConfigModifier.TSF_FLOW_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSDKContext(SDKContext sdkContext) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
com.tencent.cloud.tsf.adapter.config.TsfDiscoveryFlow
|
@ -0,0 +1 @@
|
|||||||
|
com.tencent.cloud.tsf.adapter.config.TsfAssemblyFlow
|
@ -0,0 +1 @@
|
|||||||
|
com.tencent.cloud.tsf.adapter.config.TsfRouterFlow
|
Loading…
Reference in new issue