fix: exclude gateway classpath warning auto configuration in TSF header compatible test

MetadataLocalPropertiesTsfHeaderCompatibleTest was the only @SpringBootTest in
spring-cloud-tencent-commons without an inline web-application-type and gateway
auto configuration excludes. Because spring-webmvc and spring-cloud-gateway
(webflux) coexist on the test classpath, Boot deduced a servlet context and
GatewayClassPathWarningAutoConfiguration aborted startup with
MvcFoundOnClasspathException. Align the properties with MetadataLocalPropertiesTest.

Co-authored-by: Cursor <cursoragent@cursor.com>
pull/1820/head
evelynwei 3 days ago
parent 396928d34d
commit 109058945f

@ -19,3 +19,4 @@
- [feat: support config effective value ](https://github.com/Tencent/spring-cloud-tencent/pull/1815)
- [feat: support encoding and decoding TSF headers without TSF Consul](https://github.com/Tencent/spring-cloud-tencent/pull/1816)
- [feat: protect encrypted config values and improve config cache fallback](https://github.com/Tencent/spring-cloud-tencent/pull/1818)
- [fix: exclude gateway classpath warning auto configuration in TSF header compatible test](https://github.com/Tencent/spring-cloud-tencent/pull/1819)

@ -34,7 +34,10 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
classes = MetadataLocalPropertiesTsfHeaderCompatibleTest.TestApplication.class,
properties = {"spring.config.location = classpath:application-test.yml",
"spring.cloud.tencent.metadata.tsf-header-compatible=true"})
"spring.main.web-application-type = servlet",
"spring.cloud.gateway.enabled = false",
"spring.cloud.tencent.metadata.tsf-header-compatible=true",
"spring.autoconfigure.exclude=org.springframework.cloud.gateway.config.GatewayAutoConfiguration,org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration,org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration"})
public class MetadataLocalPropertiesTsfHeaderCompatibleTest {
@Autowired

Loading…
Cancel
Save