File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,8 +78,17 @@ func (a *Admin) AddMocks(c echo.Context) error {
7878 }
7979 }
8080
81+ // Return the target session (id + name) so callers — shell scripts especially — can chain a
82+ // GET /mocks?session=<id> without a separate GET /sessions lookup. Session names are not a
83+ // reliable key (they need not be unique); the opaque id is.
84+ session , err := a .mocksServices .GetSessionByID (sessionID )
85+ if err != nil {
86+ return echo .NewHTTPError (http .StatusInternalServerError , err .Error ())
87+ }
88+
8189 return c .JSON (http .StatusOK , echo.Map {
8290 "message" : "Mocks registered successfully" ,
91+ "session" : session .Summarize (),
8392 })
8493}
8594
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ testcases:
1212 assertions :
1313 - result.statuscode ShouldEqual 200
1414 - result.bodyjson.message ShouldEqual "Mocks registered successfully"
15+ # POST /mocks returns the target session so callers can chain GET /mocks?session=<id>.
16+ - result.bodyjson.session.id ShouldNotBeEmpty
17+ - result.bodyjson.session.name ShouldNotBeEmpty
1518
1619 - type : http
1720 method : GET
You can’t perform that action at this time.
0 commit comments