public static String getDataFromDynamicMessage(final DynamicMessage message) {
        for (Map.Entry<Descriptors.FieldDescriptor, Object> entry : message.getAllFields().entrySet()) {
            Descriptors.FieldDescriptor key = entry.getKey();
            Object value = entry.getValue();

            String fullName = key.getFullName();
            String jsonMessageFullName = GrpcConstants.JSON_DESCRIPTOR_PROTO_NAME + "." + GrpcConstants.JSON_DESCRIPTOR_PROTO_FIELD_NAME;
            if (jsonMessageFullName.equals(fullName)) {
                return (String) value;
            }
        }
        return "";
    }
@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);
        }
    }