Skip to content

Commit

Permalink
fix for old scala - not using jdk converters
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-klass committed Mar 11, 2023
1 parent bb05531 commit d0a71af
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.scalacheck.Properties
import pureconfig._
import pureconfig.error.{CannotConvert, ConfigReaderFailures, ConvertFailure, WrongType}

import scala.jdk.CollectionConverters._
import java.util.{HashMap => JMap}

class RefTypeConfigConvertSpec extends Properties("RefTypeConfigConvert") {

Expand All @@ -31,7 +31,13 @@ class RefTypeConfigConvertSpec extends Properties("RefTypeConfigConvert") {
implicit val writer: ConfigWriter[Config] =
posIntWriter
.contramap[Config](_.value)
.mapConfig(cfg => ConfigValueFactory.fromMap(Map("value" -> cfg).asJava))
.mapConfig(cfg =>
ConfigValueFactory.fromMap {
val m = new JMap[String, Any]()
m.put("value", cfg)
m
}
)

property("load success") = secure {
loadConfigWithValue("1") ?=
Expand Down

0 comments on commit d0a71af

Please sign in to comment.