Skip to content

Commit 3373936

Browse files
committed
Merge branch 'develop_2.0' of github.com:swagger-api/swagger-core into develop_2.0
2 parents c5aa988 + 8c15d2a commit 3373936

20 files changed

+93
-32
lines changed

modules/swagger-core/src/test/scala/1_3/converter/BoxedTypesTest.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import org.scalatest.junit.JUnitRunner
1414
import org.scalatest.FlatSpec
1515
import org.scalatest.Matchers
1616

17+
import matchers.SerializationMatchers._
18+
1719
@RunWith(classOf[JUnitRunner])
1820
class BoxedTypesTest extends FlatSpec with Matchers {
1921
Json.mapper().registerModule(DefaultScalaModule)
@@ -27,7 +29,7 @@ class BoxedTypesTest extends FlatSpec with Matchers {
2729
properties should not be (null)
2830
properties.size should be (5)
2931

30-
Json.pretty(models) should equal (
32+
models should serializeToJson (
3133
"""{
3234
"BoxedTypesIssue31" : {
3335
"properties" : {
@@ -77,7 +79,7 @@ Json.pretty(models) should equal (
7779
properties should not be (null)
7880
properties.size should be (5)
7981

80-
Json.pretty(models) should equal (
82+
models should serializeToJson (
8183
"""{
8284
"BoxedTypesIssue31WithDataType" : {
8385
"properties" : {

modules/swagger-core/src/test/scala/1_3/converter/ByteConverterTest.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ import org.scalatest.junit.JUnitRunner
1515
import org.scalatest.FlatSpec
1616
import org.scalatest.Matchers
1717

18+
import matchers.SerializationMatchers._
19+
1820
@RunWith(classOf[JUnitRunner])
1921
class ByteConverterTest extends FlatSpec with Matchers {
2022
val m = Json.mapper()
2123
m.registerModule(DefaultScalaModule)
2224

2325
val models = ModelConverters.getInstance().read(classOf[ByteConverterModel])
24-
Json.pretty(models) should equal(
26+
models should serializeToJson (
2527
"""{
2628
"ByteConverterModel" : {
2729
"properties" : {

modules/swagger-core/src/test/scala/1_3/converter/CovariantGetterTest.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import org.scalatest.FlatSpec
1414
import org.scalatest.Matchers
1515
import models.JCovariantGetter
1616

17+
import matchers.SerializationMatchers._
18+
1719
@RunWith(classOf[JUnitRunner])
1820
class CovariantGetterTest extends FlatSpec with Matchers {
1921
val m = Json.mapper()
@@ -22,7 +24,7 @@ class CovariantGetterTest extends FlatSpec with Matchers {
2224
it should "read a getter with covariant return type" in {
2325
val models = ModelConverters.getInstance().read(classOf[JCovariantGetter.Sub])
2426
models.size should be (1)
25-
Json.pretty(models) should be (
27+
models should serializeToJson (
2628
"""{
2729
"Sub" : {
2830
"properties" : {

modules/swagger-core/src/test/scala/1_3/converter/EnumConversionPropertyTest.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ import org.scalatest.junit.JUnitRunner
1414
import org.scalatest.FlatSpec
1515
import org.scalatest.Matchers
1616

17+
import matchers.SerializationMatchers._
18+
1719
@RunWith(classOf[JUnitRunner])
1820
class EnumConversionPropertyTest extends FlatSpec with Matchers {
1921
val m = Json.mapper()
2022
m.registerModule(DefaultScalaModule)
2123

2224
it should "read a model with an enum property" in {
2325
val models = ModelConverters.getInstance().read(classOf[ModelWithEnumProperty])
24-
Json.pretty(models) should be (
26+
models should serializeToJson (
2527
"""{
2628
"ModelWithEnumProperty" : {
2729
"properties" : {
@@ -36,7 +38,7 @@ class EnumConversionPropertyTest extends FlatSpec with Matchers {
3638

3739
it should "read a model with enums" in {
3840
val models = ModelConverters.getInstance().read(classOf[ATM])
39-
Json.pretty(models) should be (
41+
models should serializeToJson (
4042
"""{
4143
"ATM" : {
4244
"properties" : {

modules/swagger-core/src/test/scala/1_3/converter/JsonIgnoreModelTest.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ import org.scalatest.junit.JUnitRunner
1313
import org.scalatest.FlatSpec
1414
import org.scalatest.Matchers
1515

16+
import matchers.SerializationMatchers._
17+
1618
@RunWith(classOf[JUnitRunner])
1719
class JsonIgnoreModelTest extends FlatSpec with Matchers {
1820
val models = ModelConverters.getInstance().read(classOf[ModelWithIgnoreAnnotation])
19-
Json.pretty(models) should equal (
21+
models should serializeToJson (
2022
"""{
2123
"ModelWithIgnoreAnnotation" : {
2224
"properties" : {

modules/swagger-core/src/test/scala/1_3/converter/JsonIgnorePropertiesModelTest.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import org.scalatest.junit.JUnitRunner
1313
import org.scalatest.FlatSpec
1414
import org.scalatest.Matchers
1515

16+
import matchers.SerializationMatchers._
17+
1618
@RunWith(classOf[JUnitRunner])
1719
class JsonIgnorePropertiesModelTest extends FlatSpec with Matchers {
1820
it should "ignore a property with ignore annotations" in {
1921
val models = ModelConverters.getInstance().read(classOf[ModelWithIgnorePropertiesAnnotation])
20-
Json.pretty(models) should equal(
22+
models should serializeToJson (
2123
"""{
2224
"ModelWithIgnorePropertiesAnnotation" : {
2325
"properties" : {

modules/swagger-core/src/test/scala/1_3/converter/JsonPropertyModelTest.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ import org.scalatest.junit.JUnitRunner
1313
import org.scalatest.FlatSpec
1414
import org.scalatest.Matchers
1515

16+
import matchers.SerializationMatchers._
17+
1618
@RunWith(classOf[JUnitRunner])
1719
class JsonPropertyModelTest extends FlatSpec with Matchers {
1820
val models = ModelConverters.getInstance().read(classOf[ModelWithJsonProperty])
19-
Json.pretty(models) should be (
21+
models should serializeToJson (
2022
"""{
2123
"ModelWithJsonProperty" : {
2224
"properties" : {

modules/swagger-core/src/test/scala/1_3/converter/ModelConversionTest.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import java.util.Date
1717

1818
import scala.annotation.meta.field
1919

20+
import matchers.SerializationMatchers._
21+
2022
@RunWith(classOf[JUnitRunner])
2123
class ModelConversionTest extends FlatSpec with Matchers {
2224
Json.mapper().registerModule(DefaultScalaModule)
@@ -25,7 +27,7 @@ class ModelConversionTest extends FlatSpec with Matchers {
2527
val models = ModelConverters.getInstance().read(classOf[DateModel])
2628
val model = models.get("DateModel")
2729
model.getProperties().size should be (5)
28-
Json.pretty(model) should equal(
30+
model should serializeToJson (
2931
"""{
3032
"properties" : {
3133
"date" : {
@@ -61,7 +63,7 @@ class ModelConversionTest extends FlatSpec with Matchers {
6163
val models = ModelConverters.getInstance().read(classOf[SetModel])
6264
val model = models.get("SetModel")
6365
model.getProperties().size should be (1)
64-
Json.pretty(model) should be (
66+
model should serializeToJson (
6567
"""{
6668
"properties" : {
6769
"longs" : {

modules/swagger-core/src/test/scala/1_3/converter/ModelPropertyParserTest.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ import org.scalatest.junit.JUnitRunner
2121
import org.scalatest.FlatSpec
2222
import org.scalatest.Matchers
2323

24+
import matchers.SerializationMatchers._
25+
2426
@RunWith(classOf[JUnitRunner])
2527
class ModelPropertyParserTest extends FlatSpec with Matchers {
2628
Json.mapper().registerModule(DefaultScalaModule)
2729

2830
it should "extract a string list" in {
2931
val property = ModelConverters.getInstance().readAsProperty(classOf[List[String]])
30-
Json.pretty(property) should equal(
32+
property should serializeToJson (
3133
"""{
3234
"type" : "array",
3335
"items" : {

modules/swagger-core/src/test/scala/1_3/converter/ModelPropertyTest.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import org.scalatest.Matchers
2020

2121
import scala.beans.BeanProperty
2222

23+
import matchers.SerializationMatchers._
24+
2325
@RunWith(classOf[JUnitRunner])
2426
class ModelPropertyTest extends FlatSpec with Matchers {
2527
Json.mapper().registerModule(DefaultScalaModule)
@@ -76,7 +78,7 @@ class ModelPropertyTest extends FlatSpec with Matchers {
7678
class ModelPropertyOverrideTest extends FlatSpec with Matchers {
7779
it should "read a model with property dataTypes configured #679" in {
7880
val models = ModelConverters.getInstance().readAll(classOf[ModelWithModelPropertyOverrides])
79-
Json.pretty(models) should equal(
81+
models should serializeToJson (
8082
"""{
8183
"Children" : {
8284
"properties" : {

0 commit comments

Comments
 (0)