diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 19edaaf..ba52f41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,11 +19,11 @@ jobs: path: | ~/.gradle/caches ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/*.gradle*') }} + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} restore-keys: | - ${{ runner.os }}-gradle-${{ secrets.CACHE_VERSION }}- + ${{ runner.os }}-gradle- - name: Run Gradle check - run: ./gradlew check + run: ./gradlew check --info - name: Codecov uses: codecov/codecov-action@v1.0.11 with: diff --git a/src/test/kotlin/com/kuvaszuptime/kuvasz/services/SSLValidatorTest.kt b/src/test/kotlin/com/kuvaszuptime/kuvasz/services/SSLValidatorTest.kt index d727bd8..fa33001 100644 --- a/src/test/kotlin/com/kuvaszuptime/kuvasz/services/SSLValidatorTest.kt +++ b/src/test/kotlin/com/kuvaszuptime/kuvasz/services/SSLValidatorTest.kt @@ -1,46 +1,46 @@ package com.kuvaszuptime.kuvasz.services -import io.kotest.core.spec.style.DescribeSpec +import io.kotest.core.spec.style.StringSpec import io.kotest.data.forAll import io.kotest.data.headers import io.kotest.data.row import io.kotest.data.table import io.kotest.matchers.booleans.shouldBeTrue import java.net.URL -import kotlin.time.seconds -class SSLValidatorTest : DescribeSpec( +class SSLValidatorTest : StringSpec( { val validator = SSLValidator() - describe("SSLValidator") { - it("validate should return the right result").config(timeout = 30.seconds) { - table( - headers("url", "isValid"), - row("https://sha256.badssl.com/", true), - row("https://sha384.badssl.com/", true), - row("https://sha512.badssl.com/", true), - row("https://1000-sans.badssl.com/", true), - row("https://10000-sans.badssl.com/", true), - row("https://ecc256.badssl.com/", true), - row("https://ecc384.badssl.com/", true), - row("https://rsa2048.badssl.com/", true), - row("https://rsa4096.badssl.com/", true), - row("https://rsa8192.badssl.com/", true), - row("https://extended-validation.badssl.com/", true), + "validate should return the right result" { + table( + headers("url", "isValid"), + row("https://sha256.badssl.com/", true), + row("https://sha384.badssl.com/", true), + row("https://sha512.badssl.com/", true), + row("https://1000-sans.badssl.com/", true), + row("https://10000-sans.badssl.com/", true), + row("https://ecc256.badssl.com/", true), + row("https://ecc384.badssl.com/", true), + row("https://rsa2048.badssl.com/", true), + row("https://rsa4096.badssl.com/", true), + row("https://rsa8192.badssl.com/", true), + row("https://extended-validation.badssl.com/", true), - row("https://expired.badssl.com/", false), - row("https://wrong.host.badssl.com/", false), - row("https://self-signed.badssl.com/", false), - row("https://untrusted-root.badssl.com/", false), - row("https://no-common-name.badssl.com/", false), - row("https://no-subject.badssl.com/", false), - row("https://incomplete-chain.badssl.com/", false) - ).forAll { url, isValid -> - val result = validator.validate(URL(url)) + row("https://expired.badssl.com/", false), + row("https://wrong.host.badssl.com/", false), + row("https://self-signed.badssl.com/", false), + row("https://untrusted-root.badssl.com/", false), + row("https://no-common-name.badssl.com/", false), + row("https://no-subject.badssl.com/", false), + row("https://incomplete-chain.badssl.com/", false) + ).forAll { url, isValid -> + val result = validator.validate(URL(url)) + println(url) + println(isValid) + println(result) - (if (isValid) result.isRight() else result.isLeft()).shouldBeTrue() - } + (if (isValid) result.isRight() else result.isLeft()).shouldBeTrue() } } }