From 0973ffa9899f66612a7c828d05c237d63d092b25 Mon Sep 17 00:00:00 2001 From: Kevin Mas Ruiz Date: Thu, 23 May 2024 17:54:48 +0200 Subject: [PATCH] chore: fix test, we are not using a data class anymore --- .github/workflows/quality-check.yaml | 5 +---- .../com/mongodb/jbplugin/accessadapter/MongoDbDriver.kt | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/quality-check.yaml b/.github/workflows/quality-check.yaml index 35e9b59c..cca38767 100644 --- a/.github/workflows/quality-check.yaml +++ b/.github/workflows/quality-check.yaml @@ -120,15 +120,12 @@ jobs: sudo apt install -y docker docker-compose - name: Run Test Suite run: | - ./gradlew --stacktrace --console=plain "clean" "cleanTest" "unitTest" + ./gradlew --stacktrace --console=plain "clean" "cleanTest" "unitTest" "jacocoTestReport" -x "packages:jetbrains-plugin:uiTest" - name: Publish Test Report uses: mikepenz/action-junit-report@v4 if: success() || failure() # always run even if the previous step fails with: report_paths: '**/build/test-results/test/TEST-*.xml' - - name: Generate Coverage Report - run: | - ./gradlew --quiet --console=plain "jacocoTestReport" -x "packages:jetbrains-plugin:uiTest" - uses: actions/upload-artifact@v4 name: Upload Unit Test Coverage with: diff --git a/packages/mongodb-access-adapter/src/main/kotlin/com/mongodb/jbplugin/accessadapter/MongoDbDriver.kt b/packages/mongodb-access-adapter/src/main/kotlin/com/mongodb/jbplugin/accessadapter/MongoDbDriver.kt index d54359dd..bb62e689 100644 --- a/packages/mongodb-access-adapter/src/main/kotlin/com/mongodb/jbplugin/accessadapter/MongoDbDriver.kt +++ b/packages/mongodb-access-adapter/src/main/kotlin/com/mongodb/jbplugin/accessadapter/MongoDbDriver.kt @@ -11,6 +11,7 @@ package com.mongodb.jbplugin.accessadapter import org.bson.Document import org.owasp.encoder.Encode +import java.util.* import kotlin.reflect.KClass import kotlin.time.Duration import kotlin.time.Duration.Companion.seconds @@ -23,6 +24,9 @@ import kotlin.time.Duration.Companion.seconds */ class Namespace private constructor(val database: String, val collection: String) { override fun toString(): String = "$database.$collection" + override fun equals(other: Any?): Boolean = other is Namespace && hashCode() == other.hashCode() + override fun hashCode(): Int = Objects.hash(database, collection) + companion object { operator fun invoke(database: String, collection: String): Namespace = Namespace( Encode.forJavaScript(database),