且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是正确的注释,因为在Spring Boot Framework中不推荐使用@SpringApplicationConfiguration,@ WebIntegration?

更新时间:2023-09-12 20:52:28

查看已弃用类的JavaDocs:

Take a look into JavaDocs of deprecated classes:

* @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 {




是否还有TestRestTemplate()的替代品?

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 {