Skip to content

Commit 5f0419e

Browse files
committed
Add comments to UTF-8 test for consistency with existing tests
1 parent 04c476f commit 5f0419e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mcp-test/src/test/java/io/modelcontextprotocol/server/transport/StdioServerTransportProviderTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void shouldHandleUtf8EncodedMessages() throws Exception {
145145
InputStream stream = new ByteArrayInputStream(jsonMessage.getBytes(StandardCharsets.UTF_8));
146146

147147
transportProvider = new StdioServerTransportProvider(McpJsonDefaults.getMapper(), stream, System.out);
148-
148+
// Set up a real session to capture the message
149149
AtomicReference<McpSchema.JSONRPCMessage> capturedMessage = new AtomicReference<>();
150150
CountDownLatch messageLatch = new CountDownLatch(1);
151151

@@ -160,8 +160,10 @@ void shouldHandleUtf8EncodedMessages() throws Exception {
160160
return session;
161161
};
162162

163+
// Set session factory
163164
transportProvider.setSessionFactory(realSessionFactory);
164165

166+
// Wait for the message to be processed using the latch
165167
StepVerifier.create(Mono.fromCallable(() -> messageLatch.await(100, TimeUnit.SECONDS)).flatMap(success -> {
166168
if (!success) {
167169
return Mono.error(new AssertionError("Timeout waiting for message processing"));

0 commit comments

Comments
 (0)