diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockKeyStoreSpi.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockKeyStoreSpi.java similarity index 98% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockKeyStoreSpi.java rename to spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockKeyStoreSpi.java index d6452a644c0..bd190b07c15 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockKeyStoreSpi.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockKeyStoreSpi.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.embedded.test; +package org.springframework.boot.testsupport.ssl; import java.io.InputStream; import java.io.OutputStream; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockPkcs11Security.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockPkcs11Security.java similarity index 95% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockPkcs11Security.java rename to spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockPkcs11Security.java index 9e726af10e2..c94f4ecc05f 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockPkcs11Security.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockPkcs11Security.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.embedded.test; +package org.springframework.boot.testsupport.ssl; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockPkcs11SecurityProvider.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockPkcs11SecurityProvider.java similarity index 95% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockPkcs11SecurityProvider.java rename to spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockPkcs11SecurityProvider.java index 5a827c8fede..4fd41169ba0 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockPkcs11SecurityProvider.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockPkcs11SecurityProvider.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.embedded.test; +package org.springframework.boot.testsupport.ssl; import java.security.Provider; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockPkcs11SecurityProviderExtension.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockPkcs11SecurityProviderExtension.java similarity index 96% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockPkcs11SecurityProviderExtension.java rename to spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockPkcs11SecurityProviderExtension.java index 627e7b50752..904b411384b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/test/MockPkcs11SecurityProviderExtension.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/MockPkcs11SecurityProviderExtension.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.embedded.test; +package org.springframework.boot.testsupport.ssl; import java.security.Security; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/package-info.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/package-info.java new file mode 100644 index 00000000000..7213116f149 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/ssl/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Classes to help when testing SSL-related functionality. + */ +package org.springframework.boot.testsupport.ssl; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ssl/jks/JksSslStoreBundleTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ssl/jks/JksSslStoreBundleTests.java index 8b41232abf1..fe10414642e 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ssl/jks/JksSslStoreBundleTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ssl/jks/JksSslStoreBundleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 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. @@ -25,7 +25,7 @@ import java.util.function.Consumer; import org.junit.jupiter.api.Test; import org.springframework.boot.io.ApplicationResourceLoader; -import org.springframework.boot.web.embedded.test.MockPkcs11Security; +import org.springframework.boot.testsupport.ssl.MockPkcs11Security; import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizerTests.java index 1be7c83447c..aa8ec85690a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizerTests.java @@ -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. @@ -31,8 +31,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.OS; import org.springframework.boot.testsupport.junit.DisabledOnOs; -import org.springframework.boot.web.embedded.test.MockPkcs11Security; -import org.springframework.boot.web.embedded.test.MockPkcs11SecurityProvider; +import org.springframework.boot.testsupport.ssl.MockPkcs11Security; +import org.springframework.boot.testsupport.ssl.MockPkcs11SecurityProvider; import org.springframework.boot.web.server.Http2; import org.springframework.boot.web.server.Ssl; import org.springframework.boot.web.server.WebServerSslBundle; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java index bb509dea51d..09444ef595c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 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. @@ -28,10 +28,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.boot.testsupport.ssl.MockPkcs11Security; +import org.springframework.boot.testsupport.ssl.MockPkcs11SecurityProvider; import org.springframework.boot.testsupport.system.OutputCaptureExtension; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; -import org.springframework.boot.web.embedded.test.MockPkcs11Security; -import org.springframework.boot.web.embedded.test.MockPkcs11SecurityProvider; import org.springframework.boot.web.server.Ssl; import org.springframework.boot.web.server.WebServerSslBundle; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java index 41a58ce4343..5ed64b09109 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 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. @@ -22,8 +22,8 @@ import org.springframework.boot.ssl.SslBundle; import org.springframework.boot.ssl.SslBundleKey; import org.springframework.boot.ssl.SslOptions; import org.springframework.boot.ssl.SslStoreBundle; -import org.springframework.boot.web.embedded.test.MockPkcs11Security; -import org.springframework.boot.web.embedded.test.MockPkcs11SecurityProvider; +import org.springframework.boot.testsupport.ssl.MockPkcs11Security; +import org.springframework.boot.testsupport.ssl.MockPkcs11SecurityProvider; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalStateException;