diff --git a/samples/client/petstore/scala/src/main/java/io/swagger/client/ApiInvoker.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala similarity index 100% rename from samples/client/petstore/scala/src/main/java/io/swagger/client/ApiInvoker.scala rename to samples/client/petstore/scala/src/main/scala/io/swagger/client/ApiInvoker.scala diff --git a/samples/client/petstore/scala/src/main/java/io/swagger/client/api/PetApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala similarity index 100% rename from samples/client/petstore/scala/src/main/java/io/swagger/client/api/PetApi.scala rename to samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala diff --git a/samples/client/petstore/scala/src/main/java/io/swagger/client/api/StoreApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala similarity index 100% rename from samples/client/petstore/scala/src/main/java/io/swagger/client/api/StoreApi.scala rename to samples/client/petstore/scala/src/main/scala/io/swagger/client/api/StoreApi.scala diff --git a/samples/client/petstore/scala/src/main/java/io/swagger/client/api/UserApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala similarity index 100% rename from samples/client/petstore/scala/src/main/java/io/swagger/client/api/UserApi.scala rename to samples/client/petstore/scala/src/main/scala/io/swagger/client/api/UserApi.scala diff --git a/samples/client/petstore/scala/src/main/java/io/swagger/client/model/Category.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala similarity index 100% rename from samples/client/petstore/scala/src/main/java/io/swagger/client/model/Category.scala rename to samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Category.scala diff --git a/samples/client/petstore/scala/src/main/java/io/swagger/client/model/Order.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala similarity index 100% rename from samples/client/petstore/scala/src/main/java/io/swagger/client/model/Order.scala rename to samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Order.scala diff --git a/samples/client/petstore/scala/src/main/java/io/swagger/client/model/Pet.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala similarity index 100% rename from samples/client/petstore/scala/src/main/java/io/swagger/client/model/Pet.scala rename to samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Pet.scala diff --git a/samples/client/petstore/scala/src/main/java/io/swagger/client/model/Tag.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala similarity index 100% rename from samples/client/petstore/scala/src/main/java/io/swagger/client/model/Tag.scala rename to samples/client/petstore/scala/src/main/scala/io/swagger/client/model/Tag.scala diff --git a/samples/client/petstore/scala/src/main/java/io/swagger/client/model/User.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala similarity index 100% rename from samples/client/petstore/scala/src/main/java/io/swagger/client/model/User.scala rename to samples/client/petstore/scala/src/main/scala/io/swagger/client/model/User.scala diff --git a/samples/client/petstore/scala/src/test/scala/PetApiTest.scala b/samples/client/petstore/scala/src/test/scala/PetApiTest.scala index c06a2072998..24ce4826fcb 100644 --- a/samples/client/petstore/scala/src/test/scala/PetApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/PetApiTest.scala @@ -1,5 +1,6 @@ -import com.wordnik.petstore.api._ -import com.wordnik.petstore.model._ +import io.swagger.client._ +import io.swagger.client.api._ +import io.swagger.client.model._ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @@ -30,7 +31,7 @@ class PetApiTest extends FlatSpec with Matchers { Category(1, "sold"), "dragon", (for (i <- (1 to 10)) yield "http://foo.com/photo/" + i).toList, - (for (i <- (1 to 5)) yield com.wordnik.petstore.model.Tag(i, "tag-" + i)).toList, + (for (i <- (1 to 5)) yield io.swagger.client.model.Tag(i, "tag-" + i)).toList, "lost" ) @@ -55,7 +56,7 @@ class PetApiTest extends FlatSpec with Matchers { Category(1, "sold"), "programmer", (for (i <- (1 to 10)) yield "http://foo.com/photo/" + i).toList, - (for (i <- (1 to 5)) yield com.wordnik.petstore.model.Tag(i, "tag-" + i)).toList, + (for (i <- (1 to 5)) yield io.swagger.client.model.Tag(i, "tag-" + i)).toList, "confused" ) @@ -80,7 +81,7 @@ class PetApiTest extends FlatSpec with Matchers { } it should "find pets by status" in { - api.findPetsByStatus("available") match { + api.findPetsByStatus(List("available")) match { case Some(pets) => { pets.foreach(pet => pet.status should be("available")) } @@ -90,7 +91,7 @@ class PetApiTest extends FlatSpec with Matchers { it should "find pets by tag" in { println("finding by tags") - api.findPetsByTags("tag1,tag2") match { + api.findPetsByTags(List("tag1", "tag2")) match { case Some(pets) => { pets.foreach(pet => { val tags = (for (tag <- pet.tags) yield tag.name).toSet diff --git a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala b/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala index 2d453ab2255..053dffd055d 100644 --- a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala @@ -1,6 +1,6 @@ -import com.wordnik.client._ -import com.wordnik.petstore.api._ -import com.wordnik.petstore.model._ +import io.swagger.client._ +import io.swagger.client.api._ +import io.swagger.client.model._ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @@ -30,13 +30,14 @@ class StoreApiTest extends FlatSpec with Matchers { } it should "place an order" in { - val now = new java.util.Date + val now = new org.joda.time.DateTime val order = Order ( - 10, - 1000, - 101, - "pending", - now) + petId = 10, + id = 1000, + quantity = 101, + status = "pending", + shipDate = now, + complete = true) api.placeOrder(order) @@ -45,20 +46,21 @@ class StoreApiTest extends FlatSpec with Matchers { order.id should be(1000) order.petId should be(10) order.quantity should be(101) - order.shipDate should be (now) + order.shipDate.equals(now) should be (true) } case None => } } it should "delete an order" in { - val now = new java.util.Date + val now = new org.joda.time.DateTime val order = Order( - 1001, - 10, - 101, - "pending", - now) + id = 1001, + petId = 10, + quantity = 101, + status = "pending", + shipDate = now, + complete = true) api.placeOrder(order) @@ -67,7 +69,7 @@ class StoreApiTest extends FlatSpec with Matchers { order.id should be(1001) order.petId should be(10) order.quantity should be(101) - order.shipDate should be (now) + order.shipDate.equals(now) should be (true) } case None => } diff --git a/samples/client/petstore/scala/src/test/scala/UserApiTest.scala b/samples/client/petstore/scala/src/test/scala/UserApiTest.scala index 73f90342ad6..37b80815c87 100644 --- a/samples/client/petstore/scala/src/test/scala/UserApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/UserApiTest.scala @@ -1,5 +1,6 @@ -import com.wordnik.petstore.api._ -import com.wordnik.petstore.model._ +import io.swagger.client._ +import io.swagger.client.api._ +import io.swagger.client.model._ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner