diff --git a/strada/src/main/kotlin/dev/hotwire/strada/Bridge.kt b/strada/src/main/kotlin/dev/hotwire/strada/Bridge.kt index badcbcf..f1e77ba 100644 --- a/strada/src/main/kotlin/dev/hotwire/strada/Bridge.kt +++ b/strada/src/main/kotlin/dev/hotwire/strada/Bridge.kt @@ -125,11 +125,6 @@ class Bridge internal constructor(webView: WebView) { } } - fun userAgentSubstring(componentFactories: List>): String { - val components = componentFactories.joinToString(" ") { it.name } - return "bridge-components: [$components]" - } - @VisibleForTesting internal fun initialize(bridge: Bridge) { instances.add(bridge) diff --git a/strada/src/main/kotlin/dev/hotwire/strada/Strada.kt b/strada/src/main/kotlin/dev/hotwire/strada/Strada.kt index 861c87e..6171b93 100644 --- a/strada/src/main/kotlin/dev/hotwire/strada/Strada.kt +++ b/strada/src/main/kotlin/dev/hotwire/strada/Strada.kt @@ -2,4 +2,9 @@ package dev.hotwire.strada object Strada { val config: StradaConfig = StradaConfig() + + fun userAgentSubstring(componentFactories: List>): String { + val components = componentFactories.joinToString(" ") { it.name } + return "bridge-components: [$components]" + } } diff --git a/strada/src/test/kotlin/dev/hotwire/strada/BridgeTest.kt b/strada/src/test/kotlin/dev/hotwire/strada/BridgeTest.kt index 4acb706..43fc4ef 100644 --- a/strada/src/test/kotlin/dev/hotwire/strada/BridgeTest.kt +++ b/strada/src/test/kotlin/dev/hotwire/strada/BridgeTest.kt @@ -133,15 +133,4 @@ class BridgeTest { fun sanitizeFunctionName() { assertEquals(bridge.sanitizeFunctionName("replyWith()"), "replyWith") } - - @Test - fun userAgentSubstring() { - val factories = listOf( - BridgeComponentFactory("one", TestData::OneBridgeComponent), - BridgeComponentFactory("two", TestData::TwoBridgeComponent) - ) - - val userAgentSubstring = Bridge.userAgentSubstring(factories) - assertEquals(userAgentSubstring, "bridge-components: [one two]") - } } diff --git a/strada/src/test/kotlin/dev/hotwire/strada/UserAgentTest.kt b/strada/src/test/kotlin/dev/hotwire/strada/UserAgentTest.kt new file mode 100644 index 0000000..f188160 --- /dev/null +++ b/strada/src/test/kotlin/dev/hotwire/strada/UserAgentTest.kt @@ -0,0 +1,17 @@ +package dev.hotwire.strada + +import org.junit.Assert.assertEquals +import org.junit.Test + +class UserAgentTest { + @Test + fun userAgentSubstring() { + val factories = listOf( + BridgeComponentFactory("one", TestData::OneBridgeComponent), + BridgeComponentFactory("two", TestData::TwoBridgeComponent) + ) + + val userAgentSubstring = Strada.userAgentSubstring(factories) + assertEquals(userAgentSubstring, "bridge-components: [one two]") + } +}