Skip to content

Commit 7ee3c77

Browse files
committed
added assertions
1 parent 2a693c4 commit 7ee3c77

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/swagger-core/src/test/scala/converter/SnakeCaseConverterTest.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class SnakeCaseConverterTest extends FlatSpec with ShouldMatchers {
2929
// make sure the field bar: converter.Bar is not present
3030
ModelConverters.read(classOf[SnakeCaseModel]) match {
3131
case Some(model) => {
32-
println(JsonSerializer.asJson(model))
32+
model.id should be ("SnakeCaseModel")
33+
model.name should be ("SnakeCaseModel")
3334
}
3435
case _ => fail("didn't read anything")
3536
}
@@ -52,7 +53,10 @@ class SnakeCaseConverter extends SwaggerSchemaConverter {
5253
val property = p.copy(`type` = toSnakeCase(p.`type`))
5354
properties += key -> property
5455
})
55-
model.copy(id = toSnakeCase(model.id), properties = properties)
56+
model.copy(
57+
id = toSnakeCase(model.id),
58+
name = toSnakeCase(model.name),
59+
properties = properties)
5660
})
5761
}
5862

@@ -63,4 +67,4 @@ class SnakeCaseConverter extends SwaggerSchemaConverter {
6367
case false => Character.toUpperCase(str.charAt(0)) + str.substring(1)
6468
}
6569
}
66-
}
70+
}

0 commit comments

Comments
 (0)