diff --git a/mysql/src/test/resources/shop_schema.sql b/mysql/src/test/resources/shop_schema.sql index 40a323f6..c5ebea73 100644 --- a/mysql/src/test/resources/shop_schema.sql +++ b/mysql/src/test/resources/shop_schema.sql @@ -49,7 +49,7 @@ values ('784426a5-b90a-4759-afbb-571b7a0ba35e', 'Mila', 'Paterso', true, '1990-11-16'), ('df8215a2-d5fd-4c6c-9984-801a1b3a2a0b', 'Alana', 'Murray', true, '1995-11-12'), ('636ae137-5b1a-4c8c-b11f-c47c624d9cdc', 'Jose', 'Wiggins', false, '1987-03-23'), - ('d4f6c156-20ac-4d27-8ced-535bf4315ebc', 'Robert', 'Rupert', false, '1998-06-11'); + ('d4f6c156-20ac-4d27-8ced-535bf4315ebc', 'Robert', 'Rupert', true, '1998-06-11'); insert into products (id, name, description, image_url) diff --git a/mysql/src/test/scala/zio/sql/mysql/CommonFunctionDefSpec.scala b/mysql/src/test/scala/zio/sql/mysql/CommonFunctionDefSpec.scala index 95358844..b1466807 100644 --- a/mysql/src/test/scala/zio/sql/mysql/CommonFunctionDefSpec.scala +++ b/mysql/src/test/scala/zio/sql/mysql/CommonFunctionDefSpec.scala @@ -38,6 +38,7 @@ object CommonFunctionDefSpec extends MysqlRunnableSpec with Jdbc { "RonaldRonaldRussell", "TerrenceTerrenceNoel", "MilaMilaPaterso", + "RobertRobertRupert", "AlanaAlanaMurray", "JoseJoseWiggins" ) @@ -53,6 +54,7 @@ object CommonFunctionDefSpec extends MysqlRunnableSpec with Jdbc { "Person: Ronald Russell", "Person: Terrence Noel", "Person: Mila Paterso", + "Person: Robert Rupert", "Person: Alana Murray", "Person: Jose Wiggins" ) @@ -70,6 +72,7 @@ object CommonFunctionDefSpec extends MysqlRunnableSpec with Jdbc { "Name: Ronald and Surname: Russell", "Name: Terrence and Surname: Noel", "Name: Mila and Surname: Paterso", + "Name: Robert and Surname: Rupert", "Name: Alana and Surname: Murray", "Name: Jose and Surname: Wiggins" ) diff --git a/mysql/src/test/scala/zio/sql/mysql/CustomFunctionDefSpec.scala b/mysql/src/test/scala/zio/sql/mysql/CustomFunctionDefSpec.scala index a2fdbb2d..3d17afc9 100644 --- a/mysql/src/test/scala/zio/sql/mysql/CustomFunctionDefSpec.scala +++ b/mysql/src/test/scala/zio/sql/mysql/CustomFunctionDefSpec.scala @@ -9,7 +9,7 @@ import zio.test.Assertion._ import zio.test._ import java.time.format.DateTimeFormatter -import java.time.{LocalDate, LocalTime, ZoneId} +import java.time.{ LocalDate, LocalTime, ZoneId } import java.util.UUID object CustomFunctionDefSpec extends MysqlRunnableSpec with Jdbc { diff --git a/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala b/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala index d3a423b6..a5d39e58 100644 --- a/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala +++ b/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala @@ -79,8 +79,6 @@ object MysqlModuleSpec extends MysqlRunnableSpec { val query = select(customerId, fName, lName, dob) from customers - println(renderRead(query)) - val expected = Seq( Customer( @@ -112,6 +110,12 @@ object MysqlModuleSpec extends MysqlRunnableSpec { "Jose", "Wiggins", LocalDate.parse("1987-03-23") + ), + Customer( + UUID.fromString("d4f6c156-20ac-4d27-8ced-535bf4315ebc"), + "Robert", + "Rupert", + LocalDate.parse("1998-06-11") ) ) @@ -182,6 +186,7 @@ object MysqlModuleSpec extends MysqlRunnableSpec { UUID.fromString("60b01fc9-c902-4468-8d49-3c0f989def37"), UUID.fromString("f76c9ace-be07-4bf3-bd4c-4a9c62882e64"), UUID.fromString("784426a5-b90a-4759-afbb-571b7a0ba35e"), + UUID.fromString("d4f6c156-20ac-4d27-8ced-535bf4315ebc"), UUID.fromString("df8215a2-d5fd-4c6c-9984-801a1b3a2a0b"), UUID.fromString("636ae137-5b1a-4c8c-b11f-c47c624d9cdc") ) @@ -196,6 +201,7 @@ object MysqlModuleSpec extends MysqlRunnableSpec { UUID.fromString("60b01fc9-c902-4468-8d49-3c0f989def37"), UUID.fromString("f76c9ace-be07-4bf3-bd4c-4a9c62882e64"), UUID.fromString("784426a5-b90a-4759-afbb-571b7a0ba35e"), + UUID.fromString("d4f6c156-20ac-4d27-8ced-535bf4315ebc"), UUID.fromString("df8215a2-d5fd-4c6c-9984-801a1b3a2a0b"), UUID.fromString("636ae137-5b1a-4c8c-b11f-c47c624d9cdc") ) @@ -211,7 +217,7 @@ object MysqlModuleSpec extends MysqlRunnableSpec { for { r <- execute(query).runCollect - } yield assertTrue(r.head == 5L) + } yield assertTrue(r.head == 6L) }, test("Can select from joined tables (inner join)") { val query = select(fName, lName, orderDate) from (customers join orders).on( diff --git a/mysql/src/test/scala/zio/sql/mysql/TransactionSpec.scala b/mysql/src/test/scala/zio/sql/mysql/TransactionSpec.scala index b22d8ca8..0cfb8998 100644 --- a/mysql/src/test/scala/zio/sql/mysql/TransactionSpec.scala +++ b/mysql/src/test/scala/zio/sql/mysql/TransactionSpec.scala @@ -31,7 +31,7 @@ object TransactionSpec extends MysqlRunnableSpec with Jdbc { val assertion = result - .map(count => assertTrue(count == 5)) + .map(count => assertTrue(count == 6)) .orDie assertion.mapErrorCause(cause => Cause.stackless(cause.untraced)) @@ -48,7 +48,7 @@ object TransactionSpec extends MysqlRunnableSpec with Jdbc { remainingCustomersCount <- execute(query).map(identity[UUID](_)).runCount } yield (allCustomersCount, remainingCustomersCount)) - assertZIO(result)(equalTo((5L, 5L))).mapErrorCause(cause => Cause.stackless(cause.untraced)) + assertZIO(result)(equalTo((6L, 6L))).mapErrorCause(cause => Cause.stackless(cause.untraced)) }, test("Transaction succeeded and deleted rows") { val query = select(customerId) from customers @@ -62,7 +62,7 @@ object TransactionSpec extends MysqlRunnableSpec with Jdbc { remainingCustomersCount <- execute(query).map(identity[UUID](_)).runCount } yield (allCustomersCount, remainingCustomersCount)) - assertZIO(result)(equalTo((5L, 4L))).mapErrorCause(cause => Cause.stackless(cause.untraced)) + assertZIO(result)(equalTo((6L, 4L))).mapErrorCause(cause => Cause.stackless(cause.untraced)) } ) @@ sequential }