io.specmatic.test.TestResultRecord.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of specmatic-core Show documentation
Show all versions of specmatic-core Show documentation
Turn your contracts into executable specifications. Contract Driven Development - Collaboratively Design & Independently Deploy MicroServices & MicroFrontends.
package io.specmatic.test
import io.specmatic.core.ScenarioDetailsForResult
import io.specmatic.core.TestResult
data class TestResultRecord(
val path: String,
val method: String,
val responseStatus: Int,
val result: TestResult,
val sourceProvider: String? = null,
val sourceRepository: String? = null,
val sourceRepositoryBranch: String? = null,
val specification: String? = null,
val serviceType: String? = null,
val actualResponseStatus: Int = 0,
val scenario: ScenarioDetailsForResult? = null,
val isValid: Boolean = true,
) {
val isExercised = result !in setOf(TestResult.Skipped, TestResult.DidNotRun)
val isCovered = result in setOf(TestResult.Success, TestResult.Error, TestResult.Failed, TestResult.Covered)
fun isConnectionRefused() = actualResponseStatus == 0
}