2020import org .junit .jupiter .api .BeforeEach ;
2121import org .junit .jupiter .api .DisplayName ;
2222import org .junit .jupiter .api .Test ;
23+ import org .junit .jupiter .api .extension .RegisterExtension ;
2324import org .junit .jupiter .params .ParameterizedTest ;
2425import org .junit .jupiter .params .provider .CsvSource ;
2526import org .junit .jupiter .params .provider .EnumSource ;
4445import com ._4point .aem .fluentforms .spring .AemProxyAfSubmission .AfSubmitLocalProcessor .InternalAfSubmitAemProxyProcessor ;
4546import com ._4point .aem .fluentforms .spring .AemProxyAfSubmissionTest .AemProxyAfSubmissionTestWithLocalAfSubmitProcessorTest .MockAemProxy ;
4647import com .github .tomakehurst .wiremock .client .WireMock ;
47- import com .github .tomakehurst .wiremock .junit5 .WireMockTest ;
48+ import com .github .tomakehurst .wiremock .core .WireMockConfiguration ;
49+ import com .github .tomakehurst .wiremock .junit5 .WireMockExtension ;
4850
4951import jakarta .ws .rs .client .ClientBuilder ;
5052import jakarta .ws .rs .client .Entity ;
@@ -99,10 +101,6 @@ public static JakartaRestClient setUpRestClient(int port) {
99101 return getPdfForm ;
100102 }
101103
102- private static String getBaseUriString (int port ) {
103- return getBaseUri (port ).toString ();
104- }
105-
106104 private static URI getBaseUri (int port ) {
107105 return URI .create ("http://localhost:" + port );
108106 }
@@ -121,10 +119,9 @@ public static class JerseyConfig extends ResourceConfig {
121119 }
122120
123121 /**
124- * Tests the AemAfSubmitProcessor
122+ * Tests the AemAfSubmitProcessor. It utilizes an SSL connection to test the SslBundle code.
125123 *
126124 */
127- @ WireMockTest (httpPort = 8502 )
128125 @ SpringBootTest (webEnvironment = WebEnvironment .RANDOM_PORT ,
129126 classes = {TestApplication .class , JerseyConfig .class , AfSubmitAemProxyProcessor .class },
130127 properties = {
@@ -133,10 +130,26 @@ public static class JerseyConfig extends ResourceConfig {
133130 "fluentforms.aem.port=" + "8502" ,
134131 "fluentforms.aem.user=admin" ,
135132 "fluentforms.aem.password=admin" ,
133+ "fluentforms.aem.useSsl=true" ,
134+ "spring.ssl.bundle.jks.aem.truststore.location=file:src/test/resources/aemforms.p12" ,
135+ "spring.ssl.bundle.jks.aem.truststore.password=Pa$$123" ,
136+ "spring.ssl.bundle.jks.aem.truststore.type=PKCS12"
136137 }
137138 )
138139 public static class AemProxyAfSubmissionTestWithAemAfSubmitProcessorTest {
139140
141+ @ RegisterExtension
142+ static WireMockExtension wm1 = WireMockExtension .newInstance ()
143+ .options (WireMockConfiguration .wireMockConfig ().httpsPort (8502 )
144+ .httpDisabled (true )
145+ .keystorePath ("src/test/resources/aemforms.p12" )
146+ .keyManagerPassword ("Pa$$123" )
147+ .keystorePassword ("Pa$$123" )
148+ .keystoreType ("PKCS12" )
149+ )
150+ .configureStaticDsl (true ) // Use with Static DSL
151+ .build ();
152+
140153 @ LocalServerPort
141154 private int port ;
142155
0 commit comments