@@ -8,6 +8,8 @@ import java.io.File
8
8
import java .util .concurrent .atomic .AtomicInteger
9
9
import java .util .{Arrays , Optional }
10
10
11
+ import scala .annotation .nowarn
12
+
11
13
import akka .Done
12
14
import akka .actor .ActorSystem
13
15
import akka .stream .alpakka .solr ._
@@ -26,10 +28,10 @@ import org.apache.solr.common.SolrInputDocument
26
28
import org .junit .Assert .assertTrue
27
29
import org .scalatest .concurrent .ScalaFutures
28
30
import org .scalatest .BeforeAndAfterAll
29
-
30
31
import scala .collection .immutable
31
32
import scala .concurrent .duration ._
32
33
import scala .concurrent .{ExecutionContext , Future }
34
+
33
35
import org .scalatest .matchers .should .Matchers
34
36
import org .scalatest .wordspec .AnyWordSpec
35
37
@@ -365,7 +367,7 @@ class SolrSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with Sca
365
367
val deleteDocuments = SolrSource
366
368
.fromTupleStream(stream2)
367
369
.map { tuple : Tuple =>
368
- val id = tuple.fields .get(" title" ).toString
370
+ val id = tuple.getFields .get(" title" ).toString
369
371
WriteMessage .createDeleteMessage[SolrInputDocument ](id)
370
372
}
371
373
.groupedWithin(5 , 10 .millis)
@@ -421,8 +423,8 @@ class SolrSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with Sca
421
423
val updateCollection = SolrSource
422
424
.fromTupleStream(stream2)
423
425
.map { tuple : Tuple =>
424
- val id = tuple.fields .get(" title" ).toString
425
- val comment = tuple.fields .get(" comment" ).toString
426
+ val id = tuple.getFields .get(" title" ).toString
427
+ val comment = tuple.getFields .get(" comment" ).toString
426
428
WriteMessage .createUpdateMessage[SolrInputDocument ](
427
429
idField = " title" ,
428
430
idValue = id,
@@ -495,7 +497,7 @@ class SolrSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with Sca
495
497
val deleteElements = SolrSource
496
498
.fromTupleStream(stream2)
497
499
.map { tuple : Tuple =>
498
- val title = tuple.fields .get(" title" ).toString
500
+ val title = tuple.getFields .get(" title" ).toString
499
501
WriteMessage .createDeleteMessage[Book ](title)
500
502
}
501
503
.groupedWithin(5 , 10 .millis)
@@ -554,8 +556,8 @@ class SolrSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with Sca
554
556
WriteMessage
555
557
.createUpdateMessage[Book ](
556
558
idField = " title" ,
557
- tuple.fields .get(" title" ).toString,
558
- updates = Map (" comment" -> Map (" set" -> (s " ${tuple.fields .get(" comment" )} It is a good book!!! " )))
559
+ tuple.getFields .get(" title" ).toString,
560
+ updates = Map (" comment" -> Map (" set" -> (s " ${tuple.getFields .get(" comment" )} It is a good book!!! " )))
559
561
)
560
562
.withRoutingFieldValue(" router-value" )
561
563
}
@@ -623,7 +625,7 @@ class SolrSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with Sca
623
625
val deleteByQuery = SolrSource
624
626
.fromTupleStream(stream2)
625
627
.map { tuple : Tuple =>
626
- val title = tuple.fields .get(" title" ).toString
628
+ val title = tuple.getFields .get(" title" ).toString
627
629
WriteMessage .createDeleteByQueryMessage[SolrInputDocument ](
628
630
s """ title:" $title" """
629
631
)
@@ -746,6 +748,7 @@ class SolrSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with Sca
746
748
TestKit .shutdownActorSystem(system)
747
749
}
748
750
751
+ @ nowarn(" msg=deprecated" ) // FIXME #2917 Deprecated getIdField in Solrj 8.11.x
749
752
private def setupCluster (): Unit = {
750
753
val targetDir = new File (" solr/target" )
751
754
val testWorkingDir =
@@ -755,7 +758,7 @@ class SolrSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with Sca
755
758
756
759
val confDir = new File (" solr/src/test/resources/conf" )
757
760
758
- val zkDir = testWorkingDir.toPath.resolve(" zookeeper/server/data" ).toString
761
+ val zkDir = testWorkingDir.toPath.resolve(" zookeeper/server/data" )
759
762
zkTestServer = new ZkTestServer (zkDir, zookeeperPort)
760
763
zkTestServer.run()
761
764
0 commit comments