Annotation @JsonTest with @ExtendWith(SpringExtension.class)

Closes gh-16183
This commit is contained in:
Andy Wilkinson 2019-03-09 20:00:06 +00:00
parent eeaf057f47
commit 7153525ee2

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration; 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.annotation.AliasFor;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.test.context.BootstrapWith; 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)} * Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
@ -62,6 +65,7 @@ import org.springframework.test.context.BootstrapWith;
@Documented @Documented
@Inherited @Inherited
@BootstrapWith(JsonTestContextBootstrapper.class) @BootstrapWith(JsonTestContextBootstrapper.class)
@ExtendWith(SpringExtension.class)
@OverrideAutoConfiguration(enabled = false) @OverrideAutoConfiguration(enabled = false)
@TypeExcludeFilters(JsonExcludeFilter.class) @TypeExcludeFilters(JsonExcludeFilter.class)
@AutoConfigureCache @AutoConfigureCache