diff --git a/models/src/main/scala/pact4s/provider/ProviderInfoBuilder.scala b/models/src/main/scala/pact4s/provider/ProviderInfoBuilder.scala index b3fdb6ee1..71c8765a6 100644 --- a/models/src/main/scala/pact4s/provider/ProviderInfoBuilder.scala +++ b/models/src/main/scala/pact4s/provider/ProviderInfoBuilder.scala @@ -26,7 +26,8 @@ import pact4s.provider.PactSource.{FileSource, PactBroker, PactBrokerWithSelecto import pact4s.provider.StateManagement.StateManagementFunction import pact4s.provider.VerificationSettings.AnnotatedMethodVerificationSettings -import java.net.{URI, URL} +import java.net.URI +import java.net.URL import java.time.format.DateTimeFormatter import java.time.{Instant, ZoneOffset} import java.util.function.Consumer @@ -167,7 +168,7 @@ final class ProviderInfoBuilder private ( p.setVerificationType(PactVerification.ANNOTATED_METHOD) p.setPackagesToScan(packagesToScan.asJava) } - stateManagement.foreach(s => p.setStateChangeUrl(new URL(s.url))) + stateManagement.foreach(s => p.setStateChangeUrl(new URI(s.url).toURL)) p.setRequestFilter { // because java new Consumer[HttpRequest] {