MCPcopy Create free account
hub / github.com/astercloud/aster / TestWorkflowCreate

Function TestWorkflowCreate

server/server_test.go:340–366  ·  view source on GitHub ↗

Workflow Handler Tests

(t *testing.T)

Source from the content-addressed store, hash-verified

338// Workflow Handler Tests
339
340func TestWorkflowCreate(t *testing.T) {
341 srv, cleanup := setupTestServer(t)
342 defer cleanup()
343
344 body := `{
345 "name": "Test Workflow",
346 "description": "A test workflow",
347 "version": "1.0.0",
348 "steps": [
349 {
350 "id": "step1",
351 "name": "First Step",
352 "type": "agent"
353 }
354 ]
355 }`
356
357 req := httptest.NewRequest(http.MethodPost, "/v1/workflows", strings.NewReader(body))
358 req.Header.Set("Content-Type", "application/json")
359 w := httptest.NewRecorder()
360
361 srv.Router().ServeHTTP(w, req)
362
363 assert.Equal(t, http.StatusCreated, w.Code)
364 assert.Contains(t, w.Body.String(), "success")
365 assert.Contains(t, w.Body.String(), "Test Workflow")
366}
367
368func TestWorkflowList(t *testing.T) {
369 srv, cleanup := setupTestServer(t)

Callers

nothing calls this directly

Calls 5

setupTestServerFunction · 0.85
SetMethod · 0.65
ServeHTTPMethod · 0.45
RouterMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected