Skip to content

Commit

Permalink
Add nop slf4j for tests (#28)
Browse files Browse the repository at this point in the history
* Add nop slf4j for tests

This commit adds nop slf4j test dependency, to suppress noProviders warning.

* fix suggestions
  • Loading branch information
russcam authored Apr 15, 2024
1 parent 23cfac0 commit 68729a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jar {
def grpcVersion = '1.59.0'
def protobufVersion = '3.24.0'
def protocVersion = protobufVersion
def slf4jVersion = '2.0.7'
def testcontainersVersion = '1.19.6'
def jUnitVersion = '5.8.1'

Expand All @@ -90,7 +91,7 @@ dependencies {
implementation "io.grpc:grpc-services:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "com.google.guava:guava:30.1-jre"
implementation "org.slf4j:slf4j-api:2.0.7"
implementation "org.slf4j:slf4j-api:${slf4jVersion}"

compileOnly "org.apache.tomcat:annotations-api:6.0.53"
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
Expand All @@ -102,6 +103,7 @@ dependencies {
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${jUnitVersion}"
testImplementation "org.mockito:mockito-core:3.4.0"
testImplementation "org.slf4j:slf4j-nop:${slf4jVersion}"
testImplementation "org.testcontainers:qdrant:${testcontainersVersion}"
testImplementation "org.testcontainers:junit-jupiter:${testcontainersVersion}"

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/io/qdrant/client/QdrantClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2594,7 +2594,7 @@ public ListenableFuture<List<ScoredPoint>> discoverAsync(DiscoverPoints request,
addLogFailureCallback(future, "Discover");
return Futures.transform(
future,
response -> response.getResultList(),
DiscoverResponse::getResultList,
MoreExecutors.directExecutor());
}

Expand Down Expand Up @@ -2644,9 +2644,9 @@ public ListenableFuture<List<BatchResult>> discoverBatchAsync(
ListenableFuture<DiscoverBatchResponse> future = getPoints(timeout).discoverBatch(requestBuilder.build());
addLogFailureCallback(future, "Discover batch");
return Futures.transform(
future,
response -> response.getResultList(),
MoreExecutors.directExecutor());
future,
DiscoverBatchResponse::getResultList,
MoreExecutors.directExecutor());
}

/**
Expand Down

0 comments on commit 68729a5

Please sign in to comment.