File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
config/src/test/scala/com/typesafe/config/impl Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -937,6 +937,28 @@ class PublicApiTest extends TestUtils {
937937 assertTrue(" stuff gets cached repeatedly conf" , conf3 eq conf4)
938938 }
939939
940+ @ Test
941+ def invalidateReferenceConfig (): Unit = {
942+ val orig = ConfigFactory .defaultReference()
943+ val cached = ConfigFactory .defaultReference()
944+ assertTrue(" reference config was cached" , orig eq cached)
945+
946+ ConfigFactory .invalidateCaches()
947+ val changed = ConfigFactory .defaultReference()
948+ assertTrue(" reference config was invalidated" , orig ne changed)
949+ }
950+
951+ @ Test
952+ def invalidateFullConfig (): Unit = {
953+ val orig = ConfigFactory .load()
954+ val cached = ConfigFactory .load()
955+ assertTrue(" full config was cached" , orig eq cached)
956+
957+ ConfigFactory .invalidateCaches()
958+ val changed = ConfigFactory .load()
959+ assertTrue(" full config was invalidated" , orig ne changed)
960+ }
961+
940962 @ Test
941963 def canUseSomeValuesWithoutResolving (): Unit = {
942964 val conf = ConfigFactory .parseString(" a=42,b=${NOPE}" )
You can’t perform that action at this time.
0 commit comments