MCPcopy Create free account
hub / github.com/goadesign/goa / collectMethods

Method collectMethods

jsonrpc/integration_tests/framework/runner.go:168–208  ·  view source on GitHub ↗

collectMethods gets all unique methods from scenarios

()

Source from the content-addressed store, hash-verified

166
167// collectMethods gets all unique methods from scenarios
168func (r *Runner) collectMethods() map[string]MethodInfo {
169 methods := make(map[string]MethodInfo)
170
171 for _, scenario := range r.config.Scenarios {
172 // Handle batch requests
173 if len(scenario.Batch) > 0 {
174 for _, req := range scenario.Batch {
175 method := req.GetMethod("")
176 if method == "" {
177 continue // Skip notifications without methods
178 }
179
180 info, err := ParseMethod(method)
181 if err != nil {
182 // Skip invalid methods (used for testing errors)
183 continue
184 }
185
186 methods[method] = info
187 }
188 continue
189 }
190
191 // Handle single requests
192 method := scenario.Request.GetMethod(scenario.Method)
193 if method == "" {
194 // Skip scenarios without methods (e.g., raw requests)
195 continue
196 }
197
198 info, err := ParseMethod(method)
199 if err != nil {
200 // Skip invalid methods (used for testing errors)
201 continue
202 }
203
204 methods[method] = info
205 }
206
207 return methods
208}
209
210// startServers starts test servers for all transports
211func (r *Runner) startServers(t *testing.T) error {

Callers 1

generateCodeMethod · 0.95

Calls 2

ParseMethodFunction · 0.85
GetMethodMethod · 0.80

Tested by

no test coverage detected