Skip to content

Commit

Permalink
Fix the build (#1344)
Browse files Browse the repository at this point in the history
* fix scalaVersions for apache-cxf

* fix compilation on scala 2.11

* rm an intermediate collection
  • Loading branch information
hughsimpson authored Jun 5, 2024
1 parent bdf963e commit b7904d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,6 @@ lazy val `kamon-apache-cxf` = (project in file("instrumentation/kamon-apache-cxf
.enablePlugins(JavaAgent)
.settings(instrumentationSettings)
.settings(
crossScalaVersions := Seq(`scala_2.13_version`, `scala_3_version`),
libraryDependencies ++= Seq(
kanelaAgent % "provided",
"org.apache.cxf" % "cxf-rt-frontend-simple" % "3.3.6" % "provided",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import org.slf4j.LoggerFactory
import java.net.{URI, URISyntaxException}
import java.util.Collections.{emptyMap => jEmptyMap, singletonList => jList}
import java.util.{List => JList, Map => JMap}
import scala.collection.mutable
import scala.jdk.CollectionConverters.{ListHasAsScala, MapHasAsJava, MapHasAsScala}
import scala.collection.JavaConverters._

class ApacheCxfClientHelper

Expand All @@ -25,9 +24,10 @@ object ApacheCxfClientHelper {
val uri: URI = getUri(request)

override def write(header: String, value: String): Unit = {
val headers: mutable.Map[String, String] = getAllHeaders(delegate).to(mutable.Map)
headers.put(header, value)
delegate.put(Message.PROTOCOL_HEADERS, headers.map(m => m._1 -> jList(m._2)).toMap.asJava)
val builder = Map.newBuilder[String, JList[String]]
builder ++= getAllHeaders(delegate).map(m => m._1 -> jList(m._2))
builder += header -> jList(value)
delegate.put(Message.PROTOCOL_HEADERS, builder.result().asJava)
}

override def build(): Message = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.mockserver.model.HttpRequest.request
import org.mockserver.model.HttpResponse.response
import org.slf4j.LoggerFactory

import scala.jdk.CollectionConverters.SeqHasAsJava
import scala.collection.JavaConverters._

class MockServerExpectations(private val host: String, private val port: Int) {

Expand Down

0 comments on commit b7904d9

Please sign in to comment.