Skip to content

Commit 7c955fc

Browse files
committed
fix: Test clean up
1 parent 313712f commit 7c955fc

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

tests/server-common/src/test/java/io/a2a/server/apps/common/AbstractA2AServerTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public void testSendMessageNewMessageSuccess() throws Exception {
239239

240240
// testing the non-streaming send message
241241
getNonStreamingClient().sendMessage(message, List.of(consumer), null, null);
242-
242+
243243
assertTrue(latch.await(10, TimeUnit.SECONDS));
244244
assertFalse(wasUnexpectedEvent.get());
245245
Message messageResponse = receivedMessage.get();
@@ -344,7 +344,7 @@ public void testError() throws A2AClientException {
344344

345345
try {
346346
getNonStreamingClient().sendMessage(message, null);
347-
347+
348348
// For non-streaming clients, the error should still be thrown as an exception
349349
fail("Expected A2AClientException for unsupported send message operation");
350350
} catch (A2AClientException e) {
@@ -407,7 +407,7 @@ public void testSendMessageStreamExistingTaskSuccess() throws Exception {
407407
assertTrue(latch.await(10, TimeUnit.SECONDS));
408408
assertFalse(wasUnexpectedEvent.get());
409409
assertNull(errorRef.get());
410-
410+
411411
Message messageResponse = receivedMessage.get();
412412
assertNotNull(messageResponse);
413413
assertEquals(MESSAGE.getMessageId(), messageResponse.getMessageId());
@@ -536,10 +536,10 @@ public void testResubscribeNoExistingTaskError() throws Exception {
536536

537537
try {
538538
getClient().resubscribe(new TaskIdParams("non-existent-task"), List.of(), errorHandler, null);
539-
539+
540540
// Wait for error to be captured (may come via error handler for streaming)
541541
boolean errorReceived = errorLatch.await(10, TimeUnit.SECONDS);
542-
542+
543543
if (errorReceived) {
544544
// Error came via error handler
545545
Throwable error = errorRef.get();
@@ -1028,15 +1028,12 @@ private ClientConfig createClientConfig(boolean streaming) {
10281028

10291029
// Set transport-specific configuration
10301030
List<ClientTransportConfig> transportConfigs = getClientTransportConfigs();
1031-
1031+
10321032
if (!transportConfigs.isEmpty()) {
10331033
builder.setClientTransportConfigs(transportConfigs);
10341034
}
10351035

10361036
return builder.build();
10371037
}
10381038

1039-
private static class BreakException extends RuntimeException {
1040-
1041-
}
10421039
}

0 commit comments

Comments
 (0)