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

au.com.dius.pact.provider.RequestDataToBeVerified.kt Maven / Gradle / Ivy

There is a newer version: 4.7.0-beta.0
Show newest version
package au.com.dius.pact.provider

import au.com.dius.pact.core.model.OptionalBody
import io.pact.plugins.jvm.core.InteractionVerificationData

/**
 * Request data that is going to be used by the plugin to create the request to be verified
 */
interface RequestData {
  /**
   * Data for the request of the interaction
   */
  val requestData: OptionalBody

  /**
   * Metadata associated with the request
   */
  val metadata: MutableMap
}

/**
 * Data used by a plugin to create a request to be verified
 */
data class RequestDataToBeVerified(
  /**
   * Data for the request of the interaction
   */
  override val requestData: OptionalBody,

  /**
   * Metadata associated with the request
   */
  override val metadata: MutableMap
): RequestData {
  constructor(requestData: InteractionVerificationData) : this(
    requestData.requestData, requestData.metadata.toMutableMap()
  )

  fun asInteractionVerificationData() = InteractionVerificationData(requestData, metadata)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy