(t *testing.T)
| 53 | } |
| 54 | |
| 55 | func TestMigrationService_ListUserMigrations(t *testing.T) { |
| 56 | t.Parallel() |
| 57 | client, mux, _ := setup(t) |
| 58 | |
| 59 | mux.HandleFunc("/user/migrations", func(w http.ResponseWriter, r *http.Request) { |
| 60 | testMethod(t, r, "GET") |
| 61 | testHeader(t, r, "Accept", mediaTypeMigrationsPreview) |
| 62 | |
| 63 | w.WriteHeader(http.StatusOK) |
| 64 | assertWrite(t, w, fmt.Appendf(nil, "[%s]", userMigrationJSON)) |
| 65 | }) |
| 66 | |
| 67 | ctx := t.Context() |
| 68 | got, _, err := client.Migrations.ListUserMigrations(ctx, &ListOptions{Page: 1, PerPage: 2}) |
| 69 | if err != nil { |
| 70 | t.Errorf("ListUserMigrations returned error %v", err) |
| 71 | } |
| 72 | |
| 73 | want := []*UserMigration{wantUserMigration} |
| 74 | if !cmp.Equal(want, got) { |
| 75 | t.Errorf("ListUserMigrations = %v, want = %v", got, want) |
| 76 | } |
| 77 | |
| 78 | const methodName = "ListUserMigrations" |
| 79 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 80 | got, resp, err := client.Migrations.ListUserMigrations(ctx, &ListOptions{Page: 1, PerPage: 2}) |
| 81 | if got != nil { |
| 82 | t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) |
| 83 | } |
| 84 | return resp, err |
| 85 | }) |
| 86 | } |
| 87 | |
| 88 | func TestMigrationService_UserMigrationStatus(t *testing.T) { |
| 89 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…