-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
In addition to the existing test scenario, it would be beneficial to add a new test case that validates the behavior when the Prompt
is null
. This is because when the messageType
is either MessageType.SYSTEM
or MessageType.USER
, the textContent
parameter cannot be null
, and an IllegalArgumentException
should be thrown in such cases.
Line 50 in 4c83fe8
void call() { |
//This is just a sample using AssertJ
@Test
void ThrowIllegalArgumentExceptionWhenPromptIsNull() {
contextRunner.run(context -> {
AnthropicChatModel chatModel = context.getBean(AnthropicChatModel.class);
assertThatThrownBy(() -> chatModel.call(null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("Content must not be null for SYSTEM or USER messages");
});
}