Skip to content

Commit 7d01c94

Browse files
committed
Use WithPackageResources on shouldUpdateSslWhenReloadingSslBundles
See gh-44397
1 parent 00da65c commit 7d01c94

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -660,12 +660,12 @@ void whenServerIsShuttingDownARequestOnAnIdleConnectionResultsInConnectionReset(
660660
}
661661

662662
@Test
663+
@WithPackageResources({ "1.crt", "1.key", "2.crt", "2.key" })
663664
void shouldUpdateSslWhenReloadingSslBundles() throws Exception {
664665
TomcatServletWebServerFactory factory = getFactory();
665666
addTestTxtFile(factory);
666667
DefaultSslBundleRegistry bundles = new DefaultSslBundleRegistry("test",
667-
createPemSslBundle("classpath:org/springframework/boot/web/embedded/tomcat/1.crt",
668-
"classpath:org/springframework/boot/web/embedded/tomcat/1.key"));
668+
createPemSslBundle("classpath:1.crt", "classpath:1.key"));
669669
factory.setSslBundles(bundles);
670670
factory.setSsl(Ssl.forBundle("test"));
671671
this.webServer = factory.getWebServer();
@@ -677,8 +677,7 @@ void shouldUpdateSslWhenReloadingSslBundles() throws Exception {
677677
assertThat(getResponse(getLocalUrl("https", "/test.txt"), requestFactory)).isEqualTo("test");
678678
assertThat(verifier.getLastPrincipal()).isEqualTo("CN=1");
679679
requestFactory = createHttpComponentsRequestFactory(socketFactory);
680-
bundles.updateBundle("test", createPemSslBundle("classpath:org/springframework/boot/web/embedded/tomcat/2.crt",
681-
"classpath:org/springframework/boot/web/embedded/tomcat/2.key"));
680+
bundles.updateBundle("test", createPemSslBundle("classpath:2.crt", "classpath:2.key"));
682681
assertThat(getResponse(getLocalUrl("https", "/test.txt"), requestFactory)).isEqualTo("test");
683682
assertThat(verifier.getLastPrincipal()).isEqualTo("CN=2");
684683
}

0 commit comments

Comments
 (0)