(t *testing.T)
| 490 | } |
| 491 | |
| 492 | func TestChangeApplicationPlan_EmptyBodyFallback(t *testing.T) { |
| 493 | mux := http.NewServeMux() |
| 494 | mux.HandleFunc( |
| 495 | "/1/applications/APP1/plan/self-serve", |
| 496 | func(w http.ResponseWriter, r *http.Request) { |
| 497 | w.WriteHeader(http.StatusNoContent) |
| 498 | }, |
| 499 | ) |
| 500 | |
| 501 | ts, client := newTestClient(mux) |
| 502 | defer ts.Close() |
| 503 | |
| 504 | // An empty/204 body still yields a usable result with the known app ID. |
| 505 | app, err := client.ChangeApplicationPlan("test-token", "APP1", "free") |
| 506 | require.NoError(t, err) |
| 507 | assert.Equal(t, "APP1", app.ID) |
| 508 | } |
| 509 | |
| 510 | func TestChangeApplicationPlan_Unauthorized(t *testing.T) { |
| 511 | mux := http.NewServeMux() |
nothing calls this directly
no test coverage detected