More test cases for parameter Mapper spec
@@ -6,6 +6,7 @@ import io.swagger.models.parameters.BodyParameter
import io.swagger.models.parameters.FormParameter
import io.swagger.models.parameters.QueryParameter
import io.swagger.models.parameters.SerializableParameter
+import io.swagger.models.properties.FileProperty
import spock.lang.Specification
import springfox.documentation.builders.ParameterBuilder
import springfox.documentation.schema.ModelRef
@@ -62,6 +63,7 @@ class ParameterMapperSpec extends Specification {
new ModelRef("array", new ModelRef("int")) | "array" | null | "integer" | "int32"
new ModelRef("int") | "integer" | "int32" | null | null
new ModelRef("long") | "integer" | "int64" | null | null
+ new ModelRef("boolean") | "boolean" | null | null | null
}
def "form parameters fall back to body parameters for non-primitive top level types" () {
@@ -75,6 +77,17 @@ class ParameterMapperSpec extends Specification {
sut.mapParameter(parameter) instanceof BodyParameter
}
+ def "file parameter handling" () {
+ given:
+ def parameter = parameter("formData")
+ .modelRef(new ModelRef("file"))
+ .build()
+ when:
+ def sut = new ParameterMapper()
+ then:
+ sut.mapParameter(parameter) instanceof BodyParameter
+ }
+
def "form parameters fall back to body parameters for arrays of non-primitive types" () {
given:
def parameter = parameter("formData")
