io.specmatic.core.NoBodyValue.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.core
import io.specmatic.core.pattern.Pattern
import io.specmatic.core.value.*
object NoBodyValue : Value {
override val httpContentType: String
get() = "text/plain"
override fun displayableValue(): String {
return "No body"
}
override fun toStringLiteral(): String {
return ""
}
override fun displayableType(): String {
return "No body"
}
override fun exactMatchElseType(): Pattern {
return NoBodyPattern
}
override fun type(): Pattern {
return NoBodyPattern
}
override fun typeDeclarationWithoutKey(
exampleKey: String,
types: Map,
exampleDeclarations: ExampleDeclarations
): Pair {
return TypeDeclaration("No body", types) to exampleDeclarations
}
override fun typeDeclarationWithKey(
key: String,
types: Map,
exampleDeclarations: ExampleDeclarations
): Pair {
return TypeDeclaration("No body", types) to exampleDeclarations
}
override fun listOf(valueList: List): Value {
return JSONArrayValue(valueList)
}
override fun toString(): String = toStringValue().string
override fun toStringValue(): StringValue {
return EmptyString
}
}