Skip to content

Commit

Permalink
fix: scala 2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
QuadStingray committed Feb 5, 2025
1 parent 2a32bad commit d1ce373
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class MongoJdbcConnection(databaseProvider: DatabaseProvider) extends Connection
override def getClientInfo: Properties = {
val properties = new Properties()
properties.setProperty("ApplicationName", databaseProvider.config.applicationName)
val document = Document(JsonConverter().toJson(databaseProvider.config))
val document = Document(new JsonConverter().toJson(databaseProvider.config))
BsonConverter.asMap(document).foreach(entry => properties.setProperty(entry._1, entry._2.toString))
properties
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dev.mongocamp.driver.mongodb.jdbc

import dev.mongocamp.driver.mongodb.*
import dev.mongocamp.driver.mongodb._
import dev.mongocamp.driver.mongodb.jdbc.statement.MongoPreparedStatement

import java.sql.{Connection, DriverManager, SQLFeatureNotSupportedException, SQLWarning, Savepoint}
import java.sql.{ Connection, SQLFeatureNotSupportedException, Savepoint }
import java.util.Properties
import java.util.concurrent.Executor

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package dev.mongocamp.driver.mongodb.jdbc

import dev.mongocamp.driver.mongodb._
import dev.mongocamp.driver.mongodb.jdbc.resultSet.MongoDbResultSet
import munit.FunSuite
import org.joda.time.DateTime
import org.mongodb.scala.bson.collection.immutable.Document
import dev.mongocamp.driver.mongodb.*
import org.mongodb.scala.model.Updates

import java.sql.{Date, ResultSet, SQLFeatureNotSupportedException, Time, Timestamp}
import java.sql.{ResultSet, SQLFeatureNotSupportedException, Time}

class MongoDbResultSetSuite extends BaseJdbcSuite {

Expand Down Expand Up @@ -68,7 +67,7 @@ class MongoDbResultSetSuite extends BaseJdbcSuite {
test("getTime() should return the correct value") {
val resultSet = initializeResultSet()
resultSet.next()
assertEquals(resultSet.getTime("date").toString, new DateTime("2021-01-01T00:00:00Z").toString("HH:mm:ss"))
assertEquals(resultSet.getTime("date"), new Time(new DateTime("2021-01-01T00:00:00Z").toDate.getTime))
}

test("getTimestamp() should return the correct value") {
Expand Down

0 comments on commit d1ce373

Please sign in to comment.