MCPcopy Create free account
hub / github.com/apache/dubbo-go / TestCodecInterface

Function TestCodecInterface

remoting/codec_test.go:85–103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

83}
84
85func TestCodecInterface(t *testing.T) {
86 mockC := &mockCodec{}
87
88 // EncodeRequest
89 buf, err := mockC.EncodeRequest(&Request{ID: 1, Version: "2.0.2"})
90 require.NoError(t, err)
91 assert.NotNil(t, buf)
92
93 // EncodeResponse
94 buf, err = mockC.EncodeResponse(&Response{ID: 1, Version: "2.0.2"})
95 require.NoError(t, err)
96 assert.NotNil(t, buf)
97
98 // Decode
99 result, length, err := mockC.Decode([]byte("test-data"))
100 require.NoError(t, err)
101 assert.NotNil(t, result)
102 assert.Equal(t, 9, length)
103}

Callers

nothing calls this directly

Calls 4

EncodeRequestMethod · 0.95
EncodeResponseMethod · 0.95
DecodeMethod · 0.95
EqualMethod · 0.45

Tested by

no test coverage detected