Skip to content

Commit

Permalink
Use WithPackageResources on shouldUpdateSslWhenReloadingSslBundles
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Feb 28, 2025
1 parent 00da65c commit 7d01c94
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,12 @@ void whenServerIsShuttingDownARequestOnAnIdleConnectionResultsInConnectionReset(
}

@Test
@WithPackageResources({ "1.crt", "1.key", "2.crt", "2.key" })
void shouldUpdateSslWhenReloadingSslBundles() throws Exception {
TomcatServletWebServerFactory factory = getFactory();
addTestTxtFile(factory);
DefaultSslBundleRegistry bundles = new DefaultSslBundleRegistry("test",
createPemSslBundle("classpath:org/springframework/boot/web/embedded/tomcat/1.crt",
"classpath:org/springframework/boot/web/embedded/tomcat/1.key"));
createPemSslBundle("classpath:1.crt", "classpath:1.key"));
factory.setSslBundles(bundles);
factory.setSsl(Ssl.forBundle("test"));
this.webServer = factory.getWebServer();
Expand All @@ -677,8 +677,7 @@ void shouldUpdateSslWhenReloadingSslBundles() throws Exception {
assertThat(getResponse(getLocalUrl("https", "/test.txt"), requestFactory)).isEqualTo("test");
assertThat(verifier.getLastPrincipal()).isEqualTo("CN=1");
requestFactory = createHttpComponentsRequestFactory(socketFactory);
bundles.updateBundle("test", createPemSslBundle("classpath:org/springframework/boot/web/embedded/tomcat/2.crt",
"classpath:org/springframework/boot/web/embedded/tomcat/2.key"));
bundles.updateBundle("test", createPemSslBundle("classpath:2.crt", "classpath:2.key"));
assertThat(getResponse(getLocalUrl("https", "/test.txt"), requestFactory)).isEqualTo("test");
assertThat(verifier.getLastPrincipal()).isEqualTo("CN=2");
}
Expand Down

0 comments on commit 7d01c94

Please sign in to comment.