Skip to content

Commit 5ea40de

Browse files
test(agent): assert repair failure exception type explicitly (agentic-ai-java#207)
1 parent 548a9e5 commit 5ea40de

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎argi-agent/argi-agent-core/src/test/java/io/github/agentic/ai/agent/react/ReActAgentRepairUsageTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151

5252
import static org.junit.jupiter.api.Assertions.assertAll;
5353
import static org.junit.jupiter.api.Assertions.assertEquals;
54+
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
5455
import static org.junit.jupiter.api.Assertions.assertNull;
5556
import static org.junit.jupiter.api.Assertions.assertThrows;
5657

@@ -119,7 +120,7 @@ void repairedButInvalidRunPublishesMergedUsageBeforeFailing(boolean streamModel)
119120
final RepairClient repair = RepairClient.replying("still not json", REPAIR);
120121
final UsageView view = runExpectingFailure(streamModel, repair);
121122

122-
final AgentExecutionException failure = (AgentExecutionException) view.error;
123+
final AgentExecutionException failure = assertInstanceOf(AgentExecutionException.class, view.error);
123124
assertAll(() -> assertEquals(TOTAL, view.visibleUsage,
124125
"The merged usage must be published before the failure propagates"),
125126
() -> assertEquals(TOTAL, failure.result().usage(), "The thrown result carries the merged total"),

0 commit comments

Comments
 (0)