(t *testing.T, db *dbmock.MockStore)
| 659 | } |
| 660 | |
| 661 | func configureMockDeployment(t *testing.T, db *dbmock.MockStore) (uuid.UUID, string) { |
| 662 | t.Helper() |
| 663 | deploymentID := uuid.New() |
| 664 | db.EXPECT().GetDeploymentID(gomock.Any()).Return(deploymentID.String(), nil).Times(1) |
| 665 | |
| 666 | licenseRaw := coderdenttest.GenerateLicense(t, coderdenttest.LicenseOptions{ |
| 667 | PublishUsageData: true, |
| 668 | }) |
| 669 | db.EXPECT().GetUnexpiredLicenses(gomock.Any()).Return([]database.License{ |
| 670 | { |
| 671 | ID: 1, |
| 672 | UploadedAt: dbtime.Now(), |
| 673 | JWT: licenseRaw, |
| 674 | Exp: dbtime.Now().Add(48 * time.Hour), |
| 675 | UUID: uuid.New(), |
| 676 | }, |
| 677 | }, nil) |
| 678 | |
| 679 | return deploymentID, licenseRaw |
| 680 | } |
| 681 | |
| 682 | func fakeServer(t *testing.T, handler http.Handler) string { |
| 683 | t.Helper() |
no test coverage detected