Atlas › Test

TestSetCallerInfo_NoExistingCallerInfo

Exact test identity: go.temporal.io/server/common/headers/TestCallerInfoSuite/TestSetCallerInfo_NoExistingCallerInfo

Package
go.temporal.io/server/common/headers
Suite / test hierarchy
TestCallerInfoSuite/TestSetCallerInfo_NoExistingCallerInfo
Test
TestSetCallerInfo_NoExistingCallerInfo
Introduced at
TestSetCallerInfo_NoExistingCallerInfo Frontier kind: Test frontier
Covered ranges
5
Covered lines
17
Covered files
2

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/headers/headers.go 10 covered LOC · 4 ranges

Open complete file

154 // setIncomingMD sets the key-value pairs in the incoming metadata.
155 // Empty values are ignored.
156 > func setIncomingMD(ctx context.Context, kv map[string]string) context.Context { headers.go
157 > mdIncoming, ok := metadata.FromIncomingContext(ctx)
158 > if !ok {
159 > mdIncoming = metadata.MD{} headers.go
160 > }
161 > for k, v := range kv { headers.go
162 > if v != "" {
163 > mdIncoming.Set(k, v)
164 > }
165 }
166 > return metadata.NewIncomingContext(ctx, mdIncoming) headers.go
167 }
go.temporal.io/server/common/headers/caller_info.go 7 covered LOC · 1 range

Open complete file

117 ctx context.Context,
118 info CallerInfo,
119 > ) context.Context { caller_info.go
120 > return setIncomingMD(ctx, map[string]string{
121 > CallerNameHeaderName: info.CallerName,
122 > CallerTypeHeaderName: info.CallerType,
123 > CallOriginHeaderName: info.CallOrigin,
124 > })
125 > }
126
127 // SetCallerName set caller name in the context.