(t *testing.T)
| 247 | } |
| 248 | |
| 249 | func TestGetApplication_ParsesPlanLabel(t *testing.T) { |
| 250 | mux := http.NewServeMux() |
| 251 | mux.HandleFunc("/1/application/APP1", func(w http.ResponseWriter, _ *http.Request) { |
| 252 | _, err := w.Write([]byte( |
| 253 | `{"data":{"id":"APP1","type":"application","attributes":{"name":"My App","application_id":"APP1","plan":{"name":"v8.5-plg-grow-plus","version":9,"label":"Grow Plus","pay_as_you_go":true}}}}`, |
| 254 | )) |
| 255 | require.NoError(t, err) |
| 256 | }) |
| 257 | |
| 258 | ts, client := newTestClient(mux) |
| 259 | defer ts.Close() |
| 260 | |
| 261 | app, err := client.GetApplication("test-token", "APP1") |
| 262 | require.NoError(t, err) |
| 263 | assert.Equal(t, "Grow Plus", app.PlanLabel) |
| 264 | } |
| 265 | |
| 266 | func TestCreateApplication_Success(t *testing.T) { |
| 267 | mux := http.NewServeMux() |
nothing calls this directly
no test coverage detected