Fixing miscellaneous checkstyle errors

Enabling checkstyle by default in the project build

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
This commit is contained in:
Soby Chacko
2025-05-14 20:34:27 -04:00
committed by Ilayaperumal Gopinathan
parent 31feb4319b
commit 368be3a04f
218 changed files with 1281 additions and 1080 deletions

View File

@@ -16,16 +16,17 @@
package org.springframework.ai.vectorstore.observation;
import java.util.List;
import io.micrometer.observation.Observation;
import io.micrometer.observation.ObservationHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.document.Document;
import org.springframework.ai.observation.ObservabilityHelper;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
* Handler for emitting the query response content to logs.
*

View File

@@ -16,17 +16,18 @@
package org.springframework.ai.vectorstore.observation;
import java.util.List;
import io.micrometer.common.KeyValue;
import io.micrometer.observation.Observation;
import org.junit.jupiter.api.Test;
import org.springframework.ai.document.Document;
import org.springframework.ai.observation.conventions.SpringAiKind;
import org.springframework.ai.vectorstore.SearchRequest;
import org.springframework.ai.vectorstore.observation.VectorStoreObservationDocumentation.HighCardinalityKeyNames;
import org.springframework.ai.vectorstore.observation.VectorStoreObservationDocumentation.LowCardinalityKeyNames;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
/**

View File

@@ -16,15 +16,16 @@
package org.springframework.ai.vectorstore.observation;
import java.util.List;
import io.micrometer.observation.Observation;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.ai.document.Document;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
/**
@@ -54,7 +55,7 @@ class VectorStoreQueryResponseObservationHandlerTests {
@Test
void whenEmptyQueryResponseThenOutputNothing(CapturedOutput output) {
var context = VectorStoreObservationContext.builder("db", VectorStoreObservationContext.Operation.ADD).build();
observationHandler.onStop(context);
this.observationHandler.onStop(context);
assertThat(output).contains("""
Vector Store Query Response:
[]
@@ -65,7 +66,7 @@ class VectorStoreQueryResponseObservationHandlerTests {
void whenNonEmptyQueryResponseThenOutputIt(CapturedOutput output) {
var context = VectorStoreObservationContext.builder("db", VectorStoreObservationContext.Operation.ADD).build();
context.setQueryResponse(List.of(new Document("doc1"), new Document("doc2")));
observationHandler.onStop(context);
this.observationHandler.onStop(context);
assertThat(output).contains("""
Vector Store Query Response:
["doc1", "doc2"]