Skip to content

Commit

Permalink
Merge pull request #531 from hanneshauer/fix-deprecated-url-construct…
Browse files Browse the repository at this point in the history
…or-java-8

Replace deprecated URL constructor with URI.toURL in java8
  • Loading branch information
gaeljw authored Mar 1, 2024
2 parents 8762b91 + a033079 commit 6a16a06
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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] {
Expand Down

0 comments on commit 6a16a06

Please sign in to comment.