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

au.com.dius.pact.provider.scalatest.package.scala Maven / Gradle / Ivy

Go to download

pact-jvm-provider-scalatest ======================== Provides an extension to scalatest to validate pact files against a running provider. See [examples](src/test/scala/au/com/dius/pact/provider/scalatest) for details. *Note:* The Pact ProviderSpec requires scalatest 2.2.x

There is a newer version: 3.5.24
Show newest version
package au.com.dius.pact.provider

import java.net.URI

package object scalatest {

  trait Consumer {
    val filter: ConsumerInfo => Boolean
  }

  /**
    * Matching consumer pacts will be allowed to run against the provider
    *
    * @param consumer
    * @return
    */
  implicit def strToConsumer(consumer: String) = new Consumer {
    override val filter = (consumerInfo: ConsumerInfo) => consumerInfo.getName == consumer
  }

  /**
    * @param provider which provider pact should be tested
    * @param consumer which consumer pact should be tested
    * @param uri      where is the pact
    */
  case class Pact(provider: String, consumer: Consumer, uri: URI)

  case class ServerConfig(serverStarter: ServerStarter, restartServer: Boolean = false)

  case class VerificationConfig(pact: Pact, serverConfig: ServerConfig)

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy