From 078310647fe76c8800bdffdb8bcb375be73a5b88 Mon Sep 17 00:00:00 2001 From: Chih-Fu Lai Date: Wed, 3 Dec 2025 21:01:51 -0600 Subject: [PATCH] fix: stablize flaky test in bmc-aispeech-realtime Signed-off-by: Chih-Fu Lai --- .../aispeech/realtimespeech/RealtimeSpeechClientTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bmc-addons/bmc-aispeech-realtime/src/test/java/com/oracle/bmc/aispeech/realtimespeech/RealtimeSpeechClientTest.java b/bmc-addons/bmc-aispeech-realtime/src/test/java/com/oracle/bmc/aispeech/realtimespeech/RealtimeSpeechClientTest.java index a1dbd8b17f..57627af73f 100644 --- a/bmc-addons/bmc-aispeech-realtime/src/test/java/com/oracle/bmc/aispeech/realtimespeech/RealtimeSpeechClientTest.java +++ b/bmc-addons/bmc-aispeech-realtime/src/test/java/com/oracle/bmc/aispeech/realtimespeech/RealtimeSpeechClientTest.java @@ -5,6 +5,8 @@ package com.oracle.bmc.aispeech.realtimespeech; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import com.oracle.bmc.aispeech.model.CustomizationInference; import com.oracle.bmc.aispeech.model.RealtimeParameters; import com.oracle.bmc.auth.BasicAuthenticationDetailsProvider; @@ -136,7 +138,10 @@ public void testOnConnectAndClose() String credentialString = "{\"authenticationType\":\"CREDENTIALS\",\"compartmentId\":\"COMPARTMENT_ID\",\"headers\":{\"testKey\":\"testValue\",\"uri\":\"wss://test-endpoint.com/ws/transcribe/stream\"}}"; - Assert.assertEquals(credentialString, stringArgumentCaptor.getValue()); + ObjectMapper mapper = new ObjectMapper(); + JsonNode expected = mapper.readTree(credentialString); + JsonNode actual = mapper.readTree(stringArgumentCaptor.getValue()); + Assert.assertEquals(expected, actual); // Test onClose along with this realtimeSpeechClientSpy.close();