File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed
src/test/kotlin/aws/sdk/kotlin/dokka Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,15 @@ description = "Custom Dokka plugin for AWS Kotlin SDK API docs"
1818dependencies {
1919 compileOnly(libs.dokka.base)
2020 compileOnly(libs.dokka.core)
21+
22+ testImplementation(libs.jsoup)
23+ testImplementation(libs.junit.jupiter)
24+ testImplementation(libs.kotest.assertions.core.jvm)
25+ testImplementation(libs.kotlin.test.junit5)
26+ }
27+
28+ tasks.test {
29+ useJUnitPlatform()
2130}
2231
2332tasks.withType<KotlinCompile > {
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+ * SPDX-License-Identifier: Apache-2.0
4+ */
5+ package aws.sdk.kotlin.dokka
6+
7+ import org.jsoup.Jsoup
8+ import org.junit.jupiter.api.Assumptions.assumeTrue
9+ import org.junit.jupiter.api.Test
10+ import java.io.File
11+ import kotlin.test.assertTrue
12+
13+ class DokkaAwsTest {
14+ @Test
15+ fun testLoadScripts () {
16+ val testFile = File (" ../build/dokka/htmlMultiModule/index.html" )
17+
18+ assumeTrue(
19+ testFile.exists(),
20+ " Skipping test: test file does not exist"
21+ )
22+
23+ val document = Jsoup .parse(testFile, " UTF-8" )
24+
25+ val expectedScripts = listOf (
26+ " awshome_s_code.js"
27+ )
28+
29+ val scripts = document.head().select(" script[src]" )
30+
31+ expectedScripts.forEach { expectedScript ->
32+ assertTrue(
33+ scripts.any { it.attr(" src" ).endsWith(expectedScript) },
34+ " Expected script $expectedScript not found"
35+ )
36+ }
37+ }
38+ }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ kotlinx-benchmark-version = "0.4.12"
2626kotlinx-serialization-version = " 1.7.3"
2727mockk-version = " 1.13.13"
2828slf4j-version = " 2.0.16"
29+ jsoup-version = " 1.19.1"
2930
3031[libraries ]
3132aws-kotlin-repo-tools-build-support = { module =" aws.sdk.kotlin.gradle:build-support" , version.ref = " aws-kotlin-repo-tools-version" }
@@ -111,6 +112,8 @@ smithy-aws-smoke-test-model = { module = "software.amazon.smithy:smithy-aws-smok
111112junit-jupiter = { module = " org.junit.jupiter:junit-jupiter" , version.ref = " junit-version" }
112113junit-jupiter-params = { module = " org.junit.jupiter:junit-jupiter-params" , version.ref = " junit-version" }
113114
115+ jsoup = { module = " org.jsoup:jsoup" , version.ref = " jsoup-version" }
116+
114117kotest-assertions-core = { module = " io.kotest:kotest-assertions-core" , version.ref = " kotest-version" }
115118kotest-assertions-core-jvm = { module = " io.kotest:kotest-assertions-core-jvm" , version.ref = " kotest-version" }
116119kotest-framework-datatest = { module = " io.kotest:kotest-framework-datatest" , version.ref = " kotest-version" }
You can’t perform that action at this time.
0 commit comments