collectMethods gets all unique methods from scenarios
()
| 166 | |
| 167 | // collectMethods gets all unique methods from scenarios |
| 168 | func (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 |
| 211 | func (r *Runner) startServers(t *testing.T) error { |
no test coverage detected