commit
d6dbf300ab
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.data.cassandra;
|
package org.springframework.boot.test.autoconfigure.data.cassandra;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,10 +30,9 @@ class DataCassandraTestContextBootstrapper extends SpringBootTestContextBootstra
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
DataCassandraTest dataCassandraTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||||
.get(DataCassandraTest.class)
|
DataCassandraTest.class);
|
||||||
.getValue("properties", String[].class)
|
return (dataCassandraTest != null) ? dataCassandraTest.properties() : null;
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.data.couchbase;
|
package org.springframework.boot.test.autoconfigure.data.couchbase;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,10 +30,9 @@ class DataCouchbaseTestContextBootstrapper extends SpringBootTestContextBootstra
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
DataCouchbaseTest dataCouchbaseTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||||
.get(DataCouchbaseTest.class)
|
DataCouchbaseTest.class);
|
||||||
.getValue("properties", String[].class)
|
return (dataCouchbaseTest != null) ? dataCouchbaseTest.properties() : null;
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.data.elasticsearch;
|
package org.springframework.boot.test.autoconfigure.data.elasticsearch;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,10 +30,9 @@ class DataElasticsearchTestContextBootstrapper extends SpringBootTestContextBoot
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
DataElasticsearchTest dataElasticsearchTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||||
.get(DataElasticsearchTest.class)
|
DataElasticsearchTest.class);
|
||||||
.getValue("properties", String[].class)
|
return (dataElasticsearchTest != null) ? dataElasticsearchTest.properties() : null;
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.data.jdbc;
|
package org.springframework.boot.test.autoconfigure.data.jdbc;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,10 +29,8 @@ class DataJdbcTestContextBootstrapper extends SpringBootTestContextBootstrapper
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
DataJdbcTest dataJdbcTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataJdbcTest.class);
|
||||||
.get(DataJdbcTest.class)
|
return (dataJdbcTest != null) ? dataJdbcTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.data.ldap;
|
package org.springframework.boot.test.autoconfigure.data.ldap;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,10 +29,8 @@ class DataLdapTestContextBootstrapper extends SpringBootTestContextBootstrapper
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
DataLdapTest dataLdapTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataLdapTest.class);
|
||||||
.get(DataLdapTest.class)
|
return (dataLdapTest != null) ? dataLdapTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.data.mongo;
|
package org.springframework.boot.test.autoconfigure.data.mongo;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,10 +29,8 @@ class DataMongoTestContextBootstrapper extends SpringBootTestContextBootstrapper
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
DataMongoTest dataMongoTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataMongoTest.class);
|
||||||
.get(DataMongoTest.class)
|
return (dataMongoTest != null) ? dataMongoTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.data.neo4j;
|
package org.springframework.boot.test.autoconfigure.data.neo4j;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,10 +29,8 @@ class DataNeo4jTestContextBootstrapper extends SpringBootTestContextBootstrapper
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
DataNeo4jTest dataNeo4jTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataNeo4jTest.class);
|
||||||
.get(DataNeo4jTest.class)
|
return (dataNeo4jTest != null) ? dataNeo4jTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.data.r2dbc;
|
package org.springframework.boot.test.autoconfigure.data.r2dbc;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,10 +29,8 @@ class DataR2dbcTestContextBootstrapper extends SpringBootTestContextBootstrapper
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
DataR2dbcTest dataR2dbcTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataR2dbcTest.class);
|
||||||
.get(DataR2dbcTest.class)
|
return (dataR2dbcTest != null) ? dataR2dbcTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.data.redis;
|
package org.springframework.boot.test.autoconfigure.data.redis;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,10 +29,8 @@ class DataRedisTestContextBootstrapper extends SpringBootTestContextBootstrapper
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
DataRedisTest dataRedisTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataRedisTest.class);
|
||||||
.get(DataRedisTest.class)
|
return (dataRedisTest != null) ? dataRedisTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.graphql;
|
package org.springframework.boot.test.autoconfigure.graphql;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,10 +29,8 @@ class GraphQlTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, MergedAnnotations.SearchStrategy.INHERITED_ANNOTATIONS)
|
GraphQlTest graphQlTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, GraphQlTest.class);
|
||||||
.get(GraphQlTest.class)
|
return (graphQlTest != null) ? graphQlTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.jdbc;
|
package org.springframework.boot.test.autoconfigure.jdbc;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,10 +29,8 @@ class JdbcTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
JdbcTest jdbcTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, JdbcTest.class);
|
||||||
.get(JdbcTest.class)
|
return (jdbcTest != null) ? jdbcTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.jooq;
|
package org.springframework.boot.test.autoconfigure.jooq;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,10 +29,8 @@ class JooqTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
JooqTest jooqTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, JooqTest.class);
|
||||||
.get(JooqTest.class)
|
return (jooqTest != null) ? jooqTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.json;
|
package org.springframework.boot.test.autoconfigure.json;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,10 +29,8 @@ class JsonTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
JsonTest jsonTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, JsonTest.class);
|
||||||
.get(JsonTest.class)
|
return (jsonTest != null) ? jsonTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.web.client;
|
package org.springframework.boot.test.autoconfigure.web.client;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,10 +29,9 @@ class RestClientTestContextBootstrapper extends SpringBootTestContextBootstrappe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
RestClientTest restClientTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||||
.get(RestClientTest.class)
|
RestClientTest.class);
|
||||||
.getValue("properties", String[].class)
|
return (restClientTest != null) ? restClientTest.properties() : null;
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,8 @@ package org.springframework.boot.test.autoconfigure.web.reactive;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.ReactiveWebMergedContextConfiguration;
|
import org.springframework.boot.test.context.ReactiveWebMergedContextConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.MergedContextConfiguration;
|
import org.springframework.test.context.MergedContextConfiguration;
|
||||||
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -38,10 +37,8 @@ class WebFluxTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
WebFluxTest webFluxTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, WebFluxTest.class);
|
||||||
.get(WebFluxTest.class)
|
return (webFluxTest != null) ? webFluxTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,8 @@
|
||||||
package org.springframework.boot.test.autoconfigure.web.servlet;
|
package org.springframework.boot.test.autoconfigure.web.servlet;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.MergedContextConfiguration;
|
import org.springframework.test.context.MergedContextConfiguration;
|
||||||
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
import org.springframework.test.context.web.WebMergedContextConfiguration;
|
import org.springframework.test.context.web.WebMergedContextConfiguration;
|
||||||
|
|
||||||
|
|
@ -40,10 +39,8 @@ class WebMvcTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
WebMvcTest webMvcTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, WebMvcTest.class);
|
||||||
.get(WebMvcTest.class)
|
return (webMvcTest != null) ? webMvcTest.properties() : null;
|
||||||
.getValue("properties", String[].class)
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
package org.springframework.boot.test.autoconfigure.webservices.client;
|
package org.springframework.boot.test.autoconfigure.webservices.client;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,10 +30,9 @@ class WebServiceClientTestContextBootstrapper extends SpringBootTestContextBoots
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
WebServiceClientTest webServiceClientTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||||
.get(WebServiceClientTest.class)
|
WebServiceClientTest.class);
|
||||||
.getValue("properties", String[].class)
|
return (webServiceClientTest != null) ? webServiceClientTest.properties() : null;
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,8 @@
|
||||||
package org.springframework.boot.test.autoconfigure.webservices.server;
|
package org.springframework.boot.test.autoconfigure.webservices.server;
|
||||||
|
|
||||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
||||||
import org.springframework.test.context.MergedContextConfiguration;
|
import org.springframework.test.context.MergedContextConfiguration;
|
||||||
|
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||||
import org.springframework.test.context.TestContextBootstrapper;
|
import org.springframework.test.context.TestContextBootstrapper;
|
||||||
import org.springframework.test.context.web.WebMergedContextConfiguration;
|
import org.springframework.test.context.web.WebMergedContextConfiguration;
|
||||||
|
|
||||||
|
|
@ -39,10 +38,9 @@ class WebServiceServerTestContextBootstrapper extends SpringBootTestContextBoots
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String[] getProperties(Class<?> testClass) {
|
protected String[] getProperties(Class<?> testClass) {
|
||||||
return MergedAnnotations.from(testClass, SearchStrategy.INHERITED_ANNOTATIONS)
|
WebServiceServerTest webServiceServerTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||||
.get(WebServiceServerTest.class)
|
WebServiceServerTest.class);
|
||||||
.getValue("properties", String[].class)
|
return (webServiceServerTest != null) ? webServiceServerTest.properties() : null;
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -19,11 +19,14 @@ package org.springframework.boot.test.autoconfigure.data.cassandra;
|
||||||
import com.datastax.oss.driver.api.core.CqlSession;
|
import com.datastax.oss.driver.api.core.CqlSession;
|
||||||
import com.datastax.oss.driver.api.core.context.DriverContext;
|
import com.datastax.oss.driver.api.core.context.DriverContext;
|
||||||
import com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry;
|
import com.datastax.oss.driver.api.core.type.codec.registry.CodecRegistry;
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.autoconfigure.data.cassandra.DataCassandraTestPropertiesIntegrationTests.CassandraMockConfiguration;
|
||||||
import org.springframework.boot.test.context.TestConfiguration;
|
import org.springframework.boot.test.context.TestConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
@ -36,6 +39,7 @@ import static org.mockito.Mockito.mock;
|
||||||
*
|
*
|
||||||
* @author Artsiom Yudovin
|
* @author Artsiom Yudovin
|
||||||
*/
|
*/
|
||||||
|
@Import(CassandraMockConfiguration.class)
|
||||||
@DataCassandraTest(properties = "spring.profiles.active=test")
|
@DataCassandraTest(properties = "spring.profiles.active=test")
|
||||||
class DataCassandraTestPropertiesIntegrationTests {
|
class DataCassandraTestPropertiesIntegrationTests {
|
||||||
|
|
||||||
|
|
@ -47,7 +51,22 @@ class DataCassandraTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestConfiguration(proxyBeanMethods = false)
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(DataCassandraTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestConfiguration
|
||||||
static class CassandraMockConfiguration {
|
static class CassandraMockConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2022 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.data.couchbase;
|
package org.springframework.boot.test.autoconfigure.data.couchbase;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,19 @@ class DataCouchbaseTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(DataCouchbaseTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ package org.springframework.boot.test.autoconfigure.data.elasticsearch;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.testcontainers.elasticsearch.ElasticsearchContainer;
|
import org.testcontainers.elasticsearch.ElasticsearchContainer;
|
||||||
import org.testcontainers.junit.jupiter.Container;
|
import org.testcontainers.junit.jupiter.Container;
|
||||||
|
|
@ -59,4 +60,19 @@ class DataElasticsearchTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(DataElasticsearchTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.data.jdbc;
|
package org.springframework.boot.test.autoconfigure.data.jdbc;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,19 @@ class DataJdbcTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(DataJdbcTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.data.ldap;
|
package org.springframework.boot.test.autoconfigure.data.ldap;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,19 @@ class DataLdapTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(DataLdapTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.data.mongo;
|
package org.springframework.boot.test.autoconfigure.data.mongo;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,19 @@ class DataMongoTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(DataMongoTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ package org.springframework.boot.test.autoconfigure.data.neo4j;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.testcontainers.containers.Neo4jContainer;
|
import org.testcontainers.containers.Neo4jContainer;
|
||||||
import org.testcontainers.junit.jupiter.Container;
|
import org.testcontainers.junit.jupiter.Container;
|
||||||
|
|
@ -59,4 +60,19 @@ class DataNeo4jTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(DataNeo4jTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.data.r2dbc;
|
package org.springframework.boot.test.autoconfigure.data.r2dbc;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,19 @@ class DataR2dbcTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(DataR2dbcTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2022 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.data.redis;
|
package org.springframework.boot.test.autoconfigure.data.redis;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.testcontainers.junit.jupiter.Container;
|
import org.testcontainers.junit.jupiter.Container;
|
||||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||||
|
|
@ -55,4 +56,19 @@ class DataRedisTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(DataRedisTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2012-2023 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.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.springframework.boot.test.autoconfigure.graphql;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for the {@link GraphQlTest#properties properties} attribute of
|
||||||
|
* {@link GraphQlTest @GraphQlTest}.
|
||||||
|
*
|
||||||
|
* @author Andy Wilkinson
|
||||||
|
*/
|
||||||
|
@GraphQlTest(properties = "spring.profiles.active=test")
|
||||||
|
class GraphQlTestPropertiesIntegrationTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment environment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void environmentWithNewProfile() {
|
||||||
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(GraphQlTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.jdbc;
|
package org.springframework.boot.test.autoconfigure.jdbc;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,18 @@ class JdbcTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(JdbcTestPropertiesIntegrationTests.this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2022 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.jooq;
|
package org.springframework.boot.test.autoconfigure.jooq;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,18 @@ class JooqTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(JooqTestPropertiesIntegrationTests.this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.json;
|
package org.springframework.boot.test.autoconfigure.json;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,18 @@ class JsonTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(JsonTestPropertiesIntegrationTests.this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.web.client;
|
package org.springframework.boot.test.autoconfigure.web.client;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,19 @@ class RestClientTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(RestClientTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.web.reactive;
|
package org.springframework.boot.test.autoconfigure.web.reactive;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,19 @@ class WebFluxTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(WebFluxTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2019 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.web.servlet;
|
package org.springframework.boot.test.autoconfigure.web.servlet;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,19 @@ class WebMvcTestPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(WebMvcTestPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2020 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.webservices.client;
|
package org.springframework.boot.test.autoconfigure.webservices.client;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,19 @@ class WebServiceClientPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(WebServiceClientPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2023 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.
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.springframework.boot.test.autoconfigure.webservices.server;
|
package org.springframework.boot.test.autoconfigure.webservices.server;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -40,4 +41,19 @@ class WebServiceServerPropertiesIntegrationTests {
|
||||||
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
assertThat(this.environment.getActiveProfiles()).containsExactly("test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
class NestedTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment innerEnvironment;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void propertiesFromEnclosingClassAffectNestedTests() {
|
||||||
|
assertThat(WebServiceServerPropertiesIntegrationTests.this.environment.getActiveProfiles())
|
||||||
|
.containsExactly("test");
|
||||||
|
assertThat(this.innerEnvironment.getActiveProfiles()).containsExactly("test");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue