[CORDA-1926] Make CordappInfoResolver.withCordappInfoResolution @VisibleForTesting. (#4011)

Make CordappInfoResolver.withCordappInfoResolution and CordappInfoResolver.clear @VisibleForTesting.
This commit is contained in:
Florian Friemel 2018-10-02 15:48:22 +01:00 committed by GitHub
parent 92d2e4ae38
commit df4936c1fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
package net.corda.core.internal.cordapp
import net.corda.core.internal.VisibleForTesting
import net.corda.core.utilities.loggerFor
import java.util.concurrent.ConcurrentHashMap
@ -49,6 +50,7 @@ object CordappInfoResolver {
* Temporarily switch out the internal resolver for another one. For use in testing.
*/
@Synchronized
@VisibleForTesting
fun withCordappInfoResolution(tempResolver: () -> CordappImpl.Info?, block: () -> Unit) {
val resolver = cordappInfoResolver
cordappInfoResolver = tempResolver
@ -59,6 +61,7 @@ object CordappInfoResolver {
}
}
@VisibleForTesting
internal fun clear() {
cordappClasses.clear()
}