All Downloads are FREE. Search and download functionalities are using the official Maven repository.

application.StubLoaderEngine.kt Maven / Gradle / Ivy

There is a newer version: 1.3.39
Show newest version
package application

import `in`.specmatic.core.Feature
import `in`.specmatic.core.log.logger
import `in`.specmatic.core.utilities.ContractPathData
import `in`.specmatic.mock.ScenarioStub
import `in`.specmatic.stub.loadContractStubsFromFiles
import `in`.specmatic.stub.loadContractStubsFromImplicitPaths
import org.springframework.stereotype.Component
import java.io.File

@Component
class StubLoaderEngine {
    fun loadStubs(contractPathDataList: List, dataDirs: List): List>> {
        contractPathDataList.forEach { contractPath ->
            if(!File(contractPath.path).exists()) {
                logger.log("$contractPath does not exist.")
            }
        }
        return when {
            dataDirs.isNotEmpty() -> loadContractStubsFromFiles(contractPathDataList, dataDirs)
            else -> loadContractStubsFromImplicitPaths(contractPathDataList)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy