From d684420f3309416fa273af96b536b9b29d20db0d Mon Sep 17 00:00:00 2001 From: AB019TC Date: Fri, 26 Jul 2024 09:24:47 +0200 Subject: [PATCH] Fixed PartitioningRepositoryUnitTests --- .../api/repository/PartitioningRepositoryUnitTests.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/src/test/scala/za/co/absa/atum/server/api/repository/PartitioningRepositoryUnitTests.scala b/server/src/test/scala/za/co/absa/atum/server/api/repository/PartitioningRepositoryUnitTests.scala index a0061867b..107b057f9 100644 --- a/server/src/test/scala/za/co/absa/atum/server/api/repository/PartitioningRepositoryUnitTests.scala +++ b/server/src/test/scala/za/co/absa/atum/server/api/repository/PartitioningRepositoryUnitTests.scala @@ -20,7 +20,6 @@ import org.mockito.Mockito.{mock, when} import za.co.absa.atum.server.api.TestData import za.co.absa.atum.server.api.database.runs.functions._ import za.co.absa.atum.server.api.exception.DatabaseError -//import za.co.absa.atum.server.model.CheckpointFromDB import za.co.absa.db.fadb.exceptions.ErrorInDataException import za.co.absa.db.fadb.status.{FunctionStatus, Row} import zio._ @@ -98,11 +97,11 @@ object PartitioningRepositoryUnitTests extends ZIOSpecDefault with TestData { test("Returns expected Left with StatusException") { for { result <- PartitioningRepository.createPartitioningIfNotExists(partitioningSubmitDTO2).exit - } yield assertTrue(result == Exit.fail(DatabaseError("error in Partitioning data"))) + } yield assertTrue(result == Exit.fail(DatabaseError("Exception caused by operation: 'createPartitioningIfNotExists': (50) error in Partitioning data"))) }, test("Returns expected DatabaseError") { assertZIO(PartitioningRepository.createPartitioningIfNotExists(partitioningSubmitDTO3).exit)( - failsWithA[Exception] + failsWithA[DatabaseError] ) } ), @@ -116,11 +115,11 @@ object PartitioningRepositoryUnitTests extends ZIOSpecDefault with TestData { test("Returns expected Left with StatusException") { for { result <- PartitioningRepository.createOrUpdateAdditionalData(additionalDataSubmitDTO2).exit - } yield assertTrue(result == Exit.fail(DatabaseError("error in AD data"))) + } yield assertTrue(result == Exit.fail(DatabaseError("Exception caused by operation: 'createOrUpdateAdditionalData': (50) error in AD data"))) }, test("Returns expected DatabaseError") { assertZIO(PartitioningRepository.createOrUpdateAdditionalData(additionalDataSubmitDTO3).exit)( - failsWithA[Exception] + failsWithA[DatabaseError] ) } ),