Skip to content

Commit bbd7bde

Browse files
misselvexugemini-code-assist[bot]
authored andcommitted
Update sdk-server-common/src/test/java/io/a2a/server/tasks/TaskManagerTest.java
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 7bcd9bc commit bbd7bde

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

server-common/src/test/java/io/a2a/server/tasks/TaskManagerTest.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -512,21 +512,8 @@ public void testMultipleArtifactsWithDifferentArtifactIds() throws A2AServerExce
512512
assertEquals(2, updatedTask.getArtifacts().size());
513513

514514
// Verify both artifacts are present
515-
List<Artifact> artifacts = updatedTask.getArtifacts();
516-
boolean foundArtifact1 = false;
517-
boolean foundArtifact2 = false;
518-
519-
for (Artifact artifact : artifacts) {
520-
if ("artifact-id-1".equals(artifact.artifactId())) {
521-
foundArtifact1 = true;
522-
assertEquals("content 1", ((TextPart) artifact.parts().get(0)).getText());
523-
} else if ("artifact-id-2".equals(artifact.artifactId())) {
524-
foundArtifact2 = true;
525-
assertEquals("content 2", ((TextPart) artifact.parts().get(0)).getText());
526-
}
527-
}
528-
529-
assertTrue(foundArtifact1, "Artifact 1 should be present");
530-
assertTrue(foundArtifact2, "Artifact 2 should be present");
515+
List<Artifact> artifacts = updatedTask.getArtifacts();
516+
assertTrue(artifacts.stream().anyMatch(a -> "artifact-id-1".equals(a.artifactId()) && "content 1".equals(((TextPart) a.parts().get(0)).getText())), "Artifact 1 should be present");
517+
assertTrue(artifacts.stream().anyMatch(a -> "artifact-id-2".equals(a.artifactId()) && "content 2".equals(((TextPart) a.parts().get(0)).getText())), "Artifact 2 should be present");
531518
}
532519
}

0 commit comments

Comments
 (0)