From 7153525ee2e1e3c96c742ccbf085a671538512d8 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Sat, 9 Mar 2019 20:00:06 +0000 Subject: [PATCH] Annotation @JsonTest with @ExtendWith(SpringExtension.class) Closes gh-16183 --- .../boot/test/autoconfigure/json/JsonTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java index d66e1a542a..de774902a5 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.junit.jupiter.api.extension.ExtendWith; + import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration; @@ -35,6 +37,7 @@ import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.core.annotation.AliasFor; import org.springframework.core.env.Environment; import org.springframework.test.context.BootstrapWith; +import org.springframework.test.context.junit.jupiter.SpringExtension; /** * Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} @@ -62,6 +65,7 @@ import org.springframework.test.context.BootstrapWith; @Documented @Inherited @BootstrapWith(JsonTestContextBootstrapper.class) +@ExtendWith(SpringExtension.class) @OverrideAutoConfiguration(enabled = false) @TypeExcludeFilters(JsonExcludeFilter.class) @AutoConfigureCache