Merge cad7dd6904
into 9d9b6f11c5
This commit is contained in:
commit
109c26f6af
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.data.cassandra;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -26,13 +25,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Artsiom Yudovin
|
||||
*/
|
||||
class DataCassandraTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
DataCassandraTest dataCassandraTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||
DataCassandraTest.class);
|
||||
return (dataCassandraTest != null) ? dataCassandraTest.properties() : null;
|
||||
}
|
||||
class DataCassandraTestContextBootstrapper extends TestSliceTestContextBootstrapper<DataCassandraTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.data.couchbase;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -26,13 +25,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
class DataCouchbaseTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
DataCouchbaseTest dataCouchbaseTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||
DataCouchbaseTest.class);
|
||||
return (dataCouchbaseTest != null) ? dataCouchbaseTest.properties() : null;
|
||||
}
|
||||
class DataCouchbaseTestContextBootstrapper extends TestSliceTestContextBootstrapper<DataCouchbaseTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.data.elasticsearch;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -26,13 +25,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
class DataElasticsearchTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
DataElasticsearchTest dataElasticsearchTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||
DataElasticsearchTest.class);
|
||||
return (dataElasticsearchTest != null) ? dataElasticsearchTest.properties() : null;
|
||||
}
|
||||
class DataElasticsearchTestContextBootstrapper extends TestSliceTestContextBootstrapper<DataElasticsearchTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.data.jdbc;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,12 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
class DataJdbcTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
DataJdbcTest dataJdbcTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataJdbcTest.class);
|
||||
return (dataJdbcTest != null) ? dataJdbcTest.properties() : null;
|
||||
}
|
||||
class DataJdbcTestContextBootstrapper extends TestSliceTestContextBootstrapper<DataJdbcTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.data.ldap;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,12 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Artsiom Yudovin
|
||||
*/
|
||||
class DataLdapTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
DataLdapTest dataLdapTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataLdapTest.class);
|
||||
return (dataLdapTest != null) ? dataLdapTest.properties() : null;
|
||||
}
|
||||
class DataLdapTestContextBootstrapper extends TestSliceTestContextBootstrapper<DataLdapTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.data.mongo;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,12 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Artsiom Yudovin
|
||||
*/
|
||||
class DataMongoTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
DataMongoTest dataMongoTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataMongoTest.class);
|
||||
return (dataMongoTest != null) ? dataMongoTest.properties() : null;
|
||||
}
|
||||
class DataMongoTestContextBootstrapper extends TestSliceTestContextBootstrapper<DataMongoTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.data.neo4j;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,12 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Artsiom Yudovin
|
||||
*/
|
||||
class DataNeo4jTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
DataNeo4jTest dataNeo4jTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataNeo4jTest.class);
|
||||
return (dataNeo4jTest != null) ? dataNeo4jTest.properties() : null;
|
||||
}
|
||||
class DataNeo4jTestContextBootstrapper extends TestSliceTestContextBootstrapper<DataNeo4jTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.data.r2dbc;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,12 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
class DataR2dbcTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
DataR2dbcTest dataR2dbcTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataR2dbcTest.class);
|
||||
return (dataR2dbcTest != null) ? dataR2dbcTest.properties() : null;
|
||||
}
|
||||
class DataR2dbcTestContextBootstrapper extends TestSliceTestContextBootstrapper<DataR2dbcTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.data.redis;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,12 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Artsiom Yudovin
|
||||
*/
|
||||
class DataRedisTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
DataRedisTest dataRedisTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataRedisTest.class);
|
||||
return (dataRedisTest != null) ? dataRedisTest.properties() : null;
|
||||
}
|
||||
class DataRedisTestContextBootstrapper extends TestSliceTestContextBootstrapper<DataRedisTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.graphql;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,12 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
class GraphQlTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
GraphQlTest graphQlTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, GraphQlTest.class);
|
||||
return (graphQlTest != null) ? graphQlTest.properties() : null;
|
||||
}
|
||||
class GraphQlTestContextBootstrapper extends TestSliceTestContextBootstrapper<GraphQlTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,21 +16,15 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.jdbc;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
* {@link TestContextBootstrapper} for {@link JdbcTest @JdbcTest} support.
|
||||
*
|
||||
* @author Artsiom Yudovin
|
||||
* @author Yanming Zhou
|
||||
*/
|
||||
class JdbcTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
JdbcTest jdbcTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, JdbcTest.class);
|
||||
return (jdbcTest != null) ? jdbcTest.properties() : null;
|
||||
}
|
||||
class JdbcTestContextBootstrapper extends TestSliceTestContextBootstrapper<JdbcTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.jooq;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,12 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Artsiom Yudovin
|
||||
*/
|
||||
class JooqTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
JooqTest jooqTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, JooqTest.class);
|
||||
return (jooqTest != null) ? jooqTest.properties() : null;
|
||||
}
|
||||
class JooqTestContextBootstrapper extends TestSliceTestContextBootstrapper<JooqTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.json;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,12 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Artsiom Yudovin
|
||||
*/
|
||||
class JsonTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
JsonTest jsonTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, JsonTest.class);
|
||||
return (jsonTest != null) ? jsonTest.properties() : null;
|
||||
}
|
||||
class JsonTestContextBootstrapper extends TestSliceTestContextBootstrapper<JsonTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.orm.jpa;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,12 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Artsiom Yudovin
|
||||
*/
|
||||
class DataJpaTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
DataJpaTest dataJpaTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, DataJpaTest.class);
|
||||
return (dataJpaTest != null) ? dataJpaTest.properties() : null;
|
||||
}
|
||||
class DataJpaTestContextBootstrapper extends TestSliceTestContextBootstrapper<DataJpaTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.web.client;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -25,13 +24,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Artsiom Yudovin
|
||||
*/
|
||||
class RestClientTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
RestClientTest restClientTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||
RestClientTest.class);
|
||||
return (restClientTest != null) ? restClientTest.properties() : null;
|
||||
}
|
||||
class RestClientTestContextBootstrapper extends TestSliceTestContextBootstrapper<RestClientTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -17,9 +17,8 @@
|
|||
package org.springframework.boot.test.autoconfigure.web.reactive;
|
||||
|
||||
import org.springframework.boot.test.context.ReactiveWebMergedContextConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.MergedContextConfiguration;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -28,17 +27,11 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
* @author Stephane Nicoll
|
||||
* @author Artsiom Yudovin
|
||||
*/
|
||||
class WebFluxTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
class WebFluxTestContextBootstrapper extends TestSliceTestContextBootstrapper<WebFluxTest> {
|
||||
|
||||
@Override
|
||||
protected MergedContextConfiguration processMergedContextConfiguration(MergedContextConfiguration mergedConfig) {
|
||||
return new ReactiveWebMergedContextConfiguration(super.processMergedContextConfiguration(mergedConfig));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
WebFluxTest webFluxTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, WebFluxTest.class);
|
||||
return (webFluxTest != null) ? webFluxTest.properties() : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,9 +16,8 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.web.servlet;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.MergedContextConfiguration;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
import org.springframework.test.context.web.WebMergedContextConfiguration;
|
||||
|
||||
|
@ -29,7 +28,7 @@ import org.springframework.test.context.web.WebMergedContextConfiguration;
|
|||
* @author Artsiom Yudovin
|
||||
* @author Lorenzo Dee
|
||||
*/
|
||||
class WebMvcTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
class WebMvcTestContextBootstrapper extends TestSliceTestContextBootstrapper<WebMvcTest> {
|
||||
|
||||
@Override
|
||||
protected MergedContextConfiguration processMergedContextConfiguration(MergedContextConfiguration mergedConfig) {
|
||||
|
@ -37,10 +36,4 @@ class WebMvcTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
|||
return new WebMergedContextConfiguration(processedMergedConfiguration, determineResourceBasePath(mergedConfig));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
WebMvcTest webMvcTest = TestContextAnnotationUtils.findMergedAnnotation(testClass, WebMvcTest.class);
|
||||
return (webMvcTest != null) ? webMvcTest.properties() : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,8 +16,7 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.webservices.client;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
|
||||
/**
|
||||
|
@ -26,13 +25,6 @@ import org.springframework.test.context.TestContextBootstrapper;
|
|||
*
|
||||
* @author Dmytro Nosan
|
||||
*/
|
||||
class WebServiceClientTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
WebServiceClientTest webServiceClientTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||
WebServiceClientTest.class);
|
||||
return (webServiceClientTest != null) ? webServiceClientTest.properties() : null;
|
||||
}
|
||||
class WebServiceClientTestContextBootstrapper extends TestSliceTestContextBootstrapper<WebServiceClientTest> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 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.
|
||||
|
@ -16,9 +16,8 @@
|
|||
|
||||
package org.springframework.boot.test.autoconfigure.webservices.server;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
|
||||
import org.springframework.boot.test.context.TestSliceTestContextBootstrapper;
|
||||
import org.springframework.test.context.MergedContextConfiguration;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
import org.springframework.test.context.web.WebMergedContextConfiguration;
|
||||
|
||||
|
@ -28,7 +27,7 @@ import org.springframework.test.context.web.WebMergedContextConfiguration;
|
|||
*
|
||||
* @author Daniil Razorenov
|
||||
*/
|
||||
class WebServiceServerTestContextBootstrapper extends SpringBootTestContextBootstrapper {
|
||||
class WebServiceServerTestContextBootstrapper extends TestSliceTestContextBootstrapper<WebServiceServerTest> {
|
||||
|
||||
@Override
|
||||
protected MergedContextConfiguration processMergedContextConfiguration(MergedContextConfiguration mergedConfig) {
|
||||
|
@ -36,11 +35,4 @@ class WebServiceServerTestContextBootstrapper extends SpringBootTestContextBoots
|
|||
return new WebMergedContextConfiguration(processedMergedConfiguration, determineResourceBasePath(mergedConfig));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
WebServiceServerTest webServiceServerTest = TestContextAnnotationUtils.findMergedAnnotation(testClass,
|
||||
WebServiceServerTest.class);
|
||||
return (webServiceServerTest != null) ? webServiceServerTest.properties() : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright 2012-2025 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.context;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.annotation.MergedAnnotation;
|
||||
import org.springframework.core.annotation.MergedAnnotations;
|
||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
||||
import org.springframework.test.context.TestContextAnnotationUtils;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link TestContextBootstrapper} for test slices support.
|
||||
*
|
||||
* @param <T> the test slice annotation
|
||||
* @author Yanming Zhou
|
||||
* @since 3.5.0
|
||||
*/
|
||||
public class TestSliceTestContextBootstrapper<T extends Annotation> extends SpringBootTestContextBootstrapper {
|
||||
|
||||
private final Class<T> annotationType;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public TestSliceTestContextBootstrapper() {
|
||||
this.annotationType = (Class<T>) ResolvableType.forClass(getClass())
|
||||
.as(TestSliceTestContextBootstrapper.class)
|
||||
.getGeneric(0)
|
||||
.resolve();
|
||||
Assert.notNull(this.annotationType, "'%s' doesn't contain type parameter of '%s'"
|
||||
.formatted(getClass().getName(), TestSliceTestContextBootstrapper.class.getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getProperties(Class<?> testClass) {
|
||||
MergedAnnotation<T> annotation = MergedAnnotations.search(SearchStrategy.TYPE_HIERARCHY)
|
||||
.withEnclosingClasses(TestContextAnnotationUtils::searchEnclosingClass)
|
||||
.from(testClass)
|
||||
.get(this.annotationType);
|
||||
return annotation.isPresent() ? annotation.getStringArray("properties") : null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue