How to test private/internal extension methods?

770 Views Asked by At

I have an internal extension method:

@VisibleForTesting
internal fun URL.normalizeUrl() {some code not related to this question}

I want to test this method in a JUnit test

val normalizedUrl = someUrl.normalizeUrl()

But the method is invisible for the test class, I get Unresolved reference: normalizeUrl in IntelliJ.

Is this possible to test this method without modifying the access level?

0

There are 0 best solutions below