@Test
    public void testParseOfDynamicMessageMarshaller() throws IOException {
        String jsonParam = "{\"text\":\"hello world\"}";
        DynamicMessage jsonMessage = JsonMessage.buildJsonMessage(jsonParam);
        MethodDescriptor<DynamicMessage, DynamicMessage> echo = JsonMessage.createJsonMarshallerMethodDescriptor("echo.service",
                "echo",
                MethodDescriptor.MethodType.BIDI_STREAMING,
                jsonMessage,
                jsonMessage);

        MethodDescriptor.Marshaller<DynamicMessage> requestMarshaller = echo.getRequestMarshaller();

        InputStream inputStream = new ByteArrayInputStream("".getBytes());
        requestMarshaller.parse(inputStream);

        final InputStream mockInputStream = mock(InputStream.class);
        when(mockInputStream.read(any(byte[].class), anyInt(), anyInt())).thenThrow(IOException.class);
        assertThrows(RuntimeException.class, () -> requestMarshaller.parse(mockInputStream));
    }
The Test Case For {@link JsonMessage}.
shenyu-protocol/shenyu-protocol-grpc/src/test/java/org/apache/shenyu/protocol/grpc/message/JsonMessageTest.java