@Test
    public void testGetDataFromDynamicMessage() {
        String jsonParam = "{\"text\":\"hello world\"}";

        DynamicMessage jsonMessage = JsonMessage.buildJsonMessage(jsonParam);
        String data = JsonMessage.getDataFromDynamicMessage(jsonMessage);
        assertEquals(jsonParam, data);
        final DynamicMessage dynamicMessageMock = mock(DynamicMessage.class);
        final Map<Descriptors.FieldDescriptor, Object> hashMap = new HashMap<>(1);
        hashMap.put(mock(Descriptors.FieldDescriptor.class), "data");
        when(dynamicMessageMock.getAllFields()).thenReturn(hashMap);
        final String dataFromDynamicMessage = JsonMessage.getDataFromDynamicMessage(dynamicMessageMock);
        assertEquals(dataFromDynamicMessage, "");

        DynamicMessage jsonMessage2 = JsonMessage.buildJsonMessage();
        String data2 = JsonMessage.getDataFromDynamicMessage(jsonMessage2);
        assertEquals(data2, "");

        try (MockedStatic<Descriptors.FileDescriptor> descriptorMockedStatic = mockStatic(Descriptors.FileDescriptor.class)) {
            descriptorMockedStatic.when(() -> Descriptors.FileDescriptor.buildFrom(any(), any(Descriptors.FileDescriptor[].class))).thenThrow(Descriptors.DescriptorValidationException.class);
            assertThrows(RuntimeException.class, JsonMessage::buildJsonMessage);
        }
    }
The Test Case For {@link JsonMessage}.
shenyu-protocol/shenyu-protocol-grpc/src/test/java/org/apache/shenyu/protocol/grpc/message/JsonMessageTest.java