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

Function TestEncodeHeaderResponseWithError

protocol/dubbo/impl/codec_test.go:124–135  ·  view source on GitHub ↗

TestEncodeHeaderResponseWithError tests EncodeHeader for error response packages

(t *testing.T)

Source from the content-addressed store, hash-verified

122
123// TestEncodeHeaderResponseWithError tests EncodeHeader for error response packages
124func TestEncodeHeaderResponseWithError(t *testing.T) {
125 codec := NewDubboCodec(nil)
126 pkg := NewDubboPackage(nil)
127 pkg.Header.Type = PackageResponse
128 pkg.Header.ResponseStatus = Response_SERVICE_ERROR
129 pkg.Header.SerialID = constant.SHessian2
130 pkg.Header.ID = 11111
131
132 header := codec.EncodeHeader(*pkg)
133 assert.NotNil(t, header)
134 assert.Equal(t, Response_SERVICE_ERROR, header[3])
135}
136
137// TestEncodeHeaderRequestTwoWay tests EncodeHeader for two-way request packages
138func TestEncodeHeaderRequestTwoWay(t *testing.T) {

Callers

nothing calls this directly

Calls 4

NewDubboCodecFunction · 0.85
NewDubboPackageFunction · 0.85
EncodeHeaderMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected