(t *testing.T)
| 508 | } |
| 509 | |
| 510 | func TestChangeApplicationPlan_Unauthorized(t *testing.T) { |
| 511 | mux := http.NewServeMux() |
| 512 | mux.HandleFunc( |
| 513 | "/1/applications/APP1/plan/self-serve", |
| 514 | func(w http.ResponseWriter, r *http.Request) { |
| 515 | w.WriteHeader(http.StatusUnauthorized) |
| 516 | }, |
| 517 | ) |
| 518 | |
| 519 | ts, client := newTestClient(mux) |
| 520 | defer ts.Close() |
| 521 | |
| 522 | _, err := client.ChangeApplicationPlan("expired-token", "APP1", "grow") |
| 523 | require.Error(t, err) |
| 524 | assert.Contains(t, err.Error(), "session expired") |
| 525 | } |
| 526 | |
| 527 | func TestChangeApplicationPlan_ErrorStatus(t *testing.T) { |
| 528 | mux := http.NewServeMux() |
nothing calls this directly
no test coverage detected