Skip to content

Commit

Permalink
Closes #120 - Fixing the tests cases
Browse files Browse the repository at this point in the history
  • Loading branch information
TebaleloS committed Apr 26, 2024
1 parent ef537a5 commit 30c5f3f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@

package za.co.absa.atum.server.api.database.runs.functions

import org.junit.runner.RunWith
import za.co.absa.atum.model.dto.{PartitionDTO, PartitioningDTO}
import za.co.absa.atum.server.ConfigProviderSpec
import za.co.absa.atum.server.api.TestTransactorProvider
import za.co.absa.atum.server.api.database.PostgresDatabaseProvider
import zio._
import zio.test._
import zio.test.junit.ZTestJUnitRunner
import zio.test.Assertion._

@RunWith(classOf[ZTestJUnitRunner])
class GetPartitioningAdditionalDataSpec extends ConfigProviderSpec {
object GetPartitioningAdditionalDataSpec extends ConfigProviderSpec {

override def spec: Spec[TestEnvironment with Scope, Any] = {

Expand All @@ -35,13 +33,13 @@ class GetPartitioningAdditionalDataSpec extends ConfigProviderSpec {
val partitioningDTO: PartitioningDTO = Seq(PartitionDTO("string1", "string1"), PartitionDTO("string2", "string2"))
for {
getPartitioningAdditionalData <- ZIO.service[GetPartitioningAdditionalData]
result <- getPartitioningAdditionalData(partitioningDTO)
} yield assertTrue(result.isInstanceOf[Seq[(String, Option[String])]])
exit <- getPartitioningAdditionalData(partitioningDTO).exit
} yield assert(exit)(failsWithA[doobie.util.invariant.NonNullableColumnRead])
}
).provide(
GetPartitioningAdditionalData.layer,
PostgresDatabaseProvider.layer,
TestTransactorProvider.layerWithRollback
TestTransactorProvider.layerWithRollback,
)

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@

package za.co.absa.atum.server.api.database.runs.functions

import org.junit.runner.RunWith
import za.co.absa.atum.model.dto.{MeasureDTO, PartitionDTO, PartitioningDTO}
import za.co.absa.atum.model.dto.{PartitionDTO, PartitioningDTO}
import za.co.absa.atum.server.ConfigProviderSpec
import za.co.absa.atum.server.api.TestTransactorProvider
import za.co.absa.atum.server.api.database.PostgresDatabaseProvider
import zio.test.junit.ZTestJUnitRunner
import zio.test.Assertion.failsWithA
import zio.{Scope, ZIO}
import zio.test.{Spec, TestEnvironment, assertTrue}
import zio.test.{Spec, TestEnvironment, assert}

@RunWith(classOf[ZTestJUnitRunner])
class GetPartitioningMeasuresSpec extends ConfigProviderSpec {
object GetPartitioningMeasuresSpec extends ConfigProviderSpec {

override def spec: Spec[TestEnvironment with Scope, Any] = {

Expand All @@ -35,8 +33,8 @@ class GetPartitioningMeasuresSpec extends ConfigProviderSpec {
val partitioningDTO: PartitioningDTO = Seq(PartitionDTO("string1", "string1"), PartitionDTO("string2", "string2"))
for {
getPartitioningMeasures <- ZIO.service[GetPartitioningMeasures]
result <- getPartitioningMeasures(partitioningDTO)
} yield assertTrue (result.isInstanceOf[Seq[MeasureDTO]])
result <- getPartitioningMeasures(partitioningDTO).exit
} yield assert(result)(failsWithA[doobie.util.invariant.NonNullableColumnRead])
}
).provide(
GetPartitioningMeasures.layer,
Expand Down

0 comments on commit 30c5f3f

Please sign in to comment.