application.ContractToCheck.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of specmatic-executable Show documentation
Show all versions of specmatic-executable Show documentation
Command-line standalone executable jar for Specmatic
package application
import `in`.specmatic.core.Feature
import `in`.specmatic.core.git.GitCommand
import java.io.File
class ContractToCheck(private val contractFile: CanonicalFile, private val git: GitCommand) {
val path: String = contractFile.path
constructor(contractFilePath: String, git: GitCommand): this(CanonicalFile(contractFilePath), git)
fun fetchAllOtherContracts(): List> =
listOfAllContractFiles(File(git.gitRoot())).filterNot {
it.path == contractFile.path
}.mapNotNull {
loadContractData(it)
}
fun getPathsInContract(): List? = urlPaths(contractFile.readText(), contractFile.file.canonicalPath)
}