Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

What is the proper annotation since @SpringApplicationConfiguration and @WebIntegration are deprecated as of Spring Boot Framework 1.4? I'm trying to play around with unit testing.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
439 views
Welcome To Ask or Share your Answers For Others

1 Answer

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 {

Is there also a replacement for TestRestTemplate()?

Yes, here it is:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...