(t *testing.T)
| 322 | } |
| 323 | |
| 324 | func TestUpdateApplication_Unauthorized(t *testing.T) { |
| 325 | mux := http.NewServeMux() |
| 326 | mux.HandleFunc("/1/applications/APP1", func(w http.ResponseWriter, r *http.Request) { |
| 327 | w.WriteHeader(http.StatusUnauthorized) |
| 328 | }) |
| 329 | |
| 330 | ts, client := newTestClient(mux) |
| 331 | defer ts.Close() |
| 332 | |
| 333 | _, err := client.UpdateApplication("expired-token", "APP1", "Renamed App") |
| 334 | require.Error(t, err) |
| 335 | assert.Contains(t, err.Error(), "session expired") |
| 336 | } |
| 337 | |
| 338 | func TestUpdateApplication_ErrorStatus(t *testing.T) { |
| 339 | mux := http.NewServeMux() |
nothing calls this directly
no test coverage detected