From b33be7ba063f97d65e521bf52ae5049b6ecdc7e9 Mon Sep 17 00:00:00 2001 From: Mikael Gueck Date: Fri, 11 Dec 2020 00:11:35 +0200 Subject: [PATCH] Muchos upgrades. --- pom.yml | 8 ++++---- src/test/kotlin/io/mikael/ksoup/test/util.kt | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.yml b/pom.yml index 704ed95..b8ab00c 100644 --- a/pom.yml +++ b/pom.yml @@ -8,13 +8,13 @@ packaging: jar parent: {groupId: org.sonatype.oss, artifactId: oss-parent, version: 9} -properties: {java.version: '11', kotlin.version: '1.3.21', jsoup.version: '1.11.3'} +properties: {java.version: '15', kotlin.version: '1.4.20', jsoup.version: '1.13.1'} dependencies: - {groupId: org.jsoup, artifactId: jsoup, version: "${jsoup.version}"} - {groupId: org.jetbrains.kotlin, artifactId: kotlin-stdlib-jdk8, version: "${kotlin.version}"} -- {scope: test, groupId: org.junit.jupiter, artifactId: junit-jupiter-engine, version: 5.4.1} -- {scope: test, groupId: com.squareup.okhttp3, artifactId: mockwebserver, version: 3.9.1, +- {scope: test, groupId: org.junit.jupiter, artifactId: junit-jupiter-engine, version: 5.7.0} +- {scope: test, groupId: com.squareup.okhttp3, artifactId: mockwebserver, version: 4.9.0, exclusions: [{groupId: org.bouncycastle, artifactId: '*'}]} build: @@ -29,4 +29,4 @@ build: - {id: test-compile, phase: test-compile, goals: ['test-compile']} - groupId: org.apache.maven.plugins artifactId: maven-surefire-plugin - version: '3.0.0-M3' + version: '3.0.0-M5' diff --git a/src/test/kotlin/io/mikael/ksoup/test/util.kt b/src/test/kotlin/io/mikael/ksoup/test/util.kt index 04390ff..ac13ff0 100644 --- a/src/test/kotlin/io/mikael/ksoup/test/util.kt +++ b/src/test/kotlin/io/mikael/ksoup/test/util.kt @@ -22,7 +22,7 @@ internal class StaticDispatcher(private val resolver: (String) -> String?): Disp private fun r(n: Int): MockResponse = MockResponse().setResponseCode(n) override fun dispatch(request: RecordedRequest) = - resolver(request.path) + resolver(request.path!!) ?.let { resource(it) } ?.let { r(200).setBody(it.readText()) } ?: r(404) @@ -49,7 +49,7 @@ open class StaticWebTest { @BeforeEach fun before() { server = MockWebServer().apply { - this.setDispatcher(StaticDispatcher(staticContentResolver)) + this.dispatcher = StaticDispatcher(staticContentResolver) this.start() } } @@ -57,7 +57,7 @@ open class StaticWebTest { @AfterEach fun after() = server.close() - protected fun testUrl(path: String) = server.url(path)!!.toString() + protected fun testUrl(path: String) = server.url(path).toString() protected fun assertRequestPath(path: String) = assertEquals(path, server.takeRequest().path)