Skip to content

Commit c7d4b8b

Browse files
authored
Case class test (#60)
1 parent 8be04bc commit c7d4b8b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/test/scala/com/github/swagger/scala/converter/ModelPropertyParserTest.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,18 @@ class ModelPropertyParserTest extends AnyFlatSpec with Matchers with OptionValue
337337
nullSafeList(mapSchema.getRequired()) shouldBe empty
338338
}
339339

340+
it should "process EchoList" in {
341+
val converter = ModelConverters.getInstance()
342+
val schemas = converter.readAll(classOf[EchoList]).asScala.toMap
343+
val model = findModel(schemas, "EchoList")
344+
model should be (defined)
345+
model.value.getProperties should not be (null)
346+
val val1Field = model.value.getProperties.get("val1")
347+
val1Field shouldBe a [IntegerSchema]
348+
val val2Field = model.value.getProperties.get("val2")
349+
val2Field shouldBe a [IntegerSchema]
350+
}
351+
340352
private def findModel(schemas: Map[String, Schema[_]], name: String): Option[Schema[_]] = {
341353
schemas.get(name) match {
342354
case Some(m) => Some(m)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package models
2+
3+
case class EchoList(val1: Int, val2: Int)

0 commit comments

Comments
 (0)