Scala: Help me manually create StreamingQueryListener.QueryProgressEvent object from JSON string for unit testing

Job ID: 34000604

Budget: $10 – $30 USD

Scala: Help me manually create QueryProgressEvent.StreamingqueryProgress object for unit testing
Documentation: https://spark.apache.org/docs/latest/api/java/org/apache/spark/sql/streaming/StreamingQueryListener.QueryProgressEvent.html

This is the partial code I'm looking to unit test, in the queryProgressEvent, I'm attempting to manually create the object to pass through to SQSLagQueryListener.onQueryProgress(queryProgressEvent):
object SQSLagQueryListener {
def main(args:Array[String]): Unit = {

val testt = SQSLagQueryListener.build("test")
val queryProgressEvent = new QueryProgressEvent(
new StreamingQueryProgress(
"123",
"123",
null,
"est",
"test",
2L,
Map("total" -> 0L),
Map.empty[String, String],
null,
//Array(new SourceProgress("source", "123", "456", 678, Double.NaN, Double.NegativeInfinity)),
JArray(sources.map(_.jsonValue).toList)),
new SinkProgress("sink")
)
testt.onQueryProgress(queryProgressEvent)
}

def build(consumerGroupId: String): StreamingQueryListener = {
new SQSLagQueryListener(true, consumerGroupId)
}


class SQSLagQueryListener(isSQSMetricPublishingEnabled: Boolean, consumerGroupId: String) extends StreamingQueryListener {

override def onQueryStarted(event: StreamingQueryListener.QueryStartedEvent): Unit = {}

override def onQueryProgress(event: StreamingQueryListener.QueryProgressEvent): Unit = {
event.progress.sources
// Ignoring kafka / jms sources their offsets
.filter(source => source.description.toLowerCase().contains("sqs"))
.foreach(source => {
------------------


This is the json I'm looking to pass through:
"progress" : {
"id" : "123123123abc",
"runId" : "123123123daasdff",
"name" : null,
"timestamp" : "2022-06-24T18:08:16.126Z",
"batchId" : 0,
"numInputRows" : 183996,
"processedRowsPerSecond" : 1554.2696885479932,
"durationMs" : {
"addBatch" : 106863,
"getBatch" : 9,
"getEndOffset" : 4,
"queryPlanning" : 967,
"setOffsetRange" : 10384,
"triggerExecution" : 118380,
"walCommit" : 53
},
"stateOperators" : [ ],
"sources" : [ {
"description" : "SQS Structured Reader - offline-model-score-prd",
"startOffset" : null,
"endOffset" : 1477,
"numInputRows" : 2956,
"processedRowsPerSecond" : 24.970223262178898
}, {
"description" : "SQS Structured Reader - prd-chargebacks-queue",
"startOffset" : null,
"endOffset" : -1,
"numInputRows" : 110,
"processedRowsPerSecond" : 0.9292031660486058
}, {
"description" : "SQS Structured Reader - prd-chargebacks-queue",
"startOffset" : null,
"endOffset" : -1,
"numInputRows" : 116,
"processedRowsPerSecond" : 0.9798869751058025
}, {
"description" : "SQS Structured Reader - transaction-featurizer-queue",
"startOffset" : null,
"endOffset" : 9999,
"numInputRows" : 20002,
"processedRowsPerSecond" : 168.96292479367466
}, {
"description" : "JMS Structured Reader - Subscriber.global.featurizer.globalvirtual.prd.payments.account.AccountChangeV2.Virtual",
"startOffset" : null,
"endOffset" : 393,
"numInputRows" : 790,
"processedRowsPerSecond" : 6.673368192530896
}
}]

Please help me create the object and make sure the unit testing works. We'll do this via Zoom, and you can take control & guide me through this.