feat: localize license states and restore revoked licenses
Co-Authored-By: Craft Agent <agents-noreply@craft.do>
This commit is contained in:
@@ -137,4 +137,13 @@ func testHeartbeatMySQL(t *testing.T, db *sql.DB, r *gin.Engine, cookie *http.Co
|
||||
if response.Data.Payload.State != "revoked" {
|
||||
t.Fatal("revocation not propagated")
|
||||
}
|
||||
restorePath := "/api/v1/licenses/" + strconv.FormatUint(licenseID, 10) + "/restore"
|
||||
if w = request(restorePath, `{}`, "heartbeat-restore", true); w.Code != 200 {
|
||||
t.Fatalf("restore=%d body=%s", w.Code, w.Body)
|
||||
}
|
||||
w = request(path, body, "restored", false)
|
||||
json.Unmarshal(w.Body.Bytes(), &response)
|
||||
if w.Code != 200 || response.Data.Payload.State != "active" {
|
||||
t.Fatalf("restoration not propagated: %d %s", w.Code, w.Body)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user