mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 02:25:56 +00:00
Stabilize legacy license exchange test
This commit is contained in:
@@ -8872,16 +8872,16 @@
|
||||
],
|
||||
"work_claims": [
|
||||
{
|
||||
"id": "codex-lane-l1",
|
||||
"agent_id": "codex",
|
||||
"summary": "Prepare and publish the governed v6.1.0-rc.2 release packet",
|
||||
"id": "release-manager-lane-l3",
|
||||
"agent_id": "release-manager",
|
||||
"summary": "Stabilize the v6.1.0-rc.2 legacy license exchange release gate",
|
||||
"target_id": "v6-product-lane-expansion",
|
||||
"claimed_at": "2026-07-16T22:37:38Z",
|
||||
"heartbeat_at": "2026-07-16T22:37:38Z",
|
||||
"expires_at": "2026-07-17T02:37:38Z",
|
||||
"claimed_at": "2026-07-16T23:27:45Z",
|
||||
"heartbeat_at": "2026-07-16T23:27:45Z",
|
||||
"expires_at": "2026-07-17T03:27:45Z",
|
||||
"work_item": {
|
||||
"kind": "lane",
|
||||
"id": "L1"
|
||||
"id": "L3"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@@ -64,17 +64,28 @@ func TestGetTenantComponents_AutoExchangesPersistedLegacyJWT(t *testing.T) {
|
||||
|
||||
var exchangeCalled atomic.Int32
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if handleTestInstallationStatus(w, r, 1) {
|
||||
return
|
||||
}
|
||||
if r.URL.Path != "/v1/licenses/exchange" {
|
||||
t.Fatalf("path = %q, want /v1/licenses/exchange", r.URL.Path)
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
if r.Method != http.MethodPost {
|
||||
t.Errorf("exchange method = %q, want POST", r.Method)
|
||||
w.WriteHeader(http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
exchangeCalled.Add(1)
|
||||
|
||||
var req pkglicensing.ExchangeLegacyLicenseRequest
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
t.Fatalf("decode exchange request: %v", err)
|
||||
t.Errorf("decode exchange request: %v", err)
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if req.LegacyLicenseKey == "" {
|
||||
t.Fatal("expected legacy license key in exchange request")
|
||||
t.Error("expected legacy license key in exchange request")
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
|
||||
Reference in New Issue
Block a user