Skip to content

Commit e0f041e

Browse files
Replace jetbrains NotNull
Signed-off-by: Tran Ngoc Nhan <[email protected]>
1 parent aee1459 commit e0f041e

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

auto-configurations/models/spring-ai-autoconfigure-model-openai/src/main/java/org/springframework/ai/model/openai/autoconfigure/OpenAIAutoConfigurationUtil.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
import java.util.List;
2121
import java.util.Map;
2222

23-
import org.jetbrains.annotations.NotNull;
24-
23+
import org.springframework.lang.NonNull;
2524
import org.springframework.util.Assert;
2625
import org.springframework.util.CollectionUtils;
2726
import org.springframework.util.MultiValueMap;
@@ -33,7 +32,7 @@ private OpenAIAutoConfigurationUtil() {
3332
// Avoids instantiation
3433
}
3534

36-
public static @NotNull ResolvedConnectionProperties resolveConnectionProperties(
35+
public static @NonNull ResolvedConnectionProperties resolveConnectionProperties(
3736
OpenAiParentProperties commonProperties, OpenAiParentProperties modelProperties, String modelType) {
3837

3938
String baseUrl = StringUtils.hasText(modelProperties.getBaseUrl()) ? modelProperties.getBaseUrl()

models/spring-ai-vertex-ai-gemini/src/test/java/org/springframework/ai/vertexai/gemini/VertexAiGeminiChatModelIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
2626
import com.google.cloud.vertexai.Transport;
2727
import com.google.cloud.vertexai.VertexAI;
2828
import io.micrometer.observation.ObservationRegistry;
29-
import org.jetbrains.annotations.NotNull;
3029
import org.junit.jupiter.api.Disabled;
3130
import org.junit.jupiter.api.Test;
3231
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
@@ -56,6 +55,7 @@
5655
import org.springframework.core.convert.support.DefaultConversionService;
5756
import org.springframework.core.io.ClassPathResource;
5857
import org.springframework.core.io.Resource;
58+
import org.springframework.lang.NonNull;
5959
import org.springframework.util.MimeType;
6060
import org.springframework.util.MimeTypeUtils;
6161

@@ -130,7 +130,7 @@ void testSafetySettings() {
130130
assertThat(response.getResult().getMetadata().getFinishReason()).isEqualTo("SAFETY");
131131
}
132132

133-
@NotNull
133+
@NonNull
134134
private Prompt createPrompt(VertexAiGeminiChatOptions chatOptions) {
135135
String request = "Tell me about 3 famous pirates from the Golden Age of Piracy and why they did.";
136136
String name = "Bob";

vector-stores/spring-ai-pgvector-store/src/test/java/org/springframework/ai/vectorstore/pgvector/PgVectorStoreWithChatMemoryAdvisorIT.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 the original author or authors.
2+
* Copyright 2023-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
2020
import java.util.Map;
2121
import java.util.UUID;
2222

23-
import org.jetbrains.annotations.NotNull;
2423
import org.junit.jupiter.api.DisplayName;
2524
import org.junit.jupiter.api.Test;
2625
import org.mockito.ArgumentCaptor;
@@ -45,6 +44,7 @@
4544
import org.springframework.ai.embedding.EmbeddingModel;
4645
import org.springframework.ai.vectorstore.SearchRequest;
4746
import org.springframework.jdbc.core.JdbcTemplate;
47+
import org.springframework.lang.NonNull;
4848

4949
import static org.assertj.core.api.Assertions.assertThat;
5050
import static org.mockito.ArgumentMatchers.any;
@@ -68,7 +68,7 @@ class PgVectorStoreWithChatMemoryAdvisorIT {
6868

6969
float[] embed = { 0.003961659F, -0.0073295482F, 0.02663665F };
7070

71-
private static @NotNull ChatModel chatModelAlwaysReturnsTheSameReply() {
71+
private static @NonNull ChatModel chatModelAlwaysReturnsTheSameReply() {
7272
ChatModel chatModel = mock(ChatModel.class);
7373
ArgumentCaptor<Prompt> argumentCaptor = ArgumentCaptor.forClass(Prompt.class);
7474
ChatResponse chatResponse = new ChatResponse(List.of(new Generation(new AssistantMessage("""
@@ -95,7 +95,7 @@ private static PgVectorStore createPgVectorStoreUsingTestcontainer(EmbeddingMode
9595
.build();
9696
}
9797

98-
private static @NotNull JdbcTemplate createJdbcTemplateWithConnectionToTestcontainer() {
98+
private static @NonNull JdbcTemplate createJdbcTemplateWithConnectionToTestcontainer() {
9999
PGSimpleDataSource ds = new PGSimpleDataSource();
100100
ds.setUrl("jdbc:postgresql://localhost:" + postgresContainer.getMappedPort(5432) + "/postgres");
101101
ds.setUser(postgresContainer.getUsername());
@@ -123,7 +123,7 @@ private static void verifyRequestHasBeenAdvisedWithMessagesFromVectorStore(ChatM
123123
* Create a mock ChatModel that supports streaming responses for testing.
124124
* @return A mock ChatModel that returns a predefined streaming response
125125
*/
126-
private static @NotNull ChatModel chatModelWithStreamingSupport() {
126+
private static @NonNull ChatModel chatModelWithStreamingSupport() {
127127
ChatModel chatModel = mock(ChatModel.class);
128128

129129
// Mock the regular call method
@@ -158,7 +158,7 @@ private static void verifyRequestHasBeenAdvisedWithMessagesFromVectorStore(ChatM
158158
* VectorStoreChatMemoryAdvisor.
159159
* @return A mock ChatModel that returns a problematic streaming response
160160
*/
161-
private static @NotNull ChatModel chatModelWithProblematicStreamingBehavior() {
161+
private static @NonNull ChatModel chatModelWithProblematicStreamingBehavior() {
162162
ChatModel chatModel = mock(ChatModel.class);
163163

164164
// Mock the regular call method
@@ -390,7 +390,7 @@ private Throwable getRootCause(Throwable throwable) {
390390
}
391391

392392
@SuppressWarnings("unchecked")
393-
private @NotNull EmbeddingModel embeddingNModelShouldAlwaysReturnFakedEmbed() {
393+
private @NonNull EmbeddingModel embeddingNModelShouldAlwaysReturnFakedEmbed() {
394394
EmbeddingModel embeddingModel = mock(EmbeddingModel.class);
395395

396396
Mockito.doAnswer(invocationOnMock -> List.of(this.embed, this.embed))

0 commit comments

Comments
 (0)