@@ -18,7 +18,11 @@ import scala.jdk.CollectionConverters.SetHasAsJava
1818
1919class VuuHttp2ServerTest extends AnyFeatureSpec with AwaitilitySupport with Matchers with StrictLogging {
2020
21- val portCounter = new AtomicInteger (31820 )
21+ private val certPath : String = getClass.getClassLoader.getResource(" certs/cert.pem" ).getPath
22+ private val keyPath : String = getClass.getClassLoader.getResource(" certs/key.pem" ).getPath
23+ private val pkcsPath : String = getClass.getClassLoader.getResource(" certs/certificate.p12" ).getPath
24+ private val portCounter = new AtomicInteger (31820 )
25+ private val pkcsPassword = " changeit"
2226
2327 Feature (" Check we can start the HTTP2 Server with various configurations" ) {
2428
@@ -43,9 +47,7 @@ class VuuHttp2ServerTest extends AnyFeatureSpec with AwaitilitySupport with Matc
4347 val port = portCounter.getAndIncrement()
4448
4549 val config = VuuHttp2ServerOptions ()
46- .withSsl(VuuSSLByCertAndKey (
47- certPath = " example/main/src/main/resources/certs/cert.pem" ,
48- keyPath = " example/main/src/main/resources/certs/key.pem" ))
50+ .withSsl(VuuSSLByCertAndKey (certPath, keyPath))
4951 .withPort(port)
5052
5153 val webServer = createAndStartWebServer(config)
@@ -61,9 +63,7 @@ class VuuHttp2ServerTest extends AnyFeatureSpec with AwaitilitySupport with Matc
6163 val port = portCounter.getAndIncrement()
6264
6365 val config = VuuHttp2ServerOptions ()
64- .withSsl(VuuSSLByPKCS (
65- pkcsPath = " example/main/src/main/resources/certs/certificate.p12" ,
66- pkcsPassword = " changeit" ))
66+ .withSsl(VuuSSLByPKCS (pkcsPath, pkcsPassword))
6767 .withPort(port)
6868
6969 val webServer = createAndStartWebServer(config)
@@ -80,8 +80,8 @@ class VuuHttp2ServerTest extends AnyFeatureSpec with AwaitilitySupport with Matc
8080
8181 val config = VuuHttp2ServerOptions ()
8282 .withSsl(VuuSSLByPKCS (
83- pkcsPath = " example/main/src/main/resources/certs/certificate.p12 " ,
84- pkcsPassword = " changeit " ,
83+ pkcsPath,
84+ pkcsPassword,
8585 cipherSuite = VuuSSLCipherSuiteOptions ()
8686 .withCiphers(List (" TLS_AES_256_GCM_SHA384" ))
8787 .withProtocols(List (" TLSv1.3" ))))
@@ -99,10 +99,11 @@ class VuuHttp2ServerTest extends AnyFeatureSpec with AwaitilitySupport with Matc
9999
100100 val port = portCounter.getAndIncrement()
101101
102+
102103 val config = VuuHttp2ServerOptions ()
103104 .withSsl(VuuSSLByPKCS (
104- pkcsPath = " example/main/src/main/resources/certs/certificate.p12 " ,
105- pkcsPassword = " changeit " ,
105+ pkcsPath,
106+ pkcsPassword,
106107 cipherSuite = VuuSSLCipherSuiteOptions ()
107108 .withCiphers(List (" TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" ))
108109 .withProtocols(List (" TLSv1.2" ))))
0 commit comments