Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.springframework.aot.hint.TypeReference;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
import static org.springframework.aot.hint.predicate.RuntimeHintsPredicates.reflection;
import static org.springframework.aot.hint.predicate.RuntimeHintsPredicates.resource;

Expand Down Expand Up @@ -209,4 +210,11 @@ void verifyEnumTypesInAzurePackageAreRegistered() {
assertThat(hasEnumTypes).as("Azure OpenAI enum types should be registered").isTrue();
}

@Test
void registerHintsWithNullRuntimeHints() {
// Should throw when RuntimeHints is null
assertThatThrownBy(() -> this.azureOpenAiRuntimeHints.registerHints(null, null))
.isInstanceOf(NullPointerException.class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.springframework.core.io.DefaultResourceLoader;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

/**
* @author Christian Tzolov
Expand Down Expand Up @@ -109,4 +110,12 @@ public void cacheHttpResources() throws IOException {
assertThat(Files.list(Files.list(this.tempDir.toPath()).iterator().next()).count()).isEqualTo(1);
}

@Test
public void shouldHandleNullUri() {
var cache = new ResourceCacheService(this.tempDir);

assertThatThrownBy(() -> cache.getCachedResource((String) null)).isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("Location must not be null");
}

}