gpt4 book ai didi

java - 自从 @SpringApplicationConfiguration、@WebIntegration 在 Spring Boot 框架中被弃用以来,正确的注释是什么?

转载 作者:IT老高 更新时间:2023-10-28 20:22:03 26 4
gpt4 key购买 nike

自 Spring Boot Framework 1.4 起已弃用 @SpringApplicationConfiguration@WebIntegration 后,正确的注释是什么?我正在尝试进行单元测试。

最佳答案

查看已弃用类的 JavaDocs:

* @deprecated as of 1.4 in favor of
* {@link org.springframework.boot.test.context.SpringBootTest} with
* {@code webEnvironment=RANDOM_PORT} or {@code webEnvironment=DEFINED_PORT}.
*/
...
@Deprecated
public @interface WebIntegrationTest {

* @deprecated as of 1.4 in favor of {@link SpringBootTest} or direct use of
* {@link SpringBootContextLoader}.
*/
...
@Deprecated
public @interface SpringApplicationConfiguration {

Is there also a replacement for TestRestTemplate()?

是的,这里是:

 * @deprecated as of 1.4 in favor of
* {@link org.springframework.boot.test.web.client.TestRestTemplate}
*/
@Deprecated
public class TestRestTemplate extends RestTemplate {

关于java - 自从 @SpringApplicationConfiguration、@WebIntegration 在 Spring Boot 框架中被弃用以来,正确的注释是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39417530/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com