Skip to content

Commit c7cad81

Browse files
Upgrade to next version ABRiS (#244)
1 parent 115b729 commit c7cad81

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

ingestor-default/src/test/scala/za/co/absa/hyperdrive/ingestor/implementation/transformer/avro/confluent/TestConfluentAvroDecodingTransformer.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import org.apache.spark.sql.{DataFrame, Row}
2828
import org.scalatest.{BeforeAndAfter, FlatSpec, Matchers}
2929
import za.co.absa.abris.avro.parsing.utils.AvroSchemaUtils
3030
import za.co.absa.abris.avro.read.confluent.SchemaManagerFactory
31+
import za.co.absa.abris.avro.registry.ConfluentMockRegistryClient
3132
import za.co.absa.abris.config.AbrisConfig
3233
import za.co.absa.commons.spark.SparkTestBase
3334
import za.co.absa.hyperdrive.ingestor.implementation.reader.kafka.KafkaStreamReader.KEY_TOPIC
@@ -78,8 +79,10 @@ class TestConfluentAvroDecodingTransformer extends FlatSpec with Matchers with B
7879

7980
before {
8081
MockSchemaRegistryClient = new MockSchemaRegistryClient()
82+
8183
SchemaManagerFactory.resetSRClientInstance()
82-
SchemaManagerFactory.addSRClientInstance(Map(AbrisConfig.SCHEMA_REGISTRY_URL -> SchemaRegistryURL), MockSchemaRegistryClient)
84+
SchemaManagerFactory.addSRClientInstance(Map(AbrisConfig.SCHEMA_REGISTRY_URL -> SchemaRegistryURL),
85+
new ConfluentMockRegistryClient(MockSchemaRegistryClient))
8386
}
8487

8588
"transform" should "decode the value-dataframe" in {

ingestor-default/src/test/scala/za/co/absa/hyperdrive/ingestor/implementation/transformer/avro/confluent/TestConfluentAvroEncodingTransformer.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler
2121
import org.apache.spark.sql.Row
2222
import org.apache.spark.sql.catalyst.encoders.RowEncoder
2323
import org.apache.spark.sql.execution.streaming.MemoryStream
24-
import org.apache.spark.sql.functions.{array, lit, map, struct}
2524
import org.apache.spark.sql.streaming.Trigger
26-
import org.apache.spark.sql.types.{BooleanType, IntegerType, StringType, StructField, StructType}
25+
import org.apache.spark.sql.types.{IntegerType, StringType, StructField, StructType}
2726
import org.scalatest.{BeforeAndAfter, FlatSpec, Matchers}
2827
import za.co.absa.abris.avro.parsing.utils.AvroSchemaUtils
2928
import za.co.absa.abris.avro.read.confluent.SchemaManagerFactory
29+
import za.co.absa.abris.avro.registry.ConfluentMockRegistryClient
3030
import za.co.absa.abris.config.AbrisConfig
3131
import za.co.absa.commons.spark.SparkTestBase
3232
import za.co.absa.hyperdrive.ingestor.api.context.HyperdriveContext
@@ -46,7 +46,8 @@ class TestConfluentAvroEncodingTransformer extends FlatSpec with Matchers with B
4646
before {
4747
mockSchemaRegistryClient = new HyperdriveMockSchemaRegistryClient()
4848
SchemaManagerFactory.resetSRClientInstance()
49-
SchemaManagerFactory.addSRClientInstance(Map(AbrisConfig.SCHEMA_REGISTRY_URL -> SchemaRegistryURL), mockSchemaRegistryClient)
49+
SchemaManagerFactory.addSRClientInstance(Map(AbrisConfig.SCHEMA_REGISTRY_URL -> SchemaRegistryURL),
50+
new ConfluentMockRegistryClient(mockSchemaRegistryClient))
5051
}
5152

5253
it should "create avro stream encoder" in {

ingestor-default/src/test/scala/za/co/absa/hyperdrive/ingestor/implementation/utils/TestAbrisConfigUtil.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import org.apache.spark.sql.types.{BooleanType, IntegerType, StringType}
2323
import org.scalatest.{BeforeAndAfter, FlatSpec, Matchers}
2424
import za.co.absa.abris.avro.parsing.utils.AvroSchemaUtils
2525
import za.co.absa.abris.avro.read.confluent.SchemaManagerFactory
26+
import za.co.absa.abris.avro.registry.ConfluentMockRegistryClient
2627
import za.co.absa.abris.config.AbrisConfig
2728
import za.co.absa.hyperdrive.ingestor.implementation.testutils.HyperdriveMockSchemaRegistryClient
2829
import za.co.absa.hyperdrive.ingestor.implementation.testutils.abris.AbrisTestUtil.{getFromSchemaString, getSchemaId, getSchemaRegistryConf}
@@ -81,7 +82,8 @@ class TestAbrisConfigUtil extends FlatSpec with Matchers with BeforeAndAfter {
8182
before {
8283
mockSchemaRegistryClient = new HyperdriveMockSchemaRegistryClient()
8384
SchemaManagerFactory.resetSRClientInstance()
84-
SchemaManagerFactory.addSRClientInstance(Map(AbrisConfig.SCHEMA_REGISTRY_URL -> dummySchemaRegistryUrl), mockSchemaRegistryClient)
85+
SchemaManagerFactory.addSRClientInstance(Map(AbrisConfig.SCHEMA_REGISTRY_URL -> dummySchemaRegistryUrl),
86+
new ConfluentMockRegistryClient(mockSchemaRegistryClient))
8587
}
8688

8789
"generateSchema" should "generate a schema with topic name strategy" in {

parent-conf/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
4949

5050
<!--ABRiS-->
51-
<abris.version>4.2.0</abris.version>
51+
<abris.version>5.0.0</abris.version>
5252

5353
<!--Scala-->
5454
<scalatest.version>3.0.5</scalatest.version>

0 commit comments

Comments
 (0)