Skip to content

Commit

Permalink
Scala update scala test to 3.2.9
Browse files Browse the repository at this point in the history
JAVA-4181
  • Loading branch information
jtjeferreira authored and rozza committed Apr 12, 2022
1 parent af39665 commit 8977afa
Show file tree
Hide file tree
Showing 19 changed files with 10 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
package org.mongodb.scala.bson

import org.junit.runner.RunWith
import org.scalatest.{ FlatSpec, Matchers }
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
abstract class BaseSpec extends FlatSpec with Matchers {}
abstract class BaseSpec extends AnyFlatSpec with Matchers {}
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ configure(scalaProjects) {
testImplementation(platform("org.junit:junit-bom:$junitBomVersion"))
testImplementation("org.junit.vintage:junit-vintage-engine")

testImplementation('org.scalatest:scalatest_%%:3.0.8')
testImplementation('org.scalatest:scalatest-flatspec_%%:3.2.9')
testImplementation('org.scalatest:scalatest-shouldmatchers_%%:3.2.9')
testImplementation('org.scalatestplus:junit-4-13_%%:3.2.9.0')
testImplementation('org.scalamock:scalamock_%%:4.4.0')
testImplementation('ch.qos.logback:logback-classic:1.1.3')
testImplementation('org.reflections:reflections:0.9.10')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import java.util.concurrent.TimeUnit
import com.mongodb.reactivestreams.client.AggregatePublisher
import org.mongodb.scala.model.Collation
import org.scalamock.scalatest.proxy.MockFactory
import org.scalatest.{ FlatSpec, Matchers }

import scala.concurrent.duration.Duration

Expand Down
5 changes: 3 additions & 2 deletions driver-scala/src/test/scala/org/mongodb/scala/BaseSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
*/
package org.mongodb.scala

import org.scalatest.{ FlatSpec, Matchers }
import org.junit.runner.RunWith
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
abstract class BaseSpec extends FlatSpec with Matchers {}
abstract class BaseSpec extends AnyFlatSpec with Matchers {}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ import org.mongodb.scala.model.Collation
import org.mongodb.scala.model.changestream.FullDocument
import org.reactivestreams.Publisher
import org.scalamock.scalatest.proxy.MockFactory
import org.scalatest.{ FlatSpec, Matchers }

import scala.concurrent.duration.Duration
import scala.util.{ Failure, Success }
import scala.util.{ Success }

class ChangeStreamObservableSpec extends BaseSpec with MockFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ package org.mongodb.scala

import java.lang.reflect.Modifier.isStatic

import scala.collection.JavaConverters._

import org.scalatest.{ FlatSpec, Matchers }

class CreateIndexCommitQuorumSpec extends BaseSpec {

"CreateIndexCommitQuorum" should "have the same methods as the wrapped CreateIndexCommitQuorum" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import com.mongodb.reactivestreams.client.DistinctPublisher
import org.mongodb.scala.model.Collation
import org.reactivestreams.Publisher
import org.scalamock.scalatest.proxy.MockFactory
import org.scalatest.{ FlatSpec, Matchers }

import scala.concurrent.duration.Duration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import java.util.concurrent.TimeUnit
import com.mongodb.reactivestreams.client.ListCollectionsPublisher
import org.reactivestreams.Publisher
import org.scalamock.scalatest.proxy.MockFactory
import org.scalatest.{ FlatSpec, Matchers }

import scala.concurrent.duration.Duration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import java.util.concurrent.TimeUnit
import com.mongodb.reactivestreams.client.ListDatabasesPublisher
import org.reactivestreams.Publisher
import org.scalamock.scalatest.proxy.MockFactory
import org.scalatest.{ FlatSpec, Matchers }

import scala.concurrent.duration.Duration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import java.util.concurrent.TimeUnit
import com.mongodb.reactivestreams.client.ListIndexesPublisher
import org.reactivestreams.Publisher
import org.scalamock.scalatest.proxy.MockFactory
import org.scalatest.{ FlatSpec, Matchers }

import scala.concurrent.duration.Duration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.mongodb.client.model.MapReduceAction
import com.mongodb.reactivestreams.client.MapReducePublisher
import org.mongodb.scala.model.Collation
import org.scalamock.scalatest.proxy.MockFactory
import org.scalatest.{ FlatSpec, Matchers }

import scala.concurrent.duration.Duration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import org.mongodb.scala.MongoClient.DEFAULT_CODEC_REGISTRY
import org.mongodb.scala.bson.codecs.DocumentCodecProvider
import org.mongodb.scala.connection.ConnectionPoolSettings.Builder
import org.scalamock.scalatest.proxy.MockFactory
import org.scalatest.{ FlatSpec, Matchers }
import org.mongodb.scala.connection._

class MongoClientSettingsSpec extends BaseSpec with MockFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import org.bson.codecs.BsonValueCodecProvider
import org.bson.codecs.configuration.CodecRegistries.fromProviders
import org.mongodb.scala.model._
import org.scalamock.scalatest.proxy.MockFactory
import org.scalatest.{ FlatSpec, Matchers }

import scala.collection.JavaConverters._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.mongodb.scala

import com.mongodb.{ MongoCredential => JMongoCredential }
import org.scalatest.{ FlatSpec, Matchers }

class MongoCredentialSpec extends BaseSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import com.mongodb.reactivestreams.client.{ ListCollectionsPublisher, MongoDatab
import org.mongodb.scala.bson.conversions.Bson
import org.mongodb.scala.model._
import org.scalamock.scalatest.proxy.MockFactory
import org.scalatest.{ FlatSpec, Matchers }

class MongoDatabaseSpec extends BaseSpec with MockFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ package org.mongodb.scala

import java.lang.reflect.Modifier.isStatic

import org.scalatest.{ FlatSpec, Matchers }

class MongoDriverInformationSpec extends BaseSpec {

"MongoDriverInformation" should "have the same static fields as the wrapped MongoDriverInformation" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import java.lang.reflect.Modifier._
import scala.util.{ Success, Try }

import org.scalatest.prop.TableDrivenPropertyChecks._
import org.scalatest.{ FlatSpec, Matchers }

class ReadConcernLevelSpec extends BaseSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import java.lang.reflect.Modifier._
import com.mongodb.{ ReadConcern => JReadConcern }

import org.scalatest.prop.TableDrivenPropertyChecks._
import org.scalatest.{ FlatSpec, Matchers }

class ReadConcernSpec extends BaseSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import java.util.concurrent.TimeUnit.SECONDS
import scala.collection.JavaConverters._
import scala.concurrent.duration.Duration

import org.scalatest.{ FlatSpec, Matchers }

class ReadPreferenceSpec extends BaseSpec {

val duration = Duration("95 sec")
Expand Down

0 comments on commit 8977afa

Please sign in to comment.