File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed
server-common/src/test/java/io/a2a/server/tasks Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments