Skip to content

Commit 0bc3293

Browse files
Feature/296 upgrade scalatest from 3.0.5 to 3.2.15 (#302)
Closes #296
1 parent 8d031ac commit 0bc3293

File tree

59 files changed

+232
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+232
-146
lines changed

api/src/test/scala/za/co/absa/hyperdrive/ingestor/api/context/TestHyperdriveContext.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515

1616
package za.co.absa.hyperdrive.ingestor.api.context
1717

18-
import org.scalatest.{FlatSpec, Matchers}
18+
import org.scalatest.flatspec.AnyFlatSpec
19+
import org.scalatest.matchers.should.Matchers
1920

20-
class TestHyperdriveContext extends FlatSpec with Matchers {
21+
22+
class TestHyperdriveContext extends AnyFlatSpec with Matchers {
2123
behavior of HyperdriveContext.getClass.getName
2224

2325
"put" should "overwrite the value for the same key" in {

api/src/test/scala/za/co/absa/hyperdrive/ingestor/api/utils/TestComponentFactoryUtil.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
package za.co.absa.hyperdrive.ingestor.api.utils
1717

1818
import org.apache.commons.configuration2.BaseConfiguration
19-
import org.scalatest.{FlatSpec, Matchers}
19+
import org.scalatest.flatspec.AnyFlatSpec
20+
import org.scalatest.matchers.should.Matchers
2021
import za.co.absa.hyperdrive.ingestor.api.PropertyMetadata
2122

22-
class TestComponentFactoryUtil extends FlatSpec with Matchers {
23+
class TestComponentFactoryUtil extends AnyFlatSpec with Matchers {
2324
behavior of ComponentFactoryUtil.getClass.getName
2425

2526
"validateConfiguration" should "not throw an error if the configuration is valid" in {

api/src/test/scala/za/co/absa/hyperdrive/ingestor/api/utils/TestConfigUtils.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ package za.co.absa.hyperdrive.ingestor.api.utils
1717

1818
import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler
1919
import org.apache.commons.configuration2.{BaseConfiguration, Configuration, ConfigurationConverter}
20-
import org.scalatest.mockito.MockitoSugar
21-
import org.scalatest.{FlatSpec, Matchers}
20+
import org.scalatest.flatspec.AnyFlatSpec
21+
import org.scalatest.matchers.should.Matchers
22+
import org.scalatestplus.mockito.MockitoSugar
2223
import za.co.absa.hyperdrive.ingestor.api.transformer.StreamTransformerFactory
2324

24-
class TestConfigUtils extends FlatSpec with Matchers with MockitoSugar {
25+
class TestConfigUtils extends AnyFlatSpec with Matchers with MockitoSugar {
2526

2627
behavior of s"ConfigUtils"
2728

api/src/test/scala/za/co/absa/hyperdrive/ingestor/api/utils/TestStreamWriterUtil.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ package za.co.absa.hyperdrive.ingestor.api.utils
1717

1818
import org.apache.commons.configuration2.BaseConfiguration
1919
import org.apache.spark.sql.streaming.Trigger
20-
import org.scalatest.mockito.MockitoSugar
21-
import org.scalatest.{FlatSpec, Matchers}
20+
import org.scalatest.flatspec.AnyFlatSpec
21+
import org.scalatest.matchers.should.Matchers
22+
import org.scalatestplus.mockito.MockitoSugar
2223
import za.co.absa.hyperdrive.ingestor.api.writer.StreamWriterCommonAttributes.{keyTriggerProcessingTime, keyTriggerType}
2324

24-
class TestStreamWriterUtil extends FlatSpec with Matchers with MockitoSugar {
25+
class TestStreamWriterUtil extends AnyFlatSpec with Matchers with MockitoSugar {
2526

2627
behavior of s"StreamWriterUtil"
2728

compatibility_spark-3/src/test/scala/za/co/absa/hyperdrive/compatibility/impl/writer/cdc/CDCTestBase.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ package za.co.absa.hyperdrive.compatibility.impl.writer.cdc
1717

1818
import org.apache.spark.sql.SparkSession
1919
import org.apache.spark.sql.execution.streaming.MemoryStream
20-
import org.scalatest.{BeforeAndAfterEach, FlatSpec}
20+
import org.scalatest.BeforeAndAfterEach
21+
import org.scalatest.flatspec.AnyFlatSpec
2122
import za.co.absa.commons.io.TempDirectory
2223

2324
trait CDCTestBase extends BeforeAndAfterEach {
24-
this: FlatSpec =>
25+
this: AnyFlatSpec =>
2526

2627
implicit val spark: SparkSession = SparkSession.builder()
2728
.master("local[*]")

compatibility_spark-3/src/test/scala/za/co/absa/hyperdrive/compatibility/impl/writer/cdc/TestCDCUtil.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
package za.co.absa.hyperdrive.compatibility.impl.writer.cdc
1717

1818
import org.apache.spark.sql.{DataFrame, Row}
19-
import org.scalatest.mockito.MockitoSugar
20-
import org.scalatest.{FlatSpec, Matchers}
19+
import org.scalatestplus.mockito.MockitoSugar
20+
import org.scalatest.flatspec.AnyFlatSpec
21+
import org.scalatest.matchers.should.Matchers
2122

2223
import java.io.File
2324
import java.sql.Timestamp
2425

25-
class TestCDCUtil extends FlatSpec with MockitoSugar with Matchers with CDCTestBase {
26+
class TestCDCUtil extends AnyFlatSpec with MockitoSugar with Matchers with CDCTestBase {
2627

2728
import spark.implicits._
2829

compatibility_spark-3/src/test/scala/za/co/absa/hyperdrive/compatibility/impl/writer/cdc/delta/TestDeltaUtil.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
package za.co.absa.hyperdrive.compatibility.impl.writer.cdc.delta
1717

1818
import org.apache.spark.sql.types.{StringType, StructField, StructType}
19-
import org.scalatest.{FlatSpec, Matchers}
20-
import org.scalatest.mockito.MockitoSugar
19+
import org.scalatest.flatspec.AnyFlatSpec
20+
import org.scalatest.matchers.should.Matchers
21+
import org.scalatestplus.mockito.MockitoSugar
2122
import za.co.absa.hyperdrive.compatibility.impl.writer.cdc.{CDCTestBase, FileUtils}
2223

2324
import java.io.File
2425

25-
class TestDeltaUtil extends FlatSpec with MockitoSugar with Matchers with CDCTestBase {
26+
class TestDeltaUtil extends AnyFlatSpec with MockitoSugar with Matchers with CDCTestBase {
2627
behavior of "DeltaUtil"
2728

2829
"createDeltaTableIfNotExists" should "create delta table if destination directory is empty" in {

compatibility_spark-3/src/test/scala/za/co/absa/hyperdrive/compatibility/impl/writer/cdc/delta/scd2/TestDeltaCDCToSCD2Writer.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
*/
1515

1616
package za.co.absa.hyperdrive.compatibility.impl.writer.cdc.delta.scd2
17-
17+
import org.scalatest.flatspec.AnyFlatSpec
18+
import org.scalatest.matchers.should.Matchers
1819
import org.apache.spark.sql.streaming.Trigger
19-
import org.scalatest.mockito.MockitoSugar
20-
import org.scalatest.{FlatSpec, Matchers}
20+
import org.scalatestplus.mockito.MockitoSugar
2121
import za.co.absa.hyperdrive.compatibility.impl.writer.cdc.{CDCEvent, CDCTestBase, SCD2Event}
2222

23-
class TestDeltaCDCToSCD2Writer extends FlatSpec with MockitoSugar with Matchers with CDCTestBase {
23+
class TestDeltaCDCToSCD2Writer extends AnyFlatSpec with MockitoSugar with Matchers with CDCTestBase {
2424
behavior of "DeltaCDCToSCD2Writer"
2525

2626
it should "merge unique by timestamp scd2 rows into empty delta table" in {

compatibility_spark-3/src/test/scala/za/co/absa/hyperdrive/compatibility/impl/writer/cdc/delta/snapshot/TestDeltaCDCToSnapshotWriter.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
package za.co.absa.hyperdrive.compatibility.impl.writer.cdc.delta.snapshot
1717

1818
import org.apache.spark.sql.streaming.Trigger
19-
import org.scalatest.mockito.MockitoSugar
20-
import org.scalatest.{FlatSpec, Matchers}
19+
import org.scalatestplus.mockito.MockitoSugar
20+
import org.scalatest.flatspec.AnyFlatSpec
21+
import org.scalatest.matchers.should.Matchers
2122
import za.co.absa.hyperdrive.compatibility.impl.writer.cdc.{CDCEvent, CDCTestBase}
2223

23-
class TestDeltaCDCToSnapshotWriter extends FlatSpec with MockitoSugar with Matchers with CDCTestBase {
24+
class TestDeltaCDCToSnapshotWriter extends AnyFlatSpec with MockitoSugar with Matchers with CDCTestBase {
2425
behavior of "DeltaCDCToSnapshotWriter"
2526

2627
it should "merge cdc events and create latest snapshot table" in {

compatibility_spark-3/src/test/scala/za/co/absa/hyperdrive/compatibility/impl/writer/cdc/hudi/scd2/TestHudiCDCToSCD2Writer.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
package za.co.absa.hyperdrive.compatibility.impl.writer.cdc.hudi.scd2
1717

1818
import org.apache.spark.sql.streaming.Trigger
19-
import org.scalatest.mockito.MockitoSugar
20-
import org.scalatest.{FlatSpec, Matchers}
19+
import org.scalatestplus.mockito.MockitoSugar
20+
import org.scalatest.flatspec.AnyFlatSpec
21+
import org.scalatest.matchers.should.Matchers
2122
import za.co.absa.hyperdrive.compatibility.impl.writer.cdc.{CDCEvent, CDCTestBase, SCD2Event}
2223

23-
class TestHudiCDCToSCD2Writer extends FlatSpec with MockitoSugar with Matchers with CDCTestBase {
24+
class TestHudiCDCToSCD2Writer extends AnyFlatSpec with MockitoSugar with Matchers with CDCTestBase {
2425
behavior of "HudiCDCToSCD2Writer"
2526

2627
it should "merge unique by timestamp scd2 rows into empty hudi table" in {

0 commit comments

Comments
 (0)