aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLéo Geoffroy <leo.geoffroy@sonarsource.com>2024-02-20 16:30:20 +0100
committersonartech <sonartech@sonarsource.com>2024-02-21 20:02:34 +0000
commit4a921c76d47497ed1412a40e30e91e407eb8f37f (patch)
tree263bdfe9acdfa11e62997275f3fdf65680d37bda
parent55f91d45997bdd5fdf505d8d5769f3d75dd13180 (diff)
downloadsonarqube-4a921c76d47497ed1412a40e30e91e407eb8f37f.tar.gz
sonarqube-4a921c76d47497ed1412a40e30e91e407eb8f37f.zip
SONAR-21643 Migrate db tests migration to Junit5
#
-rw-r--r--server/sonar-db-core/build.gradle4
-rw-r--r--server/sonar-db-core/src/testFixtures/java/org/sonar/db/CoreDbTester.java15
-rw-r--r--server/sonar-db-migration/build.gradle6
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/charset/SelectExecutorIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/charset/SqlExecutorIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/MigrationHistoryImplIT.java20
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/MigrationHistoryTableImplIT.java18
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/NoTableMigrationHistoryImplIT.java16
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/sql/CreateTableBuilderIT.java49
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/sql/DbPrimaryKeyConstraintFinderIT.java22
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/DataChangeIT.java54
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/ForceReloadingOfAllPluginsIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v00/CreateInitialSchemaIT.java10
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v00/PopulateInitialSchemaIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/AddNclocToProjectsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/CreateScimGroupsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/CreateUniqueIndexForScimGroupsUuidIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropBModuleUuidInComponentsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropBModuleUuidPathInComponentsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropIndexProjectsModuleUuidInComponentsIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropIndexProjectsRootUuidInComponentsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropModuleUuidInComponentsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropModuleUuidPathInComponentsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropRootUuidInComponentsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropScimUserProvisioningIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropSonarScimEnabledPropertyIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/LogMessageIfSonarScimEnabledPresentPropertyIT.java24
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/MakeColumnUserLocalNotNullableInUsersIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/PopulateNclocForForProjectsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/RemoveOrphanRulesFromQualityProfilesIT.java16
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/UpdateUserLocalValueInUsersIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddCodeVariantsColumnInIssuesTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddIsMainColumnInProjectBranchesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddReportSchedulesTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddReportSubscriptionsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AlterIsMainColumnInProjectBranchesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateExternalGroupsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexForEmailOnUsersTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexForScmAccountOnScmAccountsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexOnExternalIdAndIdentityOnExternalGroupsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateProjectUuidInUserTokensIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateScmAccountsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateUniqueIndexForReportSchedulesTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateUniqueIndexForReportSubscriptionsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/DropProjectKeyInUserTokensIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/DropScmAccountsInUsersIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/FixDifferentUuidsForSubportfoliosIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseKeeColumnSizeInInternalPropertiesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseTaskTypeColumnSizeInCeActivityIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseTaskTypeColumnSizeInCeQueueIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/MigrateScmAccountsFromUsersToScmAccountsIT.java28
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateProjectUuidInUserTokensIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSchedulesIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSubscriptionsIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RemoveOrphanUserTokensIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RemoveReportPropertiesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RenameColumnComponentUuidInPropertiesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/UpdateIsMainColumnInProjectBranchesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/AddCleanCodeAttributeInRulesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/AddUserConsentRequiredIfGithubAutoProvisioningEnabledIT.java26
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateBooleanPurgedColumnInSnapshotsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateGithubOrganizationsGroupsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexCreatedAtInWebhookDeliveriesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInCeActivityIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInCeQueueIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInGroupRolesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInUserRolesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexProjectUuidCreatedAtInWebhookDeliveriesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexProjectUuidInProjectBranchesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexRootComponentUuidInSnapshotsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexTaskUuidCreatedAtInWebhookDeliveriesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexWebhookUuidCreatedAtInWebhookDeliveriesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIssueImpactsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreatePreviousNonCompliantValueInNewCodePeriodsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateRulesDefaultImpactsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateUniqueConstraintOnIssuesImpactsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateUniqueConstraintOnRulesDefaultImpactsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInGroupRolesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInSnapshotsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInUserRolesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInWebhookDeliveriesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexMainComponentUuidInCeActivityIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexMainComponentUuidInCeQueueIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexOnMainBranchProjectUuidIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexProjectUuidInWebhookDeliveriesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexTaskUuidInWebhookDeliveriesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexWebhookUuidInWebhookDeliveriesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropMainBranchProjectUuidInComponentsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropPurgeStatusColumnInSnapshotsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropTableProjectMappingsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/FixSqaleIndexMetricDescriptionIT.java16
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/IncreaseIsLastKeyInCeActivityIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/IncreaseMainIsLastKeyInCeActivityIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/MakeProjectUuidNullableInUserDismissedMessagesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/MakePurgedColumnNotNullableInSnapshotsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulateCleanCodeAttributeColumnInRulesIT.java20
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulateDefaultImpactsInRulesIT.java36
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulatePurgedColumnInSnapshotsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameBuildDateInSnapshotsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInGroupRolesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInSnapshotsIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInUserRolesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInWebhookDeliveriesIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameMainComponentUuidInCeActivityIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameMainComponentUuidInCeQueueIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/UpdateValueAndPopulatePreviousNonCompliantValueInNewCodePeriodsIT.java10
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddCleanCodeAttributeColumnInIssuesTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddCreationMethodColumnInProjectsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddRuleChangesUuidColumnInQProfileChangesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddSqVersionColumnInQprofileChangesTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateGithubPermissionsMappingTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateIndexForRuleImpactChangesTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateRuleChangesTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateRuleImpactChangesTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateUniqueIndexForGithubPermissionsMappingTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateUniqueIndexForPropertiesTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/DeduplicatePropertiesTableIT.java16
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/MakeCreationMethodColumnInProjectsNotNullableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/PopulateCreationMethodColumnInProjectsTableIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/PopulateGithubPermissionsMappingIT.java20
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/SetAllowQualityProfileDisableInheritedRulesIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/AddUuidColumnToGroupsUsersIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreateIssuesFixedTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreatePrimaryKeyOnGroupsUsersTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreateRuleTagsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DeleteRedundantFailedAlertsForApplicationsIT.java18
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DropSystemTagsInRulesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DropTagsInRulesIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/MakeUuidInGroupsUsersNotNullableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/PopulateGroupsUsersUuidIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/PopulateRuleTagsTableIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/RemoveCleanCodeAttributeFromCustomHotspotRulesIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/RenameWontFixIssuesMetricIT.java14
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/CreatePrimaryKeyOnIssuesImpactsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/CreatePrimaryKeyOnRulesDefaultImpactsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropPrimaryKeyConstraintInIssuesImpactsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropPrimaryKeyConstraintInRulesDefaultImpactsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropUuidColumnInIssuesImpactsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropUuidColumnInRulesDefaultImpactsTableIT.java12
-rw-r--r--server/sonar-db-migration/src/testFixtures/java/org/sonar/db/MigrationDbTester.java15
141 files changed, 985 insertions, 930 deletions
diff --git a/server/sonar-db-core/build.gradle b/server/sonar-db-core/build.gradle
index 3d32c75be42..c65d7834a21 100644
--- a/server/sonar-db-core/build.gradle
+++ b/server/sonar-db-core/build.gradle
@@ -26,12 +26,15 @@ dependencies {
testImplementation 'com.microsoft.sqlserver:mssql-jdbc'
testImplementation 'com.oracle.database.jdbc:ojdbc11'
testImplementation 'com.tngtech.java:junit-dataprovider'
+ testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.postgresql:postgresql'
testImplementation 'org.sonarsource.api.plugin:sonar-plugin-api-test-fixtures'
testImplementation project(':sonar-testing-harness')
+ testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
+ testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
testRuntimeOnly 'com.h2database:h2'
testRuntimeOnly 'com.microsoft.sqlserver:mssql-jdbc'
testRuntimeOnly 'com.oracle.database.jdbc:ojdbc11'
@@ -43,6 +46,7 @@ dependencies {
testFixturesApi 'org.apache.commons:commons-collections4'
testFixturesImplementation 'com.oracle.database.jdbc:ojdbc11'
+ testFixturesImplementation 'org.junit.jupiter:junit-jupiter-api'
testFixturesCompileOnly 'com.google.code.findbugs:jsr305'
}
diff --git a/server/sonar-db-core/src/testFixtures/java/org/sonar/db/CoreDbTester.java b/server/sonar-db-core/src/testFixtures/java/org/sonar/db/CoreDbTester.java
index e8d21132a01..75a29f2675e 100644
--- a/server/sonar-db-core/src/testFixtures/java/org/sonar/db/CoreDbTester.java
+++ b/server/sonar-db-core/src/testFixtures/java/org/sonar/db/CoreDbTester.java
@@ -20,12 +20,15 @@
package org.sonar.db;
import org.apache.commons.lang.StringUtils;
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
/**
* This class should be called using @Rule.
* Data is truncated between each tests. The schema is created between each test.
*/
-public class CoreDbTester extends AbstractDbTester<CoreTestDb> {
+public class CoreDbTester extends AbstractDbTester<CoreTestDb> implements BeforeEachCallback, AfterEachCallback {
private CoreDbTester(CoreTestDb testDb) {
super(testDb);
@@ -55,4 +58,14 @@ public class CoreDbTester extends AbstractDbTester<CoreTestDb> {
protected void after() {
db.stop();
}
+
+ @Override
+ public void afterEach(ExtensionContext extensionContext) throws Exception {
+ after();
+ }
+
+ @Override
+ public void beforeEach(ExtensionContext extensionContext) throws Exception {
+ before();
+ }
}
diff --git a/server/sonar-db-migration/build.gradle b/server/sonar-db-migration/build.gradle
index 636f278c8f8..0025201269f 100644
--- a/server/sonar-db-migration/build.gradle
+++ b/server/sonar-db-migration/build.gradle
@@ -24,6 +24,7 @@ dependencies {
testImplementation 'com.squareup.okhttp3:mockwebserver'
testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core'
+ testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.mindrot:jbcrypt'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.xmlunit:xmlunit-core'
@@ -34,14 +35,19 @@ dependencies {
testImplementation testFixtures(project(':server:sonar-db-core'))
testFixturesImplementation 'org.sonarsource.orchestrator:sonar-orchestrator-junit4'
+ testFixturesImplementation 'org.junit.jupiter:junit-jupiter-api'
testFixturesImplementation testFixtures(project(':server:sonar-db-core'))
testRuntimeOnly 'com.h2database:h2'
testRuntimeOnly 'com.microsoft.sqlserver:mssql-jdbc'
testRuntimeOnly 'com.oracle.database.jdbc:ojdbc11'
+ testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
+ testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
testRuntimeOnly 'org.postgresql:postgresql'
}
test {
systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
+ // Enabling the JUnit Platform (see https://github.com/junit-team/junit5-samples/tree/master/junit5-migration-gradle)
+ useJUnitPlatform()
}
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/charset/SelectExecutorIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/charset/SelectExecutorIT.java
index bbf1ee7ac8a..3eb108632cc 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/charset/SelectExecutorIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/charset/SelectExecutorIT.java
@@ -21,21 +21,21 @@ package org.sonar.server.platform.db.migration.charset;
import java.sql.Connection;
import java.util.List;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.CoreDbTester;
import static org.assertj.core.api.Assertions.assertThat;
-public class SelectExecutorIT {
+class SelectExecutorIT {
- @Rule
- public CoreDbTester dbTester = CoreDbTester.createForSchema(SelectExecutorIT.class, "users_table.sql");
+ @RegisterExtension
+ public final CoreDbTester dbTester = CoreDbTester.createForSchema(SelectExecutorIT.class, "users_table.sql");
SqlExecutor underTest = new SqlExecutor();
@Test
- public void testExecuteQuery() throws Exception {
+ void testExecuteQuery() throws Exception {
insertUser("him", "Him");
insertUser("her", "Her");
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/charset/SqlExecutorIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/charset/SqlExecutorIT.java
index 9e8b9e42346..9311acb215d 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/charset/SqlExecutorIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/charset/SqlExecutorIT.java
@@ -22,13 +22,13 @@ package org.sonar.server.platform.db.migration.charset;
import java.sql.Connection;
import java.util.List;
import java.util.Map;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.CoreDbTester;
import static org.assertj.core.api.Assertions.assertThat;
-public class SqlExecutorIT {
+class SqlExecutorIT {
private static final String LOGIN_DB_COLUMN = "login";
private static final String NAME_DB_COLUMN = "name";
@@ -37,11 +37,11 @@ public class SqlExecutorIT {
private SqlExecutor underTest = new SqlExecutor();
- @Rule
- public CoreDbTester dbTester = CoreDbTester.createForSchema(SqlExecutorIT.class, "users_table.sql");
+ @RegisterExtension
+ public final CoreDbTester dbTester = CoreDbTester.createForSchema(SqlExecutorIT.class, "users_table.sql");
@Test
- public void executeSelect_executes_PreparedStatement() throws Exception {
+ void executeSelect_executes_PreparedStatement() throws Exception {
dbTester.executeInsert(USERS_DB_TABLE, LOGIN_DB_COLUMN, "login1", NAME_DB_COLUMN, "name one", IS_ROOT_DB_COLUMN, false);
dbTester.executeInsert(USERS_DB_TABLE, LOGIN_DB_COLUMN, "login2", NAME_DB_COLUMN, "name two", IS_ROOT_DB_COLUMN, false);
@@ -57,7 +57,7 @@ public class SqlExecutorIT {
}
@Test
- public void executeUpdate_executes_PreparedStatement() throws Exception {
+ void executeUpdate_executes_PreparedStatement() throws Exception {
dbTester.executeInsert(USERS_DB_TABLE, LOGIN_DB_COLUMN, "the_login", NAME_DB_COLUMN, "the name", IS_ROOT_DB_COLUMN, false);
try (Connection connection = dbTester.openConnection()) {
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/MigrationHistoryImplIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/MigrationHistoryImplIT.java
index 620c286f7e2..187222cfe57 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/MigrationHistoryImplIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/MigrationHistoryImplIT.java
@@ -23,8 +23,8 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Arrays;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.CoreDbTester;
import org.sonar.server.platform.db.migration.step.MigrationStep;
import org.sonar.server.platform.db.migration.step.RegisteredMigrationStep;
@@ -34,40 +34,40 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-public class MigrationHistoryImplIT {
- @Rule
- public CoreDbTester dbTester = CoreDbTester.createForSchema(MigrationHistoryImplIT.class, "schema_migration.sql");
+class MigrationHistoryImplIT {
+ @RegisterExtension
+ public final CoreDbTester dbTester = CoreDbTester.createForSchema(MigrationHistoryImplIT.class, "schema_migration.sql");
private MigrationHistoryMeddler migrationHistoryMeddler = mock(MigrationHistoryMeddler.class);
private MigrationHistoryImpl underTest = new MigrationHistoryImpl(dbTester.database(), migrationHistoryMeddler);
@Test
- public void start_does_not_fail_if_table_history_exists_and_calls_meddler() {
+ void start_does_not_fail_if_table_history_exists_and_calls_meddler() {
underTest.start();
verify(migrationHistoryMeddler).meddle(underTest);
}
@Test
- public void getLastMigrationNumber_returns_empty_if_history_table_is_empty() {
+ void getLastMigrationNumber_returns_empty_if_history_table_is_empty() {
assertThat(underTest.getLastMigrationNumber()).isEmpty();
}
@Test
- public void getLastMigrationNumber_returns_last_version_assuming_version_are_only_number() throws SQLException {
+ void getLastMigrationNumber_returns_last_version_assuming_version_are_only_number() throws SQLException {
insert(12, 5, 30, 8);
assertThat(underTest.getLastMigrationNumber()).contains(30L);
}
@Test
- public void done_fails_with_NPE_if_argument_is_null() {
+ void done_fails_with_NPE_if_argument_is_null() {
assertThatThrownBy(() -> underTest.done(null))
.isInstanceOf(NullPointerException.class);
}
@Test
- public void done_adds_migration_number_to_table() {
+ void done_adds_migration_number_to_table() {
underTest.done(new RegisteredMigrationStep(12, "aa", MigrationStep.class));
assertThat(underTest.getLastMigrationNumber()).contains(12L);
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/MigrationHistoryTableImplIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/MigrationHistoryTableImplIT.java
index c0c4efce8e7..b90e7d09e83 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/MigrationHistoryTableImplIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/MigrationHistoryTableImplIT.java
@@ -23,30 +23,30 @@ import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.db.dialect.MsSql;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
+import org.sonar.db.dialect.MsSql;
import static org.assertj.core.api.Assertions.assertThat;
-public class MigrationHistoryTableImplIT {
+class MigrationHistoryTableImplIT {
private static final String TABLE_SCHEMA_MIGRATIONS = "schema_migrations";
- @Rule
- public MigrationDbTester dbTester = MigrationDbTester.createEmpty();
+ @RegisterExtension
+ public final MigrationDbTester dbTester = MigrationDbTester.createEmpty();
- private MigrationHistoryTableImpl underTest = new MigrationHistoryTableImpl(dbTester.database());
+ private final MigrationHistoryTableImpl underTest = new MigrationHistoryTableImpl(dbTester.database());
@Test
- public void start_creates_table_on_empty_schema() {
+ void start_creates_table_on_empty_schema() {
underTest.start();
verifyTable();
}
@Test
- public void start_does_not_fail_if_table_exists() throws SQLException {
+ void start_does_not_fail_if_table_exists() throws SQLException {
executeDdl(String.format("create table %s (version %s(255) not null)", TABLE_SCHEMA_MIGRATIONS, getFieldType()));
verifyTable();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/NoTableMigrationHistoryImplIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/NoTableMigrationHistoryImplIT.java
index 292cea6ac5f..2549ac4d53a 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/NoTableMigrationHistoryImplIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/history/NoTableMigrationHistoryImplIT.java
@@ -19,23 +19,23 @@
*/
package org.sonar.server.platform.db.migration.history;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verifyNoInteractions;
-public class NoTableMigrationHistoryImplIT {
- @Rule
- public MigrationDbTester dbTester = MigrationDbTester.createEmpty();
+class NoTableMigrationHistoryImplIT {
+ @RegisterExtension
+ public final MigrationDbTester dbTester = MigrationDbTester.createEmpty();
- private MigrationHistoryMeddler migrationHistoryMeddler = mock(MigrationHistoryMeddler.class);
- private MigrationHistoryImpl underTest = new MigrationHistoryImpl(dbTester.database(), migrationHistoryMeddler);
+ private final MigrationHistoryMeddler migrationHistoryMeddler = mock(MigrationHistoryMeddler.class);
+ private final MigrationHistoryImpl underTest = new MigrationHistoryImpl(dbTester.database(), migrationHistoryMeddler);
@Test
- public void start_fails_with_ISE_if_table_history_does_not_exist() {
+ void start_fails_with_ISE_if_table_history_does_not_exist() {
assertThatThrownBy(() -> {
underTest.start();
verifyNoInteractions(migrationHistoryMeddler);
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/sql/CreateTableBuilderIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/sql/CreateTableBuilderIT.java
index ad4d504f2b1..f13c3637956 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/sql/CreateTableBuilderIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/sql/CreateTableBuilderIT.java
@@ -19,11 +19,13 @@
*/
package org.sonar.server.platform.db.migration.sql;
+import java.util.List;
import java.util.Map;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.sonar.db.dialect.Dialect;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
+import org.sonar.db.dialect.Dialect;
import org.sonar.server.platform.db.migration.def.TinyIntColumnDef;
import org.sonar.server.platform.db.migration.def.VarcharColumnDef;
@@ -37,16 +39,22 @@ import static org.sonar.server.platform.db.migration.def.IntegerColumnDef.newInt
import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.newVarcharColumnDefBuilder;
import static org.sonar.server.platform.db.migration.sql.CreateTableBuilder.ColumnFlag.AUTO_INCREMENT;
-public class CreateTableBuilderIT {
- @ClassRule
- public static final MigrationDbTester dbTester = MigrationDbTester.createEmpty();
+class CreateTableBuilderIT {
+ @RegisterExtension
+ public final MigrationDbTester dbTester = MigrationDbTester.createEmpty();
- private final Dialect dialect = dbTester.database().getDialect();
+ private Dialect dialect;
private static int tableNameGenerator = 0;
+ @BeforeEach
+ void before() {
+ dialect = dbTester.database().getDialect();
+ }
+
@Test
- public void create_no_primary_key_table() {
- newCreateTableBuilder()
+ void create_no_primary_key_table() {
+ String tableName = createTableName();
+ new CreateTableBuilder(dialect, tableName)
.addColumn(newBooleanColumnDefBuilder().setColumnName("bool_col_1").build())
.addColumn(newBooleanColumnDefBuilder().setColumnName("bool_col_2").setIsNullable(false).build())
.addColumn(newIntegerColumnDefBuilder().setColumnName("i_col_1").build())
@@ -65,29 +73,35 @@ public class CreateTableBuilderIT {
.addColumn(newBlobColumnDefBuilder().setColumnName("blob_col_2").setIsNullable(false).build())
.build()
.forEach(dbTester::executeDdl);
+ assertTableAndColumnsExists(tableName, "bool_col_1", "bool_col_2", "i_col_1", "i_col_2", "bi_col_1", "bi_col_2", "clob_col_1",
+ "clob_col_2", "dec_col_1", "dec_col_2", "tiny_col_1", "tiny_col_2", "varchar_col_1", "varchar_col_2", "blob_col_1", "blob_col_2");
}
@Test
- public void create_single_column_primary_key_table() {
- newCreateTableBuilder()
+ void create_single_column_primary_key_table() {
+ String tableName = createTableName();
+ new CreateTableBuilder(dialect, tableName)
.addPkColumn(newBigIntegerColumnDefBuilder().setColumnName("bg_col_1").setIsNullable(false).build())
.addColumn(newVarcharColumnDefBuilder().setColumnName("varchar_col_2").setLimit(40).setIsNullable(false).build())
.build()
.forEach(dbTester::executeDdl);
+ assertTableAndColumnsExists(tableName, "bg_col_1", "varchar_col_2");
}
@Test
- public void create_multi_column_primary_key_table() {
- newCreateTableBuilder()
+ void create_multi_column_primary_key_table() {
+ String tableName = createTableName();
+ new CreateTableBuilder(dialect, tableName)
.addPkColumn(newBigIntegerColumnDefBuilder().setColumnName("bg_col_1").setIsNullable(false).build())
.addPkColumn(newBigIntegerColumnDefBuilder().setColumnName("bg_col_2").setIsNullable(false).build())
.addColumn(newVarcharColumnDefBuilder().setColumnName("varchar_col_2").setLimit(40).setIsNullable(false).build())
.build()
.forEach(dbTester::executeDdl);
+ assertTableAndColumnsExists(tableName, "bg_col_1", "bg_col_2", "varchar_col_2");
}
@Test
- public void create_autoincrement_notnullable_integer_primary_key_table() {
+ void create_autoincrement_notnullable_integer_primary_key_table() {
String tableName = createTableName();
new CreateTableBuilder(dialect, tableName)
.addPkColumn(newIntegerColumnDefBuilder().setColumnName("id").setIsNullable(false).build(), AUTO_INCREMENT)
@@ -99,7 +113,7 @@ public class CreateTableBuilderIT {
}
@Test
- public void create_autoincrement_notnullable_biginteger_primary_key_table() {
+ void create_autoincrement_notnullable_biginteger_primary_key_table() {
String tableName = createTableName();
new CreateTableBuilder(dialect, tableName)
.addPkColumn(newBigIntegerColumnDefBuilder().setColumnName("id").setIsNullable(false).build(), AUTO_INCREMENT)
@@ -122,6 +136,11 @@ public class CreateTableBuilderIT {
assertThat(row).containsEntry("val", "toto");
}
+ private void assertTableAndColumnsExists(String tableName, String... columnNames) {
+ List<Map<String, Object>> row = dbTester.select(String.format("select %s from %s", String.join(", ", columnNames), tableName));
+ assertThat(row).isEmpty();
+ }
+
private CreateTableBuilder newCreateTableBuilder() {
return new CreateTableBuilder(dialect, createTableName());
}
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/sql/DbPrimaryKeyConstraintFinderIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/sql/DbPrimaryKeyConstraintFinderIT.java
index 8ad43ccf5a2..64be9724a94 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/sql/DbPrimaryKeyConstraintFinderIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/sql/DbPrimaryKeyConstraintFinderIT.java
@@ -23,8 +23,8 @@ import java.sql.Connection;
import java.sql.SQLException;
import java.util.Optional;
import javax.sql.DataSource;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.CoreDbTester;
import org.sonar.db.Database;
import org.sonar.db.dialect.H2;
@@ -36,10 +36,10 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-public class DbPrimaryKeyConstraintFinderIT {
+class DbPrimaryKeyConstraintFinderIT {
- @Rule
- public CoreDbTester db = CoreDbTester.createForSchema(DbPrimaryKeyConstraintFinderIT.class, "schema.sql");
+ @RegisterExtension
+ public final CoreDbTester db = CoreDbTester.createForSchema(DbPrimaryKeyConstraintFinderIT.class, "schema.sql");
private final Database dbMock = mock(Database.class);
private final DbPrimaryKeyConstraintFinder underTest = new DbPrimaryKeyConstraintFinder(dbMock);
@@ -50,7 +50,7 @@ public class DbPrimaryKeyConstraintFinderIT {
private static final org.sonar.db.dialect.H2 H2 = new H2();
@Test
- public void findConstraintName_constraint_exists() throws SQLException {
+ void findConstraintName_constraint_exists() throws SQLException {
DbPrimaryKeyConstraintFinder underTest = new DbPrimaryKeyConstraintFinder(db.database());
Optional<String> constraintName = underTest.findConstraintName("TEST_PRIMARY_KEY");
assertThat(constraintName).isPresent();
@@ -58,13 +58,13 @@ public class DbPrimaryKeyConstraintFinderIT {
}
@Test
- public void findConstraintName_constraint_not_exist_fails_silently() throws SQLException {
+ void findConstraintName_constraint_not_exist_fails_silently() throws SQLException {
DbPrimaryKeyConstraintFinder underTest = new DbPrimaryKeyConstraintFinder(db.database());
assertThat(underTest.findConstraintName("NOT_EXISTING_TABLE")).isNotPresent();
}
@Test
- public void getDbVendorSpecificQuery_mssql() {
+ void getDbVendorSpecificQuery_mssql() {
when(dbMock.getDialect()).thenReturn(MS_SQL);
assertThat(underTest.getDbVendorSpecificQuery("my_table"))
@@ -72,7 +72,7 @@ public class DbPrimaryKeyConstraintFinderIT {
}
@Test
- public void getDbVendorSpecificQuery_postgresql() throws SQLException {
+ void getDbVendorSpecificQuery_postgresql() throws SQLException {
DataSource dataSource = mock(DataSource.class);
Connection connection = mock(Connection.class);
when(dataSource.getConnection()).thenReturn(connection);
@@ -85,7 +85,7 @@ public class DbPrimaryKeyConstraintFinderIT {
}
@Test
- public void getDbVendorSpecificQuery_oracle() {
+ void getDbVendorSpecificQuery_oracle() {
when(dbMock.getDialect()).thenReturn(ORACLE);
assertThat(underTest.getDbVendorSpecificQuery("my_table"))
@@ -93,7 +93,7 @@ public class DbPrimaryKeyConstraintFinderIT {
}
@Test
- public void getDbVendorSpecificQuery_h2() {
+ void getDbVendorSpecificQuery_h2() {
when(dbMock.getDialect()).thenReturn(H2);
assertThat(underTest.getDbVendorSpecificQuery("my_table"))
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/DataChangeIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/DataChangeIT.java
index 35b937e534d..b48f129f893 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/DataChangeIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/DataChangeIT.java
@@ -30,9 +30,9 @@ import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.CoreDbTester;
import org.sonar.server.platform.db.migration.step.Select.Row;
import org.sonar.server.platform.db.migration.step.Select.RowReader;
@@ -43,21 +43,21 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.fail;
-public class DataChangeIT {
+class DataChangeIT {
private static final int MAX_BATCH_SIZE = 250;
private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- @Rule
- public CoreDbTester db = CoreDbTester.createForSchema(DataChangeIT.class, "schema.sql");
+ @RegisterExtension
+ public final CoreDbTester db = CoreDbTester.createForSchema(DataChangeIT.class, "schema.sql");
- @Before
+ @BeforeEach
public void setUp() {
db.executeUpdateSql("truncate table persons");
}
@Test
- public void query() throws Exception {
+ void query() throws Exception {
insertPersons();
AtomicBoolean executed = new AtomicBoolean(false);
@@ -77,7 +77,7 @@ public class DataChangeIT {
}
@Test
- public void read_column_types() throws Exception {
+ void read_column_types() throws Exception {
insertPersons();
List<Object[]> persons = new ArrayList<>();
@@ -99,7 +99,7 @@ public class DataChangeIT {
}
@Test
- public void parameterized_query() throws Exception {
+ void parameterized_query() throws Exception {
insertPersons();
final List<Long> ids = new ArrayList<>();
@@ -113,7 +113,7 @@ public class DataChangeIT {
}
@Test
- public void display_current_row_details_if_error_during_get() throws Exception {
+ void display_current_row_details_if_error_during_get() throws Exception {
insertPersons();
assertThatThrownBy(() -> {
@@ -131,7 +131,7 @@ public class DataChangeIT {
}
@Test
- public void display_current_row_details_if_error_during_list() throws Exception {
+ void display_current_row_details_if_error_during_list() throws Exception {
insertPersons();
assertThatThrownBy(() -> {
@@ -149,7 +149,7 @@ public class DataChangeIT {
}
@Test
- public void bad_parameterized_query() throws Exception {
+ void bad_parameterized_query() throws Exception {
insertPersons();
DataChange change = new DataChange(db.database()) {
@@ -165,7 +165,7 @@ public class DataChangeIT {
}
@Test
- public void scroll() throws Exception {
+ void scroll() throws Exception {
insertPersons();
final List<Long> ids = new ArrayList<>();
@@ -179,7 +179,7 @@ public class DataChangeIT {
}
@Test
- public void insert() throws Exception {
+ void insert() throws Exception {
insertPersons();
new DataChange(db.database()) {
@@ -203,7 +203,7 @@ public class DataChangeIT {
}
@Test
- public void batch_inserts() throws Exception {
+ void batch_inserts() throws Exception {
insertPersons();
new DataChange(db.database()) {
@@ -241,7 +241,7 @@ public class DataChangeIT {
}
@Test
- public void override_size_of_batch_inserts() throws Exception {
+ void override_size_of_batch_inserts() throws Exception {
new DataChange(db.database()) {
@Override
public void execute(Context context) throws SQLException {
@@ -275,7 +275,7 @@ public class DataChangeIT {
}
@Test
- public void update_null() throws Exception {
+ void update_null() throws Exception {
insertPersons();
new DataChange(db.database()) {
@@ -301,7 +301,7 @@ public class DataChangeIT {
}
@Test
- public void mass_batch_insert() throws Exception {
+ void mass_batch_insert() throws Exception {
db.executeUpdateSql("truncate table persons");
final int count = MAX_BATCH_SIZE + 10;
@@ -327,7 +327,7 @@ public class DataChangeIT {
}
@Test
- public void scroll_and_update() throws Exception {
+ void scroll_and_update() throws Exception {
insertPersons();
new DataChange(db.database()) {
@@ -352,7 +352,7 @@ public class DataChangeIT {
}
@Test
- public void display_current_row_details_if_error_during_scroll() throws Exception {
+ void display_current_row_details_if_error_during_scroll() throws Exception {
insertPersons();
assertThatThrownBy(() -> {
@@ -372,7 +372,7 @@ public class DataChangeIT {
}
@Test
- public void mass_update() throws Exception {
+ void mass_update() throws Exception {
insertPersons();
new DataChange(db.database()) {
@@ -398,7 +398,7 @@ public class DataChangeIT {
}
@Test
- public void row_splitter_should_split_correctly() throws Exception {
+ void row_splitter_should_split_correctly() throws Exception {
insertPersons();
new DataChange(db.database()) {
@@ -452,7 +452,7 @@ public class DataChangeIT {
private record PhoneNumberRow(long personId, String phoneNumber){}
@Test
- public void display_current_row_details_if_error_during_mass_update() throws Exception {
+ void display_current_row_details_if_error_during_mass_update() throws Exception {
insertPersons();
assertThatThrownBy(() -> {
@@ -473,7 +473,7 @@ public class DataChangeIT {
}
@Test
- public void mass_update_nothing() throws Exception {
+ void mass_update_nothing() throws Exception {
insertPersons();
new DataChange(db.database()) {
@@ -490,7 +490,7 @@ public class DataChangeIT {
}
@Test
- public void bad_mass_update() throws Exception {
+ void bad_mass_update() throws Exception {
insertPersons();
DataChange change = new DataChange(db.database()) {
@@ -511,7 +511,7 @@ public class DataChangeIT {
}
@Test
- public void read_not_null_fields() throws Exception {
+ void read_not_null_fields() throws Exception {
insertPersons();
List<Object[]> persons = new ArrayList<>();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/ForceReloadingOfAllPluginsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/ForceReloadingOfAllPluginsIT.java
index 080363eeb98..4c65c78f8b2 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/ForceReloadingOfAllPluginsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/step/ForceReloadingOfAllPluginsIT.java
@@ -22,8 +22,8 @@ package org.sonar.server.platform.db.migration.step;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactory;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.CoreDbTester;
@@ -32,16 +32,16 @@ import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.platform.db.migration.step.ForceReloadingOfAllPlugins.OVERWRITE_HASH;
-public class ForceReloadingOfAllPluginsIT {
+class ForceReloadingOfAllPluginsIT {
private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
- @Rule
- public CoreDbTester db = CoreDbTester.createForSchema(ForceReloadingOfAllPluginsIT.class, "schema.sql");
+ @RegisterExtension
+ public final CoreDbTester db = CoreDbTester.createForSchema(ForceReloadingOfAllPluginsIT.class, "schema.sql");
private final DataChange underTest = new ForceReloadingOfAllPlugins(db.database());
@Test
- public void migration_overwrite_file_hash_on_all_plugins() throws SQLException {
+ void migration_overwrite_file_hash_on_all_plugins() throws SQLException {
String pluginUuid1 = insertPlugin();
String pluginUuid2 = insertPlugin();
@@ -52,7 +52,7 @@ public class ForceReloadingOfAllPluginsIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
String pluginUuid1 = insertPlugin();
String pluginUuid2 = insertPlugin();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v00/CreateInitialSchemaIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v00/CreateInitialSchemaIT.java
index 6ca3cb8ffea..ffe5c19fa85 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v00/CreateInitialSchemaIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v00/CreateInitialSchemaIT.java
@@ -25,23 +25,23 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Set;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
-public class CreateInitialSchemaIT {
+class CreateInitialSchemaIT {
private static final Set<String> SCHEMAS_TO_IGNORE = Set.of("INFORMATION_SCHEMA", "sys", "SYS", "SYSTEM", "CTXSYS", "MDSYS", "XDB");
- @Rule
+ @RegisterExtension
public final MigrationDbTester dbTester = MigrationDbTester.createForMigrationStep(CreateInitialSchema.class);
private final CreateInitialSchema underTest = new CreateInitialSchema(dbTester.database());
@Test
- public void creates_tables_on_empty_db() throws Exception {
+ void creates_tables_on_empty_db() throws Exception {
underTest.execute();
List<String> tables = new ArrayList<>();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v00/PopulateInitialSchemaIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v00/PopulateInitialSchemaIT.java
index 88beeafe3ed..93235827b00 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v00/PopulateInitialSchemaIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v00/PopulateInitialSchemaIT.java
@@ -27,9 +27,9 @@ import java.util.Random;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.Version;
import org.sonar.core.platform.SonarQubeVersion;
@@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-public class PopulateInitialSchemaIT {
+class PopulateInitialSchemaIT {
private static final long NOW = 1_500L;
@@ -51,18 +51,18 @@ public class PopulateInitialSchemaIT {
private final System2 system2 = mock(System2.class);
private final SonarQubeVersion sonarQubeVersion = mock(SonarQubeVersion.class);
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateInitialSchema.class);
private final PopulateInitialSchema underTest = new PopulateInitialSchema(db.database(), system2, uuidFactory, sonarQubeVersion);
- @Before
+ @BeforeEach
public void setUp() {
when(sonarQubeVersion.get()).thenReturn(version);
}
@Test
- public void migration_inserts_users_and_groups() throws SQLException {
+ void migration_inserts_users_and_groups() throws SQLException {
when(system2.now()).thenReturn(NOW);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/AddNclocToProjectsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/AddNclocToProjectsIT.java
index 16c29ae3c06..647480672c7 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/AddNclocToProjectsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/AddNclocToProjectsIT.java
@@ -21,22 +21,22 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class AddNclocToProjectsIT {
+class AddNclocToProjectsIT {
private static final String TABLE_NAME = "projects";
private static final String COLUMN_NAME = "ncloc";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddNclocToProjects.class);
private final DdlChange underTest = new AddNclocToProjects(db.database());
@Test
- public void add_column() throws SQLException {
+ void add_column() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
@@ -44,7 +44,7 @@ public class AddNclocToProjectsIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/CreateScimGroupsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/CreateScimGroupsTableIT.java
index 653f6f2d7b8..855e92ea404 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/CreateScimGroupsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/CreateScimGroupsTableIT.java
@@ -21,22 +21,22 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE;
import static org.sonar.server.platform.db.migration.version.v100.CreateScimGroupsTable.TABLE_NAME;
-public class CreateScimGroupsTableIT {
- @Rule
+class CreateScimGroupsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateScimGroupsTable.class);
private final DdlChange underTest = new CreateScimGroupsTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
@@ -48,7 +48,7 @@ public class CreateScimGroupsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/CreateUniqueIndexForScimGroupsUuidIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/CreateUniqueIndexForScimGroupsUuidIT.java
index 3f9a58b8284..706a931eb48 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/CreateUniqueIndexForScimGroupsUuidIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/CreateUniqueIndexForScimGroupsUuidIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
@@ -29,13 +29,13 @@ import static org.sonar.server.platform.db.migration.version.v100.CreateScimGrou
import static org.sonar.server.platform.db.migration.version.v100.CreateUniqueIndexForScimGroupsUuid.COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v100.CreateUniqueIndexForScimGroupsUuid.INDEX_NAME;
-public class CreateUniqueIndexForScimGroupsUuidIT {
- @Rule
+class CreateUniqueIndexForScimGroupsUuidIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateUniqueIndexForScimGroupsUuid.class);
private final DdlChange underTest = new CreateUniqueIndexForScimGroupsUuid(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
underTest.execute();
@@ -44,7 +44,7 @@ public class CreateUniqueIndexForScimGroupsUuidIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropBModuleUuidInComponentsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropBModuleUuidInComponentsIT.java
index 7b5a3560da7..d415ffe2934 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropBModuleUuidInComponentsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropBModuleUuidInComponentsIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropBModuleUuidInComponentsIT {
+class DropBModuleUuidInComponentsIT {
private static final String TABLE_NAME = "components";
private static final String COLUMN_NAME = "b_module_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropBModuleUuidInComponents.class);
private final DdlChange underTest = new DropBModuleUuidInComponents(db.database());
@Test
- public void drops_column() throws SQLException {
+ void drops_column() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 50, true);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 50, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropBModuleUuidPathInComponentsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropBModuleUuidPathInComponentsIT.java
index aacad8ba6f0..5807aa2897e 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropBModuleUuidPathInComponentsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropBModuleUuidPathInComponentsIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropBModuleUuidPathInComponentsIT {
+class DropBModuleUuidPathInComponentsIT {
private static final String TABLE_NAME = "components";
private static final String COLUMN_NAME = "b_module_uuid_path";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropBModuleUuidPathInComponents.class);
private final DdlChange underTest = new DropBModuleUuidPathInComponents(db.database());
@Test
- public void drops_column() throws SQLException {
+ void drops_column() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 1500, true);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 1500, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropIndexProjectsModuleUuidInComponentsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropIndexProjectsModuleUuidInComponentsIT.java
index f742a14c2dc..0629581cd22 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropIndexProjectsModuleUuidInComponentsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropIndexProjectsModuleUuidInComponentsIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropIndexProjectsModuleUuidInComponentsIT {
+class DropIndexProjectsModuleUuidInComponentsIT {
private static final String TABLE_NAME = "components";
private static final String COLUMN_NAME = "module_uuid";
private static final String INDEX_NAME = "projects_module_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropIndexProjectsModuleUuidInComponents.class);
private final DdlChange underTest = new DropIndexProjectsModuleUuidInComponents(db.database());
@Test
- public void drops_index() throws SQLException {
+ void drops_index() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
}
@Test
- public void execute_whenIndexNameWithPrefix_shouldStillDelete() throws SQLException {
+ void execute_whenIndexNameWithPrefix_shouldStillDelete() throws SQLException {
String alteredIndexName = "idx_1234567891345678916456789_" + INDEX_NAME;
db.renameIndex(TABLE_NAME, INDEX_NAME, alteredIndexName);
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
@@ -52,7 +52,7 @@ public class DropIndexProjectsModuleUuidInComponentsIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropIndexProjectsRootUuidInComponentsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropIndexProjectsRootUuidInComponentsIT.java
index 010376a937f..c3d9d2691a1 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropIndexProjectsRootUuidInComponentsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropIndexProjectsRootUuidInComponentsIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropIndexProjectsRootUuidInComponentsIT {
+class DropIndexProjectsRootUuidInComponentsIT {
private static final String TABLE_NAME = "components";
private static final String COLUMN_NAME = "root_uuid";
private static final String INDEX_NAME = "projects_root_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropIndexProjectsRootUuidInComponents.class);
private final DdlChange underTest = new DropIndexProjectsRootUuidInComponents(db.database());
@Test
- public void drops_index() throws SQLException {
+ void drops_index() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropModuleUuidInComponentsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropModuleUuidInComponentsIT.java
index 605c86f8695..ba4cd4303f6 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropModuleUuidInComponentsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropModuleUuidInComponentsIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropModuleUuidInComponentsIT {
+class DropModuleUuidInComponentsIT {
private static final String TABLE_NAME = "components";
private static final String COLUMN_NAME = "module_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropModuleUuidInComponents.class);
private final DdlChange underTest = new DropModuleUuidInComponents(db.database());
@Test
- public void drops_column() throws SQLException {
+ void drops_column() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 50, true);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 50, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropModuleUuidPathInComponentsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropModuleUuidPathInComponentsIT.java
index cc19d0354f0..aacb9cdd370 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropModuleUuidPathInComponentsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropModuleUuidPathInComponentsIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropModuleUuidPathInComponentsIT {
+class DropModuleUuidPathInComponentsIT {
private static final String TABLE_NAME = "components";
private static final String COLUMN_NAME = "module_uuid_path";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropModuleUuidPathInComponents.class);
private final DdlChange underTest = new DropModuleUuidPathInComponents(db.database());
@Test
- public void drops_column() throws SQLException {
+ void drops_column() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 1500, true);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 1500, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropRootUuidInComponentsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropRootUuidInComponentsIT.java
index 0874e1b2266..ea7d33bc1a2 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropRootUuidInComponentsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropRootUuidInComponentsIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropRootUuidInComponentsIT {
+class DropRootUuidInComponentsIT {
private static final String TABLE_NAME = "components";
private static final String COLUMN_NAME = "root_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropRootUuidInComponents.class);
private final DdlChange underTest = new DropRootUuidInComponents(db.database());
@Test
- public void drops_column() throws SQLException {
+ void drops_column() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 50, false);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 50, false);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropScimUserProvisioningIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropScimUserProvisioningIT.java
index 56a7adf97ec..468c32b9f0f 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropScimUserProvisioningIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropScimUserProvisioningIT.java
@@ -20,21 +20,21 @@
package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DataChange;
import static org.assertj.core.api.Assertions.assertThat;
-public class DropScimUserProvisioningIT {
+class DropScimUserProvisioningIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropScimUserProvisioning.class);
private final DataChange underTest = new DropScimUserProvisioning(db.database());
@Test
- public void migration_should_truncate_scim_users_table() throws SQLException {
+ void migration_should_truncate_scim_users_table() throws SQLException {
insertScimUser(1);
insertScimUser(2);
@@ -51,7 +51,7 @@ public class DropScimUserProvisioningIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
insertScimUser(1);
insertScimUser(2);
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropSonarScimEnabledPropertyIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropSonarScimEnabledPropertyIT.java
index 88df4a655c8..c5399175f8b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropSonarScimEnabledPropertyIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/DropSonarScimEnabledPropertyIT.java
@@ -21,19 +21,19 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import org.assertj.core.api.Assertions;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DataChange;
-public class DropSonarScimEnabledPropertyIT {
+class DropSonarScimEnabledPropertyIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropSonarScimEnabledProperty.class);
private final DataChange underTest = new DropSonarScimEnabledProperty(db.database());
@Test
- public void migration_should_remove_scim_property() throws SQLException {
+ void migration_should_remove_scim_property() throws SQLException {
insertScimProperty(db);
underTest.execute();
@@ -42,7 +42,7 @@ public class DropSonarScimEnabledPropertyIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
insertScimProperty(db);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/LogMessageIfSonarScimEnabledPresentPropertyIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/LogMessageIfSonarScimEnabledPresentPropertyIT.java
index b36309953e8..6142584c25c 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/LogMessageIfSonarScimEnabledPresentPropertyIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/LogMessageIfSonarScimEnabledPresentPropertyIT.java
@@ -20,33 +20,33 @@
package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.slf4j.event.Level;
-import org.sonar.api.testfixtures.log.LogTester;
+import org.sonar.api.testfixtures.log.LogTesterJUnit5;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DataChange;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.platform.db.migration.version.v100.LogMessageIfSonarScimEnabledPresentProperty.SONAR_SCIM_ENABLED;
-public class LogMessageIfSonarScimEnabledPresentPropertyIT {
+class LogMessageIfSonarScimEnabledPresentPropertyIT {
- @Rule
- public LogTester logger = new LogTester();
+ @RegisterExtension
+ public final LogTesterJUnit5 logger = new LogTesterJUnit5();
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(LogMessageIfSonarScimEnabledPresentProperty.class);
private final DataChange underTest = new LogMessageIfSonarScimEnabledPresentProperty(db.database());
- @Before
+ @BeforeEach
public void before() {
logger.clear();
}
@Test
- public void migration_should_log_message_when_scim_property() throws SQLException {
+ void migration_should_log_message_when_scim_property() throws SQLException {
db.executeInsert("properties ",
"prop_key", "sonar.scim.enabled",
"is_empty", false,
@@ -66,7 +66,7 @@ public class LogMessageIfSonarScimEnabledPresentPropertyIT {
}
@Test
- public void migration_should_not_log_if_no_scim_property() throws SQLException {
+ void migration_should_not_log_if_no_scim_property() throws SQLException {
underTest.execute();
@@ -74,7 +74,7 @@ public class LogMessageIfSonarScimEnabledPresentPropertyIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.executeInsert("properties ",
"prop_key", "sonar.scim.enabled",
"is_empty", false,
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/MakeColumnUserLocalNotNullableInUsersIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/MakeColumnUserLocalNotNullableInUsersIT.java
index 822030350b8..8e1693f1529 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/MakeColumnUserLocalNotNullableInUsersIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/MakeColumnUserLocalNotNullableInUsersIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.BOOLEAN;
-public class MakeColumnUserLocalNotNullableInUsersIT {
+class MakeColumnUserLocalNotNullableInUsersIT {
private static final String TABLE_NAME = "users";
private static final String COLUMN_NAME = "user_local";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(MakeColumnUserLocalNotNullableInUsers.class);
private final MakeColumnUserLocalNotNullableInUsers underTest = new MakeColumnUserLocalNotNullableInUsers(db.database());
@Test
- public void user_local_column_is_not_null() throws SQLException {
+ void user_local_column_is_not_null() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, true);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, false);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/PopulateNclocForForProjectsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/PopulateNclocForForProjectsIT.java
index 84e0fc5917c..2384ca1eafc 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/PopulateNclocForForProjectsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/PopulateNclocForForProjectsIT.java
@@ -22,8 +22,8 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactory;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -32,24 +32,24 @@ import org.sonar.server.platform.db.migration.step.DataChange;
import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
import static org.assertj.core.api.Assertions.assertThat;
-public class PopulateNclocForForProjectsIT {
+class PopulateNclocForForProjectsIT {
private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateNclocForForProjects.class);
private final DataChange underTest = new PopulateNclocForForProjects(db.database());
@Test
- public void migration_populates_ncloc_for_projects() throws SQLException {
+ void migration_populates_ncloc_for_projects() throws SQLException {
Map<String, Long> expectedNclocByProjectUuid = populateData();
underTest.execute();
verifyNclocCorrectlyPopulatedForProjects(expectedNclocByProjectUuid);
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
Map<String, Long> expectedNclocByProjectUuid = populateData();
underTest.execute();
// re-entrant
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/RemoveOrphanRulesFromQualityProfilesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/RemoveOrphanRulesFromQualityProfilesIT.java
index 663ac914ded..1597d8535dd 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/RemoveOrphanRulesFromQualityProfilesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/RemoveOrphanRulesFromQualityProfilesIT.java
@@ -22,9 +22,9 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.api.utils.System2;
import org.sonar.core.util.SequenceUuidFactory;
import org.sonar.core.util.UuidFactory;
@@ -37,21 +37,21 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.sonar.core.util.SequenceUuidFactory.UUID_1;
-public class RemoveOrphanRulesFromQualityProfilesIT {
+class RemoveOrphanRulesFromQualityProfilesIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RemoveOrphanRulesFromQualityProfiles.class);
private final System2 system2 = mock(System2.class);
private final UuidFactory instance = new SequenceUuidFactory();
private final DataChange underTest = new RemoveOrphanRulesFromQualityProfiles(db.database(), instance, system2);
- @Before
+ @BeforeEach
public void before() {
when(system2.now()).thenReturn(1L);
}
@Test
- public void migration_should_remove_orphans() throws SQLException {
+ void migration_should_remove_orphans() throws SQLException {
insertData();
underTest.execute();
@@ -61,7 +61,7 @@ public class RemoveOrphanRulesFromQualityProfilesIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
insertData();
// re-entrant
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/UpdateUserLocalValueInUsersIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/UpdateUserLocalValueInUsersIT.java
index e5f63d4d5eb..63b91701500 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/UpdateUserLocalValueInUsersIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v100/UpdateUserLocalValueInUsersIT.java
@@ -22,8 +22,8 @@ package org.sonar.server.platform.db.migration.version.v100;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactory;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -33,17 +33,17 @@ import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
import static org.apache.commons.lang.RandomStringUtils.randomNumeric;
import static org.assertj.core.api.Assertions.assertThat;
-public class UpdateUserLocalValueInUsersIT {
+class UpdateUserLocalValueInUsersIT {
private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
- @Rule
- public MigrationDbTester db = MigrationDbTester.createForMigrationStep(UpdateUserLocalValueInUsers.class);
+ @RegisterExtension
+ public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(UpdateUserLocalValueInUsers.class);
private final DataChange underTest = new UpdateUserLocalValueInUsers(db.database());
@Test
- public void migration_updates_user_local_if_null() throws SQLException {
+ void migration_updates_user_local_if_null() throws SQLException {
String userUuid1 = insertUser(true);
String userUuid2 = insertUser(false);
String userUuid3 = insertUser(null);
@@ -56,7 +56,7 @@ public class UpdateUserLocalValueInUsersIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
String userUuid1 = insertUser(true);
String userUuid2 = insertUser(false);
String userUuid3 = insertUser(null);
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddCodeVariantsColumnInIssuesTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddCodeVariantsColumnInIssuesTableIT.java
index 43b9114648c..f71df86f42e 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddCodeVariantsColumnInIssuesTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddCodeVariantsColumnInIssuesTableIT.java
@@ -20,31 +20,31 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
-public class AddCodeVariantsColumnInIssuesTableIT {
+class AddCodeVariantsColumnInIssuesTableIT {
private static final String TABLE_NAME = "issues";
private static final String COLUMN_NAME = "code_variants";
private static final int COLUMN_SIZE = 4000;
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddCodeVariantsColumnInIssuesTable.class);
private final AddCodeVariantsColumnInIssuesTable underTest = new AddCodeVariantsColumnInIssuesTable(db.database());
@Test
- public void migration_should_add_column() throws SQLException {
+ void migration_should_add_column() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, COLUMN_SIZE, true);
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddIsMainColumnInProjectBranchesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddIsMainColumnInProjectBranchesIT.java
index f52832874b2..6dab954a97a 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddIsMainColumnInProjectBranchesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddIsMainColumnInProjectBranchesIT.java
@@ -20,30 +20,30 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.BOOLEAN;
-public class AddIsMainColumnInProjectBranchesIT {
+class AddIsMainColumnInProjectBranchesIT {
private static final String TABLE_NAME = "project_branches";
private static final String COLUMN_NAME = "is_main";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddIsMainColumnInProjectBranches.class);
private final AddIsMainColumnInProjectBranches underTest = new AddIsMainColumnInProjectBranches(db.database());
@Test
- public void is_main_column_exists_with_null_value() throws SQLException {
+ void is_main_column_exists_with_null_value() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, null);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddReportSchedulesTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddReportSchedulesTableIT.java
index ec0cf65c393..5af08256fc6 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddReportSchedulesTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddReportSchedulesTableIT.java
@@ -21,22 +21,22 @@ package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE;
import static org.sonar.server.platform.db.migration.version.v101.AddReportSchedulesTable.TABLE_NAME;
-public class AddReportSchedulesTableIT {
- @Rule
+class AddReportSchedulesTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddReportSchedulesTable.class);
private final DdlChange underTest = new AddReportSchedulesTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
@@ -51,7 +51,7 @@ public class AddReportSchedulesTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddReportSubscriptionsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddReportSubscriptionsTableIT.java
index 9c80412fce4..8a2dc83e148 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddReportSubscriptionsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AddReportSubscriptionsTableIT.java
@@ -21,22 +21,22 @@ package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE;
import static org.sonar.server.platform.db.migration.version.v101.AddReportSubscriptionsTable.TABLE_NAME;
-public class AddReportSubscriptionsTableIT {
- @Rule
+class AddReportSubscriptionsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddReportSubscriptionsTable.class);
private final DdlChange underTest = new AddReportSubscriptionsTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
@@ -51,7 +51,7 @@ public class AddReportSubscriptionsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AlterIsMainColumnInProjectBranchesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AlterIsMainColumnInProjectBranchesIT.java
index df2027fa5e6..c1d8adfbc11 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AlterIsMainColumnInProjectBranchesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/AlterIsMainColumnInProjectBranchesIT.java
@@ -20,30 +20,30 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.BOOLEAN;
-public class AlterIsMainColumnInProjectBranchesIT {
+class AlterIsMainColumnInProjectBranchesIT {
private static final String TABLE_NAME = "project_branches";
private static final String COLUMN_NAME = "is_main";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AlterIsMainColumnInProjectBranches.class);
private final AlterIsMainColumnInProjectBranches underTest = new AlterIsMainColumnInProjectBranches(db.database());
@Test
- public void execute_shouldNotBeNullable() throws SQLException {
+ void execute_shouldNotBeNullable() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, true);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, false);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateExternalGroupsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateExternalGroupsTableIT.java
index a083d6c68c9..df5dcf96c79 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateExternalGroupsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateExternalGroupsTableIT.java
@@ -21,8 +21,8 @@ package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
@@ -32,15 +32,15 @@ import static org.sonar.server.platform.db.migration.version.v101.CreateExternal
import static org.sonar.server.platform.db.migration.version.v101.CreateExternalGroupsTable.GROUP_UUID_COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v101.CreateExternalGroupsTable.TABLE_NAME;
-public class CreateExternalGroupsTableIT {
+class CreateExternalGroupsTableIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateExternalGroupsTable.class);
private final DdlChange createExternalGroupsTable = new CreateExternalGroupsTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
createExternalGroupsTable.execute();
@@ -53,7 +53,7 @@ public class CreateExternalGroupsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
createExternalGroupsTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexForEmailOnUsersTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexForEmailOnUsersTableIT.java
index 02c5bcc5f4d..3e110be239d 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexForEmailOnUsersTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexForEmailOnUsersTableIT.java
@@ -20,21 +20,21 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.sonar.server.platform.db.migration.version.v101.CreateIndexForEmailOnUsersTable.COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v101.CreateIndexForEmailOnUsersTable.INDEX_NAME;
import static org.sonar.server.platform.db.migration.version.v101.CreateIndexForEmailOnUsersTable.TABLE_NAME;
-public class CreateIndexForEmailOnUsersTableIT {
- @Rule
+class CreateIndexForEmailOnUsersTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexForEmailOnUsersTable.class);
private final CreateIndexForEmailOnUsersTable createIndexForEmailOnUsersTable = new CreateIndexForEmailOnUsersTable(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
createIndexForEmailOnUsersTable.execute();
@@ -43,7 +43,7 @@ public class CreateIndexForEmailOnUsersTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndexForEmailOnUsersTable.execute();
createIndexForEmailOnUsersTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexForScmAccountOnScmAccountsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexForScmAccountOnScmAccountsTableIT.java
index a7b3583ce0e..b56221bd9c3 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexForScmAccountOnScmAccountsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexForScmAccountOnScmAccountsTableIT.java
@@ -20,21 +20,21 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.sonar.server.platform.db.migration.version.v101.CreateIndexForScmAccountOnScmAccountsTable.INDEX_NAME;
import static org.sonar.server.platform.db.migration.version.v101.CreateScmAccountsTable.SCM_ACCOUNTS_TABLE_NAME;
import static org.sonar.server.platform.db.migration.version.v101.CreateScmAccountsTable.SCM_ACCOUNT_COLUMN_NAME;
-public class CreateIndexForScmAccountOnScmAccountsTableIT {
- @Rule
+class CreateIndexForScmAccountOnScmAccountsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexForScmAccountOnScmAccountsTable.class);
private final CreateIndexForScmAccountOnScmAccountsTable createIndexForScmAccountOnScmAccountsTable = new CreateIndexForScmAccountOnScmAccountsTable(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(SCM_ACCOUNTS_TABLE_NAME, INDEX_NAME);
createIndexForScmAccountOnScmAccountsTable.execute();
@@ -43,7 +43,7 @@ public class CreateIndexForScmAccountOnScmAccountsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndexForScmAccountOnScmAccountsTable.execute();
createIndexForScmAccountOnScmAccountsTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexOnExternalIdAndIdentityOnExternalGroupsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexOnExternalIdAndIdentityOnExternalGroupsTableIT.java
index b03f1666ae1..af5067c52ed 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexOnExternalIdAndIdentityOnExternalGroupsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateIndexOnExternalIdAndIdentityOnExternalGroupsTableIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.sonar.server.platform.db.migration.version.v101.CreateExternalGroupsTable.EXTERNAL_GROUP_ID_COLUMN_NAME;
@@ -29,15 +29,15 @@ import static org.sonar.server.platform.db.migration.version.v101.CreateExternal
import static org.sonar.server.platform.db.migration.version.v101.CreateExternalGroupsTable.TABLE_NAME;
import static org.sonar.server.platform.db.migration.version.v101.CreateIndexOnExternalIdAndIdentityOnExternalGroupsTable.INDEX_NAME;
-public class CreateIndexOnExternalIdAndIdentityOnExternalGroupsTableIT {
+class CreateIndexOnExternalIdAndIdentityOnExternalGroupsTableIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexOnExternalIdAndIdentityOnExternalGroupsTable.class);
private final CreateIndexOnExternalIdAndIdentityOnExternalGroupsTable createIndexOnExternalIdAndIdentityOnExternalGroupsTable = new CreateIndexOnExternalIdAndIdentityOnExternalGroupsTable(
db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
createIndexOnExternalIdAndIdentityOnExternalGroupsTable.execute();
@@ -46,7 +46,7 @@ public class CreateIndexOnExternalIdAndIdentityOnExternalGroupsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndexOnExternalIdAndIdentityOnExternalGroupsTable.execute();
createIndexOnExternalIdAndIdentityOnExternalGroupsTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateProjectUuidInUserTokensIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateProjectUuidInUserTokensIT.java
index 2c053f84b55..15194eecb22 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateProjectUuidInUserTokensIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateProjectUuidInUserTokensIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
-public class CreateProjectUuidInUserTokensIT {
+class CreateProjectUuidInUserTokensIT {
private static final String TABLE_NAME = "user_tokens";
private static final String COLUMN_NAME = "project_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateProjectUuidInUserTokens.class);
private final CreateProjectUuidInUserTokens underTest = new CreateProjectUuidInUserTokens(db.database());
@Test
- public void migration_creates_new_column() throws SQLException {
+ void migration_creates_new_column() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 40, null);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateScmAccountsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateScmAccountsTableIT.java
index 569728802cb..c50058a0a3e 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateScmAccountsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateScmAccountsTableIT.java
@@ -21,8 +21,8 @@ package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
@@ -32,14 +32,14 @@ import static org.sonar.server.platform.db.migration.version.v101.CreateScmAccou
import static org.sonar.server.platform.db.migration.version.v101.CreateScmAccountsTable.SCM_ACCOUNT_SIZE;
import static org.sonar.server.platform.db.migration.version.v101.CreateScmAccountsTable.USER_UUID_COLUMN_NAME;
-public class CreateScmAccountsTableIT {
- @Rule
+class CreateScmAccountsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateScmAccountsTable.class);
private final DdlChange createScmAccountsTable = new CreateScmAccountsTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(SCM_ACCOUNTS_TABLE_NAME);
createScmAccountsTable.execute();
@@ -51,7 +51,7 @@ public class CreateScmAccountsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(SCM_ACCOUNTS_TABLE_NAME);
createScmAccountsTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateUniqueIndexForReportSchedulesTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateUniqueIndexForReportSchedulesTableIT.java
index c2fdd1a1f35..f7398476604 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateUniqueIndexForReportSchedulesTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateUniqueIndexForReportSchedulesTableIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.sonar.server.platform.db.migration.version.v101.AddReportSchedulesTable.TABLE_NAME;
@@ -30,13 +30,13 @@ import static org.sonar.server.platform.db.migration.version.v101.CreateUniqueIn
import static org.sonar.server.platform.db.migration.version.v101.CreateUniqueIndexForReportSchedulesTable.INDEX_NAME;
-public class CreateUniqueIndexForReportSchedulesTableIT {
- @Rule
+class CreateUniqueIndexForReportSchedulesTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateUniqueIndexForReportSchedulesTable.class);
private final CreateUniqueIndexForReportSchedulesTable createUniqueIndexForReportSchedulesTable = new CreateUniqueIndexForReportSchedulesTable(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
createUniqueIndexForReportSchedulesTable.execute();
@@ -45,7 +45,7 @@ public class CreateUniqueIndexForReportSchedulesTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createUniqueIndexForReportSchedulesTable.execute();
createUniqueIndexForReportSchedulesTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateUniqueIndexForReportSubscriptionsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateUniqueIndexForReportSubscriptionsTableIT.java
index 85fa8d27ad5..96e509641a4 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateUniqueIndexForReportSubscriptionsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/CreateUniqueIndexForReportSubscriptionsTableIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.sonar.server.platform.db.migration.version.v101.AddReportSubscriptionsTable.TABLE_NAME;
@@ -31,13 +31,13 @@ import static org.sonar.server.platform.db.migration.version.v101.CreateUniqueIn
import static org.sonar.server.platform.db.migration.version.v101.CreateUniqueIndexForReportSubscriptionsTable.INDEX_NAME;
-public class CreateUniqueIndexForReportSubscriptionsTableIT {
- @Rule
+class CreateUniqueIndexForReportSubscriptionsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateUniqueIndexForReportSubscriptionsTable.class);
private final CreateUniqueIndexForReportSubscriptionsTable createUniqueIndexForReportSubscriptionsTable = new CreateUniqueIndexForReportSubscriptionsTable(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
createUniqueIndexForReportSubscriptionsTable.execute();
@@ -46,7 +46,7 @@ public class CreateUniqueIndexForReportSubscriptionsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createUniqueIndexForReportSubscriptionsTable.execute();
createUniqueIndexForReportSubscriptionsTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/DropProjectKeyInUserTokensIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/DropProjectKeyInUserTokensIT.java
index fca60dc3fe3..6634561d79f 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/DropProjectKeyInUserTokensIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/DropProjectKeyInUserTokensIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
import static org.sonar.server.platform.db.migration.version.v101.DropProjectKeyInUserTokens.COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v101.DropProjectKeyInUserTokens.TABLE_NAME;
-public class DropProjectKeyInUserTokensIT {
- @Rule
+class DropProjectKeyInUserTokensIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropProjectKeyInUserTokens.class);
private final DdlChange underTest = new DropProjectKeyInUserTokens(db.database());
@Test
- public void drops_column() throws SQLException {
+ void drops_column() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 255, true);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 255, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/DropScmAccountsInUsersIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/DropScmAccountsInUsersIT.java
index ecf4d905b12..be6f7fb5b1d 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/DropScmAccountsInUsersIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/DropScmAccountsInUsersIT.java
@@ -21,29 +21,29 @@ package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
import static org.sonar.server.platform.db.migration.version.v101.DropScmAccountsInUsers.COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v101.DropScmAccountsInUsers.TABLE_NAME;
-public class DropScmAccountsInUsersIT {
+class DropScmAccountsInUsersIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropScmAccountsInUsers.class);
private final DdlChange dropScmAccountsInUsers = new DropScmAccountsInUsers(db.database());
@Test
- public void drops_column() throws SQLException {
+ void drops_column() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 4000, true);
dropScmAccountsInUsers.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 4000, true);
dropScmAccountsInUsers.execute();
dropScmAccountsInUsers.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/FixDifferentUuidsForSubportfoliosIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/FixDifferentUuidsForSubportfoliosIT.java
index b09a2431d35..c1d124b381d 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/FixDifferentUuidsForSubportfoliosIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/FixDifferentUuidsForSubportfoliosIT.java
@@ -25,26 +25,26 @@ import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
import org.assertj.core.api.Assertions;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.api.resources.Qualifiers;
import org.sonar.db.MigrationDbTester;
import static java.util.stream.Collectors.toSet;
-public class FixDifferentUuidsForSubportfoliosIT {
+class FixDifferentUuidsForSubportfoliosIT {
private static final String OLD_UUID = "differentSubPfUuid";
private static final String SUB_PF_KEY = "subPfKey";
private static final String NEW_SUBPF_UUID = "subPfUuid";
private static final String PF_UUID = "pfUuid";
private static final String NEW_CHILD_SUBPF_UUID = "childsubpfUuid";
private static final String OLD_CHILD_SUBPF_UUID = "old_child_subpf_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(FixDifferentUuidsForSubportfolios.class);
private final FixDifferentUuidsForSubportfolios underTest = new FixDifferentUuidsForSubportfolios(db.database());
@Test
- public void execute_shouldUpdatePortfoliosAndPortfolioProjectsAndPortfolioReferenceTable() throws SQLException {
+ void execute_shouldUpdatePortfoliosAndPortfolioProjectsAndPortfolioReferenceTable() throws SQLException {
insertPortfolio("pfKey", PF_UUID);
insertComponent(SUB_PF_KEY, NEW_SUBPF_UUID, PF_UUID, Qualifiers.SUBVIEW);
insertSubPortfolio(SUB_PF_KEY, PF_UUID, PF_UUID, OLD_UUID);
@@ -59,7 +59,7 @@ public class FixDifferentUuidsForSubportfoliosIT {
}
@Test
- public void execute_shouldBeRentrant() throws SQLException {
+ void execute_shouldBeRentrant() throws SQLException {
insertPortfolio("pfKey", PF_UUID);
insertComponent(SUB_PF_KEY, NEW_SUBPF_UUID, PF_UUID, Qualifiers.SUBVIEW);
insertSubPortfolio(SUB_PF_KEY, PF_UUID, PF_UUID, OLD_UUID);
@@ -75,7 +75,7 @@ public class FixDifferentUuidsForSubportfoliosIT {
}
@Test
- public void execute_shouldFixUuidForSubPortfolioAtDifferentLevels() throws SQLException {
+ void execute_shouldFixUuidForSubPortfolioAtDifferentLevels() throws SQLException {
insertPortfolio("pfKey", PF_UUID);
insertComponent(SUB_PF_KEY, NEW_SUBPF_UUID, PF_UUID, Qualifiers.SUBVIEW);
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseKeeColumnSizeInInternalPropertiesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseKeeColumnSizeInInternalPropertiesIT.java
index ad2f2cf9cc7..86f481245c4 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseKeeColumnSizeInInternalPropertiesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseKeeColumnSizeInInternalPropertiesIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
@@ -29,21 +29,21 @@ import static org.sonar.server.platform.db.migration.version.v101.IncreaseKeeCol
import static org.sonar.server.platform.db.migration.version.v101.IncreaseKeeColumnSizeInInternalProperties.NEW_COLUMN_SIZE;
import static org.sonar.server.platform.db.migration.version.v101.IncreaseKeeColumnSizeInInternalProperties.TABLE_NAME;
-public class IncreaseKeeColumnSizeInInternalPropertiesIT {
+class IncreaseKeeColumnSizeInInternalPropertiesIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(IncreaseKeeColumnSizeInInternalProperties.class);
private final IncreaseKeeColumnSizeInInternalProperties underTest = new IncreaseKeeColumnSizeInInternalProperties(db.database());
@Test
- public void execute_increaseColumnSize() throws SQLException {
+ void execute_increaseColumnSize() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 20, false);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, NEW_COLUMN_SIZE, false);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 20, false);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseTaskTypeColumnSizeInCeActivityIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseTaskTypeColumnSizeInCeActivityIT.java
index efdf026f844..df0e785c2b1 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseTaskTypeColumnSizeInCeActivityIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseTaskTypeColumnSizeInCeActivityIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
@@ -29,21 +29,21 @@ import static org.sonar.server.platform.db.migration.version.v101.IncreaseTaskTy
import static org.sonar.server.platform.db.migration.version.v101.IncreaseTaskTypeColumnSizeInCeActivity.NEW_COLUMN_SIZE;
import static org.sonar.server.platform.db.migration.version.v101.IncreaseTaskTypeColumnSizeInCeActivity.TABLE_NAME;
-public class IncreaseTaskTypeColumnSizeInCeActivityIT {
+class IncreaseTaskTypeColumnSizeInCeActivityIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(IncreaseTaskTypeColumnSizeInCeActivity.class);
private final IncreaseTaskTypeColumnSizeInCeActivity underTest = new IncreaseTaskTypeColumnSizeInCeActivity(db.database());
@Test
- public void execute_increaseColumnSize() throws SQLException {
+ void execute_increaseColumnSize() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 15, false);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, NEW_COLUMN_SIZE, false);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 15, false);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseTaskTypeColumnSizeInCeQueueIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseTaskTypeColumnSizeInCeQueueIT.java
index 7a5f2f2b4bc..7aa1d4f40e7 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseTaskTypeColumnSizeInCeQueueIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/IncreaseTaskTypeColumnSizeInCeQueueIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
@@ -29,21 +29,21 @@ import static org.sonar.server.platform.db.migration.version.v101.IncreaseTaskTy
import static org.sonar.server.platform.db.migration.version.v101.IncreaseTaskTypeColumnSizeInCeQueue.NEW_COLUMN_SIZE;
import static org.sonar.server.platform.db.migration.version.v101.IncreaseTaskTypeColumnSizeInCeQueue.TABLE_NAME;
-public class IncreaseTaskTypeColumnSizeInCeQueueIT {
+class IncreaseTaskTypeColumnSizeInCeQueueIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(IncreaseTaskTypeColumnSizeInCeQueue.class);
private final IncreaseTaskTypeColumnSizeInCeQueue underTest = new IncreaseTaskTypeColumnSizeInCeQueue(db.database());
@Test
- public void execute_increaseColumnSize() throws SQLException {
+ void execute_increaseColumnSize() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 15, false);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, NEW_COLUMN_SIZE, false);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 15, false);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/MigrateScmAccountsFromUsersToScmAccountsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/MigrateScmAccountsFromUsersToScmAccountsIT.java
index 581bf7f5bec..5832df0d2bf 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/MigrateScmAccountsFromUsersToScmAccountsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/MigrateScmAccountsFromUsersToScmAccountsIT.java
@@ -25,8 +25,8 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactory;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -39,19 +39,19 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatNoException;
import static org.sonar.server.platform.db.migration.version.v101.MigrateScmAccountsFromUsersToScmAccounts.SCM_ACCOUNTS_SEPARATOR_CHAR;
-public class MigrateScmAccountsFromUsersToScmAccountsIT {
+class MigrateScmAccountsFromUsersToScmAccountsIT {
private static final UuidFactory UUID_FACTORY = UuidFactoryFast.getInstance();
private static final String SCM_ACCOUNT1 = "scmaccount";
private static final String SCM_ACCOUNT2 = "scmaccount2";
private static final String SCM_ACCOUNT_CAMELCASE = "scmAccount3";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(MigrateScmAccountsFromUsersToScmAccounts.class);
private final DataChange migrateScmAccountsFromUsersToScmAccounts = new MigrateScmAccountsFromUsersToScmAccounts(db.database());
@Test
- public void execute_whenUserHasNullScmAccounts_doNotInsertInScmAccounts() throws SQLException {
+ void execute_whenUserHasNullScmAccounts_doNotInsertInScmAccounts() throws SQLException {
insertUserAndGetUuid(null);
migrateScmAccountsFromUsersToScmAccounts.execute();
@@ -61,7 +61,7 @@ public class MigrateScmAccountsFromUsersToScmAccountsIT {
}
@Test
- public void execute_whenUserHasEmptyScmAccounts_doNotInsertInScmAccounts() throws SQLException {
+ void execute_whenUserHasEmptyScmAccounts_doNotInsertInScmAccounts() throws SQLException {
insertUserAndGetUuid("");
migrateScmAccountsFromUsersToScmAccounts.execute();
@@ -71,7 +71,7 @@ public class MigrateScmAccountsFromUsersToScmAccountsIT {
}
@Test
- public void execute_whenUserHasEmptyScmAccountsWithOneSeparator_doNotInsertInScmAccounts() throws SQLException {
+ void execute_whenUserHasEmptyScmAccountsWithOneSeparator_doNotInsertInScmAccounts() throws SQLException {
insertUserAndGetUuid(String.valueOf(SCM_ACCOUNTS_SEPARATOR_CHAR));
migrateScmAccountsFromUsersToScmAccounts.execute();
@@ -81,7 +81,7 @@ public class MigrateScmAccountsFromUsersToScmAccountsIT {
}
@Test
- public void execute_whenUserHasEmptyScmAccountsWithTwoSeparators_doNotInsertInScmAccounts() throws SQLException {
+ void execute_whenUserHasEmptyScmAccountsWithTwoSeparators_doNotInsertInScmAccounts() throws SQLException {
insertUserAndGetUuid(SCM_ACCOUNTS_SEPARATOR_CHAR + String.valueOf(SCM_ACCOUNTS_SEPARATOR_CHAR));
migrateScmAccountsFromUsersToScmAccounts.execute();
@@ -91,7 +91,7 @@ public class MigrateScmAccountsFromUsersToScmAccountsIT {
}
@Test
- public void execute_whenUserHasOneScmAccountWithoutSeparator_insertsInScmAccounts() throws SQLException {
+ void execute_whenUserHasOneScmAccountWithoutSeparator_insertsInScmAccounts() throws SQLException {
String userUuid = insertUserAndGetUuid(SCM_ACCOUNT1);
migrateScmAccountsFromUsersToScmAccounts.execute();
@@ -101,7 +101,7 @@ public class MigrateScmAccountsFromUsersToScmAccountsIT {
}
@Test
- public void execute_whenUserHasOneScmAccountWithSeparators_insertsInScmAccounts() throws SQLException {
+ void execute_whenUserHasOneScmAccountWithSeparators_insertsInScmAccounts() throws SQLException {
String userUuid = insertUserAndGetUuid(format("%s%s%s", SCM_ACCOUNTS_SEPARATOR_CHAR, SCM_ACCOUNT1, SCM_ACCOUNTS_SEPARATOR_CHAR));
migrateScmAccountsFromUsersToScmAccounts.execute();
@@ -111,7 +111,7 @@ public class MigrateScmAccountsFromUsersToScmAccountsIT {
}
@Test
- public void execute_whenUserHasOneScmAccountWithMixedCase_insertsInScmAccountsInLowerCase() throws SQLException {
+ void execute_whenUserHasOneScmAccountWithMixedCase_insertsInScmAccountsInLowerCase() throws SQLException {
String userUuid = insertUserAndGetUuid(format("%s%s%s", SCM_ACCOUNTS_SEPARATOR_CHAR, SCM_ACCOUNT_CAMELCASE, SCM_ACCOUNTS_SEPARATOR_CHAR));
migrateScmAccountsFromUsersToScmAccounts.execute();
@@ -121,7 +121,7 @@ public class MigrateScmAccountsFromUsersToScmAccountsIT {
}
@Test
- public void execute_whenUserHasTwoScmAccount_insertsInScmAccounts() throws SQLException {
+ void execute_whenUserHasTwoScmAccount_insertsInScmAccounts() throws SQLException {
String userUuid = insertUserAndGetUuid(format("%s%s%s%s%s",
SCM_ACCOUNTS_SEPARATOR_CHAR, SCM_ACCOUNT1, SCM_ACCOUNTS_SEPARATOR_CHAR, SCM_ACCOUNT2, SCM_ACCOUNTS_SEPARATOR_CHAR));
@@ -135,7 +135,7 @@ public class MigrateScmAccountsFromUsersToScmAccountsIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
String userUuid = insertUserAndGetUuid(SCM_ACCOUNT1);
migrateScmAccountsFromUsersToScmAccounts.execute();
@@ -146,7 +146,7 @@ public class MigrateScmAccountsFromUsersToScmAccountsIT {
}
@Test
- public void migration_should_be_reentrant_if_scm_account_column_dropped() {
+ void migration_should_be_reentrant_if_scm_account_column_dropped() {
db.executeDdl("alter table users drop column scm_accounts");
assertThatNoException().isThrownBy(migrateScmAccountsFromUsersToScmAccounts::execute);
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateProjectUuidInUserTokensIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateProjectUuidInUserTokensIT.java
index 956cfbda16f..81deca542e4 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateProjectUuidInUserTokensIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateProjectUuidInUserTokensIT.java
@@ -23,8 +23,8 @@ import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactory;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -33,16 +33,16 @@ import org.sonar.server.platform.db.migration.step.DataChange;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.groups.Tuple.tuple;
-public class PopulateProjectUuidInUserTokensIT {
+class PopulateProjectUuidInUserTokensIT {
private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateProjectUuidInUserTokens.class);
private final DataChange underTest = new PopulateProjectUuidInUserTokens(db.database());
@Test
- public void migration_populates_project_uuid_for_tokens() throws SQLException {
+ void migration_populates_project_uuid_for_tokens() throws SQLException {
String project1Uuid = insertProject("project1");
String project2Uuid = insertProject("project2");
@@ -62,7 +62,7 @@ public class PopulateProjectUuidInUserTokensIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
String project1Uuid = insertProject("project1");
String project2Uuid = insertProject("project2");
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSchedulesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSchedulesIT.java
index 5cd05bd2230..e121b2b2381 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSchedulesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSchedulesIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactory;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -30,15 +30,15 @@ import org.sonar.server.platform.db.migration.step.DataChange;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
-public class PopulateReportSchedulesIT {
- @Rule
+class PopulateReportSchedulesIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateReportSchedules.class);
private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
private final DataChange underTest = new PopulateReportSchedules(db.database());
@Test
- public void execute_shouldPopulateFromPortfolioProperties() throws SQLException {
+ void execute_shouldPopulateFromPortfolioProperties() throws SQLException {
insertPortfolio("uuid1");
insertPortfolioProperty("uuid1", "1234");
@@ -50,7 +50,7 @@ public class PopulateReportSchedulesIT {
}
@Test
- public void execute_shouldPopulateFromBranchProperties() throws SQLException {
+ void execute_shouldPopulateFromBranchProperties() throws SQLException {
insertBranch("uuid1");
insertProjectBranchProperty("uuid1", "1234");
@@ -62,7 +62,7 @@ public class PopulateReportSchedulesIT {
}
@Test
- public void execute_whenPropertyMatchesBothBranchAndPortfolio_shouldNotPopulate() throws SQLException {
+ void execute_whenPropertyMatchesBothBranchAndPortfolio_shouldNotPopulate() throws SQLException {
insertBranch("uuid1");
insertPortfolio("uuid1");
insertProjectBranchProperty("uuid1", "1234");
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSubscriptionsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSubscriptionsIT.java
index e122c3e700b..9844e08d85e 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSubscriptionsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/PopulateReportSubscriptionsIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactory;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -30,15 +30,15 @@ import org.sonar.server.platform.db.migration.step.DataChange;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
-public class PopulateReportSubscriptionsIT {
- @Rule
+class PopulateReportSubscriptionsIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateReportSubscriptions.class);
private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
private final DataChange underTest = new PopulateReportSubscriptions(db.database());
@Test
- public void execute_shouldPopulateFromPortfolioProperties() throws SQLException {
+ void execute_shouldPopulateFromPortfolioProperties() throws SQLException {
insertPortfolio("uuid1");
insertPortfolioProperty("uuid1", "1234");
@@ -50,7 +50,7 @@ public class PopulateReportSubscriptionsIT {
}
@Test
- public void execute_shouldPopulateFromBranchProperties() throws SQLException {
+ void execute_shouldPopulateFromBranchProperties() throws SQLException {
insertBranch("uuid1");
insertBranchProperty("uuid1", "1234");
@@ -62,7 +62,7 @@ public class PopulateReportSubscriptionsIT {
}
@Test
- public void execute_whenPropertyMatchesBothBranchAndPortfolio_shouldNotPopulate() throws SQLException {
+ void execute_whenPropertyMatchesBothBranchAndPortfolio_shouldNotPopulate() throws SQLException {
insertBranch("uuid1");
insertPortfolio("uuid1");
insertBranchProperty("uuid1", "1234");
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RemoveOrphanUserTokensIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RemoveOrphanUserTokensIT.java
index 12221063acf..1c126124a5b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RemoveOrphanUserTokensIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RemoveOrphanUserTokensIT.java
@@ -23,8 +23,8 @@ import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactory;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -32,16 +32,16 @@ import org.sonar.server.platform.db.migration.step.DataChange;
import static org.assertj.core.api.Assertions.assertThat;
-public class RemoveOrphanUserTokensIT {
+class RemoveOrphanUserTokensIT {
private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RemoveOrphanUserTokens.class);
private final DataChange underTest = new RemoveOrphanUserTokens(db.database());
@Test
- public void migration_deletes_orphan_tokens() throws SQLException {
+ void migration_deletes_orphan_tokens() throws SQLException {
String project1Uuid = insertProject("project1");
String token1Uuid = insertUserToken("project1");
@@ -55,7 +55,7 @@ public class RemoveOrphanUserTokensIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
String project1Uuid = insertProject("project1");
String token1Uuid = insertUserToken("project1");
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RemoveReportPropertiesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RemoveReportPropertiesIT.java
index 7514f6da085..71a9d4d412d 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RemoveReportPropertiesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RemoveReportPropertiesIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactory;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -29,13 +29,13 @@ import org.sonar.server.platform.db.migration.step.DataChange;
import static org.assertj.core.api.Assertions.assertThat;
-public class RemoveReportPropertiesIT {
+class RemoveReportPropertiesIT {
private static final String SONAR_GOVERNANCE_REPORT_USER_NOTIFICATION = "sonar.governance.report.userNotification";
private static final String SONAR_GOVERNANCE_REPORT_PROJECT_BRANCH_USER_NOTIFICATION = "sonar.governance.report.project.branch.userNotification";
private static final String SONAR_GOVERNANCE_REPORT_LAST_SEND_TIME_IN_MS = "sonar.governance.report.lastSendTimeInMs";
private static final String SONAR_GOVERNANCE_REPORT_PROJECT_BRANCH_LAST_SEND_TIME_IN_MS = "sonar.governance.report.project.branch.lastSendTimeInMs";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RemoveReportProperties.class);
private final DataChange underTest = new RemoveReportProperties(db.database());
@@ -43,7 +43,7 @@ public class RemoveReportPropertiesIT {
private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
@Test
- public void execute_shouldRemoveRelevantPropertiesFromTable() throws SQLException {
+ void execute_shouldRemoveRelevantPropertiesFromTable() throws SQLException {
insertProperty( "branch_uuid", "user_uuid", SONAR_GOVERNANCE_REPORT_USER_NOTIFICATION, "true");
insertProperty( "portfolio_uuid", "user_uuid", SONAR_GOVERNANCE_REPORT_PROJECT_BRANCH_USER_NOTIFICATION, "true");
insertProperty( "branch_uuid", "user_uuid", SONAR_GOVERNANCE_REPORT_LAST_SEND_TIME_IN_MS, "12");
@@ -57,7 +57,7 @@ public class RemoveReportPropertiesIT {
}
@Test
- public void execute_shouldBeIdempotent() throws SQLException {
+ void execute_shouldBeIdempotent() throws SQLException {
insertProperty( "branch_uuid", "user_uuid", SONAR_GOVERNANCE_REPORT_USER_NOTIFICATION, "true");
insertProperty( "portfolio_uuid", "user_uuid", SONAR_GOVERNANCE_REPORT_PROJECT_BRANCH_USER_NOTIFICATION, "true");
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RenameColumnComponentUuidInPropertiesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RenameColumnComponentUuidInPropertiesIT.java
index b3a5dbb67cf..858359f96bb 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RenameColumnComponentUuidInPropertiesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/RenameColumnComponentUuidInPropertiesIT.java
@@ -20,30 +20,30 @@
package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
-public class RenameColumnComponentUuidInPropertiesIT {
+class RenameColumnComponentUuidInPropertiesIT {
public static final String TABLE_NAME = "properties";
public static final String NEW_COLUMN_NAME = "entity_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RenameColumnComponentUuidInProperties.class);
private final RenameColumnComponentUuidInProperties underTest = new RenameColumnComponentUuidInProperties(db.database());
@Test
- public void columnIsRenamed() throws SQLException {
+ void columnIsRenamed() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, NEW_COLUMN_NAME, VARCHAR, 40, true);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/UpdateIsMainColumnInProjectBranchesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/UpdateIsMainColumnInProjectBranchesIT.java
index 5ffcbf95f84..a4c5310ac2b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/UpdateIsMainColumnInProjectBranchesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v101/UpdateIsMainColumnInProjectBranchesIT.java
@@ -22,8 +22,8 @@ package org.sonar.server.platform.db.migration.version.v101;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactory;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -31,11 +31,11 @@ import org.sonar.server.platform.db.migration.step.DataChange;
import static org.assertj.core.api.Assertions.assertThat;
-public class UpdateIsMainColumnInProjectBranchesIT {
+class UpdateIsMainColumnInProjectBranchesIT {
private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(UpdateIsMainColumnInProjectBranches.class);
private final DataChange underTest = new UpdateIsMainColumnInProjectBranches(db.database());
@@ -43,7 +43,7 @@ public class UpdateIsMainColumnInProjectBranchesIT {
private static int not_random_value_always_incremented = 0;
@Test
- public void migration_updates_is_main_if_row_has_the_same_uuids() throws SQLException {
+ void migration_updates_is_main_if_row_has_the_same_uuids() throws SQLException {
String branchUuid1 = insertProjectBranch(true);
String branchUuid2 = insertProjectBranch(false);
@@ -54,7 +54,7 @@ public class UpdateIsMainColumnInProjectBranchesIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
String branchUuid1 = insertProjectBranch(true);
String branchUuid2 = insertProjectBranch(false);
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/AddCleanCodeAttributeInRulesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/AddCleanCodeAttributeInRulesIT.java
index 8aa39e34095..c67e5674853 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/AddCleanCodeAttributeInRulesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/AddCleanCodeAttributeInRulesIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class AddCleanCodeAttributeInRulesIT {
+class AddCleanCodeAttributeInRulesIT {
private static final String TABLE_NAME = "rules";
private static final String COLUMN_NAME = "clean_code_attribute";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddCleanCodeAttributeInRules.class);
private final AddCleanCodeAttributeInRules underTest = new AddCleanCodeAttributeInRules(db.database());
@Test
- public void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
+ void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 40, true);
}
@Test
- public void execute_whenExecutedTwice_shouldNotFail() throws SQLException {
+ void execute_whenExecutedTwice_shouldNotFail() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/AddUserConsentRequiredIfGithubAutoProvisioningEnabledIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/AddUserConsentRequiredIfGithubAutoProvisioningEnabledIT.java
index 680cc120816..a3a8a410d42 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/AddUserConsentRequiredIfGithubAutoProvisioningEnabledIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/AddUserConsentRequiredIfGithubAutoProvisioningEnabledIT.java
@@ -20,11 +20,11 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.slf4j.event.Level;
-import org.sonar.api.testfixtures.log.LogTester;
+import org.sonar.api.testfixtures.log.LogTesterJUnit5;
import org.sonar.api.utils.System2;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -34,22 +34,22 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.platform.db.migration.version.v102.AddUserConsentRequiredIfGithubAutoProvisioningEnabled.PROP_KEY;
import static org.sonar.server.platform.db.migration.version.v102.AddUserConsentRequiredIfGithubAutoProvisioningEnabled.PROVISIONING_GITHUB_ENABLED_PROP_KEY;
-public class AddUserConsentRequiredIfGithubAutoProvisioningEnabledIT {
+class AddUserConsentRequiredIfGithubAutoProvisioningEnabledIT {
- @Rule
- public LogTester logger = new LogTester();
+ @RegisterExtension
+ public final LogTesterJUnit5 logger = new LogTesterJUnit5();
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddUserConsentRequiredIfGithubAutoProvisioningEnabled.class);
private final DataChange underTest = new AddUserConsentRequiredIfGithubAutoProvisioningEnabled(db.database(), new System2(), UuidFactoryFast.getInstance());
- @Before
+ @BeforeEach
public void before() {
logger.clear();
}
@Test
- public void migration_whenGitHubAutoProvisioningPropertyNotPresent_shouldNotRequireConsent() throws SQLException {
+ void migration_whenGitHubAutoProvisioningPropertyNotPresent_shouldNotRequireConsent() throws SQLException {
underTest.execute();
assertThat(logger.logs(Level.WARN)).isEmpty();
@@ -57,7 +57,7 @@ public class AddUserConsentRequiredIfGithubAutoProvisioningEnabledIT {
}
@Test
- public void migration_whenGitHubAutoProvisioningDisabled_shouldNotRequireConsent() throws SQLException {
+ void migration_whenGitHubAutoProvisioningDisabled_shouldNotRequireConsent() throws SQLException {
disableGithubProvisioning();
underTest.execute();
@@ -66,7 +66,7 @@ public class AddUserConsentRequiredIfGithubAutoProvisioningEnabledIT {
}
@Test
- public void migration_whenGitHubAutoProvisioningEnabled_shouldRequireConsent() throws SQLException {
+ void migration_whenGitHubAutoProvisioningEnabled_shouldRequireConsent() throws SQLException {
enableGithubProvisioning();
underTest.execute();
@@ -77,7 +77,7 @@ public class AddUserConsentRequiredIfGithubAutoProvisioningEnabledIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
enableGithubProvisioning();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTableIT.java
index 3523a9bc70e..8502eb784bb 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateAnticipatedTransitionsTableIT.java
@@ -21,8 +21,8 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
@@ -31,14 +31,14 @@ import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.USER_U
import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE;
import static org.sonar.server.platform.db.migration.version.v102.CreateAnticipatedTransitionsTable.ANTICIPATED_TRANSITIONS_TABLE_NAME;
-public class CreateAnticipatedTransitionsTableIT {
- @Rule
+class CreateAnticipatedTransitionsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateAnticipatedTransitionsTable.class);
private final DdlChange createAnticipatedTransitionsTable = new CreateAnticipatedTransitionsTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(ANTICIPATED_TRANSITIONS_TABLE_NAME);
createAnticipatedTransitionsTable.execute();
@@ -58,7 +58,7 @@ public class CreateAnticipatedTransitionsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(ANTICIPATED_TRANSITIONS_TABLE_NAME);
createAnticipatedTransitionsTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateBooleanPurgedColumnInSnapshotsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateBooleanPurgedColumnInSnapshotsIT.java
index 8bdcec97eb6..9e1b00b27f6 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateBooleanPurgedColumnInSnapshotsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateBooleanPurgedColumnInSnapshotsIT.java
@@ -20,31 +20,31 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.BOOLEAN;
-public class CreateBooleanPurgedColumnInSnapshotsIT {
+class CreateBooleanPurgedColumnInSnapshotsIT {
private static final String TABLE_NAME = "snapshots";
private static final String COLUMN_NAME = "purged";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateBooleanPurgedColumnInSnapshots.class);
private final CreateBooleanPurgedColumnInSnapshots underTest = new CreateBooleanPurgedColumnInSnapshots(db.database());
@Test
- public void execute_whenColumnDoesNotExist_shouldCreatePurgedColumn() throws SQLException {
+ void execute_whenColumnDoesNotExist_shouldCreatePurgedColumn() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, null);
}
@Test
- public void execute_whenExecutedTwice_shouldNotFail() throws SQLException {
+ void execute_whenExecutedTwice_shouldNotFail() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateGithubOrganizationsGroupsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateGithubOrganizationsGroupsTableIT.java
index 0a64062bcc0..e75a7871cf1 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateGithubOrganizationsGroupsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateGithubOrganizationsGroupsTableIT.java
@@ -21,8 +21,8 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
@@ -31,13 +31,13 @@ import static org.sonar.server.platform.db.migration.version.v102.CreateGithubOr
import static org.sonar.server.platform.db.migration.version.v102.CreateGithubOrganizationsGroupsTable.ORGANIZATION_COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v102.CreateGithubOrganizationsGroupsTable.TABLE_NAME;
-public class CreateGithubOrganizationsGroupsTableIT {
- @Rule
+class CreateGithubOrganizationsGroupsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateGithubOrganizationsGroupsTable.class);
private final DdlChange createGithubOrganizationsGroupsTable = new CreateGithubOrganizationsGroupsTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
createGithubOrganizationsGroupsTable.execute();
@@ -49,7 +49,7 @@ public class CreateGithubOrganizationsGroupsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
createGithubOrganizationsGroupsTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexCreatedAtInWebhookDeliveriesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexCreatedAtInWebhookDeliveriesIT.java
index 64a2f92532e..0e5a518f38b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexCreatedAtInWebhookDeliveriesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexCreatedAtInWebhookDeliveriesIT.java
@@ -20,22 +20,22 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class CreateIndexCreatedAtInWebhookDeliveriesIT {
+class CreateIndexCreatedAtInWebhookDeliveriesIT {
public static final String TABLE_NAME = "webhook_deliveries";
public static final String INDEX_NAME = "wd_created_at";
public static final String EXPECTED_COLUMN = "created_at";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexCreatedAtInWebhookDeliveries.class);
private final DdlChange createIndex = new CreateIndexCreatedAtInWebhookDeliveries(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
createIndex.execute();
@@ -44,7 +44,7 @@ public class CreateIndexCreatedAtInWebhookDeliveriesIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInCeActivityIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInCeActivityIT.java
index 6b98a3e4b9a..fc2b0a945b4 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInCeActivityIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInCeActivityIT.java
@@ -20,17 +20,17 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class CreateIndexEntityUuidInCeActivityIT {
- @Rule
+class CreateIndexEntityUuidInCeActivityIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexEntityUuidInCeActivity.class);
private final CreateIndexEntityUuidInCeActivity createIndex = new CreateIndexEntityUuidInCeActivity(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist("ce_activity", "ce_activity_entity_uuid");
createIndex.execute();
@@ -39,7 +39,7 @@ public class CreateIndexEntityUuidInCeActivityIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInCeQueueIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInCeQueueIT.java
index 24d8a20d522..e743789a579 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInCeQueueIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInCeQueueIT.java
@@ -20,17 +20,17 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class CreateIndexEntityUuidInCeQueueIT {
- @Rule
+class CreateIndexEntityUuidInCeQueueIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexEntityUuidInCeQueue.class);
private final CreateIndexEntityUuidInCeQueue createIndex = new CreateIndexEntityUuidInCeQueue(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist("ce_queue", "ce_queue_entity_uuid");
createIndex.execute();
@@ -39,7 +39,7 @@ public class CreateIndexEntityUuidInCeQueueIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInGroupRolesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInGroupRolesIT.java
index 71845c4bb2a..55b4ff0de1d 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInGroupRolesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInGroupRolesIT.java
@@ -20,17 +20,17 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class CreateIndexEntityUuidInGroupRolesIT {
- @Rule
+class CreateIndexEntityUuidInGroupRolesIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexEntityUuidInGroupRoles.class);
private final CreateIndexEntityUuidInGroupRoles createIndex = new CreateIndexEntityUuidInGroupRoles(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist("group_roles", "group_roles_entity_uuid");
createIndex.execute();
@@ -39,7 +39,7 @@ public class CreateIndexEntityUuidInGroupRolesIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInUserRolesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInUserRolesIT.java
index 4f6b1555645..e737ea653ad 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInUserRolesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexEntityUuidInUserRolesIT.java
@@ -20,17 +20,17 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class CreateIndexEntityUuidInUserRolesIT {
- @Rule
+class CreateIndexEntityUuidInUserRolesIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexEntityUuidInUserRoles.class);
private final CreateIndexEntityUuidInUserRoles createIndex = new CreateIndexEntityUuidInUserRoles(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist("user_roles", "user_roles_entity_uuid");
createIndex.execute();
@@ -39,7 +39,7 @@ public class CreateIndexEntityUuidInUserRolesIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexProjectUuidCreatedAtInWebhookDeliveriesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexProjectUuidCreatedAtInWebhookDeliveriesIT.java
index 0425192ab12..3e3556653a1 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexProjectUuidCreatedAtInWebhookDeliveriesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexProjectUuidCreatedAtInWebhookDeliveriesIT.java
@@ -20,22 +20,22 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class CreateIndexProjectUuidCreatedAtInWebhookDeliveriesIT {
+class CreateIndexProjectUuidCreatedAtInWebhookDeliveriesIT {
public static final String TABLE_NAME = "webhook_deliveries";
public static final String INDEX_NAME = "wd_project_uuid_created_at";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexProjectUuidCreatedAtInWebhookDeliveries.class);
private final DdlChange createIndex = new CreateIndexProjectUuidCreatedAtInWebhookDeliveries(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
createIndex.execute();
@@ -44,7 +44,7 @@ public class CreateIndexProjectUuidCreatedAtInWebhookDeliveriesIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexProjectUuidInProjectBranchesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexProjectUuidInProjectBranchesIT.java
index ad44b2c6851..38b4e265bd2 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexProjectUuidInProjectBranchesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexProjectUuidInProjectBranchesIT.java
@@ -20,19 +20,19 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class CreateIndexProjectUuidInProjectBranchesIT {
- @Rule
+class CreateIndexProjectUuidInProjectBranchesIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexProjectUuidInProjectBranches.class);
private final CreateIndexProjectUuidInProjectBranches createIndex = new CreateIndexProjectUuidInProjectBranches(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist("project_branches", "project_branches_project_uuid");
createIndex.execute();
@@ -41,7 +41,7 @@ public class CreateIndexProjectUuidInProjectBranchesIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexRootComponentUuidInSnapshotsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexRootComponentUuidInSnapshotsIT.java
index ca8b2985236..04b14d0ecd7 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexRootComponentUuidInSnapshotsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexRootComponentUuidInSnapshotsIT.java
@@ -20,19 +20,19 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class CreateIndexRootComponentUuidInSnapshotsIT {
- @Rule
+class CreateIndexRootComponentUuidInSnapshotsIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexRootComponentUuidInSnapshots.class);
private final CreateIndexRootComponentUuidInSnapshots createIndex = new CreateIndexRootComponentUuidInSnapshots(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist("snapshots", "snapshots_root_component_uuid");
createIndex.execute();
@@ -41,7 +41,7 @@ public class CreateIndexRootComponentUuidInSnapshotsIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexTaskUuidCreatedAtInWebhookDeliveriesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexTaskUuidCreatedAtInWebhookDeliveriesIT.java
index e73cd2d789d..64c9930db58 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexTaskUuidCreatedAtInWebhookDeliveriesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexTaskUuidCreatedAtInWebhookDeliveriesIT.java
@@ -20,22 +20,22 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class CreateIndexTaskUuidCreatedAtInWebhookDeliveriesIT {
+class CreateIndexTaskUuidCreatedAtInWebhookDeliveriesIT {
public static final String TABLE_NAME = "webhook_deliveries";
public static final String INDEX_NAME = "wd_ce_task_uuid_created_at";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexTaskUuidCreatedAtInWebhookDeliveries.class);
private final DdlChange createIndex = new CreateIndexTaskUuidCreatedAtInWebhookDeliveries(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
createIndex.execute();
@@ -44,7 +44,7 @@ public class CreateIndexTaskUuidCreatedAtInWebhookDeliveriesIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexWebhookUuidCreatedAtInWebhookDeliveriesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexWebhookUuidCreatedAtInWebhookDeliveriesIT.java
index 9b11b1a8b20..1a3f2070d52 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexWebhookUuidCreatedAtInWebhookDeliveriesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIndexWebhookUuidCreatedAtInWebhookDeliveriesIT.java
@@ -20,22 +20,22 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class CreateIndexWebhookUuidCreatedAtInWebhookDeliveriesIT {
+class CreateIndexWebhookUuidCreatedAtInWebhookDeliveriesIT {
public static final String TABLE_NAME = "webhook_deliveries";
public static final String INDEX_NAME = "wd_webhook_uuid_created_at";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexWebhookUuidCreatedAtInWebhookDeliveries.class);
private final DdlChange createIndex = new CreateIndexWebhookUuidCreatedAtInWebhookDeliveries(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
createIndex.execute();
@@ -44,7 +44,7 @@ public class CreateIndexWebhookUuidCreatedAtInWebhookDeliveriesIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIssueImpactsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIssueImpactsTableIT.java
index 9918337a186..10a0abe06e7 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIssueImpactsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateIssueImpactsTableIT.java
@@ -21,21 +21,21 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class CreateIssueImpactsTableIT {
+class CreateIssueImpactsTableIT {
private static final String EXPECTED_TABLE_NAME = "issues_impacts";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIssueImpactsTable.class);
private final DdlChange underTest = new CreateIssueImpactsTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(EXPECTED_TABLE_NAME);
underTest.execute();
@@ -48,7 +48,7 @@ public class CreateIssueImpactsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(EXPECTED_TABLE_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreatePreviousNonCompliantValueInNewCodePeriodsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreatePreviousNonCompliantValueInNewCodePeriodsIT.java
index eac2365c702..347e2082015 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreatePreviousNonCompliantValueInNewCodePeriodsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreatePreviousNonCompliantValueInNewCodePeriodsIT.java
@@ -20,31 +20,31 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
-public class CreatePreviousNonCompliantValueInNewCodePeriodsIT {
+class CreatePreviousNonCompliantValueInNewCodePeriodsIT {
private static final String COLUMN_NAME= "previous_non_compliant_value";
private static final String TABLE_NAME = "new_code_periods";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreatePreviousNonCompliantValueInNewCodePeriods.class);
private final CreatePreviousNonCompliantValueInNewCodePeriods underTest = new CreatePreviousNonCompliantValueInNewCodePeriods(db.database());
@Test
- public void execute_whenColumnDoesNotExist_shouldCreatePurgedColumn() throws SQLException {
+ void execute_whenColumnDoesNotExist_shouldCreatePurgedColumn() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 255, null);
}
@Test
- public void execute_whenExecutedTwice_shouldNotFail() throws SQLException {
+ void execute_whenExecutedTwice_shouldNotFail() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateRulesDefaultImpactsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateRulesDefaultImpactsTableIT.java
index 12a4c3bcbaa..6aaf17fe9e8 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateRulesDefaultImpactsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateRulesDefaultImpactsTableIT.java
@@ -21,22 +21,22 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class CreateRulesDefaultImpactsTableIT {
+class CreateRulesDefaultImpactsTableIT {
private static final String EXPECTED_TABLE_NAME = "rules_default_impacts";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateRulesDefaultImpactsTable.class);
private final DdlChange underTest = new CreateRulesDefaultImpactsTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(EXPECTED_TABLE_NAME);
underTest.execute();
@@ -49,7 +49,7 @@ public class CreateRulesDefaultImpactsTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(EXPECTED_TABLE_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateUniqueConstraintOnIssuesImpactsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateUniqueConstraintOnIssuesImpactsIT.java
index d780a2f1525..57983e20c16 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateUniqueConstraintOnIssuesImpactsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateUniqueConstraintOnIssuesImpactsIT.java
@@ -20,19 +20,19 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class CreateUniqueConstraintOnIssuesImpactsIT {
- @Rule
+class CreateUniqueConstraintOnIssuesImpactsIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateUniqueConstraintOnIssuesImpacts.class);
private final CreateUniqueConstraintOnIssuesImpacts underTest = new CreateUniqueConstraintOnIssuesImpacts(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist("issues_impacts", "uniq_iss_key_sof_qual");
underTest.execute();
@@ -41,7 +41,7 @@ public class CreateUniqueConstraintOnIssuesImpactsIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateUniqueConstraintOnRulesDefaultImpactsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateUniqueConstraintOnRulesDefaultImpactsIT.java
index 437244b01ab..0877b914838 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateUniqueConstraintOnRulesDefaultImpactsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/CreateUniqueConstraintOnRulesDefaultImpactsIT.java
@@ -20,20 +20,20 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class CreateUniqueConstraintOnRulesDefaultImpactsIT {
- @Rule
+class CreateUniqueConstraintOnRulesDefaultImpactsIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateUniqueConstraintOnRulesDefaultImpacts.class);
private final CreateUniqueConstraintOnRulesDefaultImpacts underTest = new CreateUniqueConstraintOnRulesDefaultImpacts(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist("rules_default_impacts", "uniq_rul_uuid_sof_qual");
underTest.execute();
@@ -42,7 +42,7 @@ public class CreateUniqueConstraintOnRulesDefaultImpactsIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInGroupRolesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInGroupRolesIT.java
index 912fc4c7105..ab5ee3b31a4 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInGroupRolesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInGroupRolesIT.java
@@ -20,14 +20,14 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.CoreDbTester;
import org.sonar.db.MigrationDbTester;
-public class DropIndexComponentUuidInGroupRolesIT {
+class DropIndexComponentUuidInGroupRolesIT {
private static final String TABLE_NAME = "group_roles";
private static final String COLUMN_NAME = "component_uuid";
@@ -37,12 +37,12 @@ public class DropIndexComponentUuidInGroupRolesIT {
* {@link MigrationDbTester} is not used because we are expecting index with component_uuid to exist. However, renaming the column component_uuid to entity_uuid
* also updated the index
*/
- @Rule
+ @RegisterExtension
public final CoreDbTester db = CoreDbTester.createForSchema(DropIndexComponentUuidInGroupRolesIT.class, "schema.sql");
private final DropIndexComponentUuidInGroupRoles underTest = new DropIndexComponentUuidInGroupRoles(db.database());
@Test
- public void index_is_dropped() throws SQLException {
+ void index_is_dropped() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
@@ -51,7 +51,7 @@ public class DropIndexComponentUuidInGroupRolesIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInSnapshotsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInSnapshotsIT.java
index 666646f780e..2f022420316 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInSnapshotsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInSnapshotsIT.java
@@ -20,24 +20,24 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class DropIndexComponentUuidInSnapshotsIT {
+class DropIndexComponentUuidInSnapshotsIT {
private static final String TABLE_NAME = "snapshots";
private static final String COLUMN_NAME = "component_uuid";
private static final String INDEX_NAME = "snapshot_component";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropIndexComponentUuidInSnapshots.class);
private final DropIndexComponentUuidInSnapshots underTest = new DropIndexComponentUuidInSnapshots(db.database());
@Test
- public void index_is_dropped() throws SQLException {
+ void index_is_dropped() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
@@ -46,7 +46,7 @@ public class DropIndexComponentUuidInSnapshotsIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInUserRolesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInUserRolesIT.java
index 403e472a5ca..10fc0b5d4b3 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInUserRolesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInUserRolesIT.java
@@ -20,14 +20,14 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.CoreDbTester;
import org.sonar.db.MigrationDbTester;
-public class DropIndexComponentUuidInUserRolesIT {
+class DropIndexComponentUuidInUserRolesIT {
private static final String TABLE_NAME = "user_roles";
private static final String COLUMN_NAME = "component_uuid";
@@ -37,12 +37,12 @@ public class DropIndexComponentUuidInUserRolesIT {
* {@link MigrationDbTester} is not used because we are expecting index with component_uuid to exist. However, renaming the column component_uuid to entity_uuid
* also updated the index
*/
- @Rule
+ @RegisterExtension
public final CoreDbTester db = CoreDbTester.createForSchema(DropIndexComponentUuidInUserRolesIT.class, "schema.sql");
private final DropIndexComponentUuidInUserRoles underTest = new DropIndexComponentUuidInUserRoles(db.database());
@Test
- public void index_is_dropped() throws SQLException {
+ void index_is_dropped() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
@@ -51,7 +51,7 @@ public class DropIndexComponentUuidInUserRolesIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInWebhookDeliveriesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInWebhookDeliveriesIT.java
index cd578fcc5f5..25736409eb3 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInWebhookDeliveriesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexComponentUuidInWebhookDeliveriesIT.java
@@ -20,24 +20,24 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class DropIndexComponentUuidInWebhookDeliveriesIT {
+class DropIndexComponentUuidInWebhookDeliveriesIT {
private static final String TABLE_NAME = "webhook_deliveries";
private static final String COLUMN_NAME = "component_uuid";
private static final String INDEX_NAME = "component_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropIndexComponentUuidInWebhookDeliveries.class);
private final DropIndexComponentUuidInWebhookDeliveries underTest = new DropIndexComponentUuidInWebhookDeliveries(db.database());
@Test
- public void index_is_dropped() throws SQLException {
+ void index_is_dropped() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
@@ -46,7 +46,7 @@ public class DropIndexComponentUuidInWebhookDeliveriesIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexMainComponentUuidInCeActivityIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexMainComponentUuidInCeActivityIT.java
index 09f4e195af3..289562e850f 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexMainComponentUuidInCeActivityIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexMainComponentUuidInCeActivityIT.java
@@ -20,24 +20,24 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class DropIndexMainComponentUuidInCeActivityIT {
+class DropIndexMainComponentUuidInCeActivityIT {
private static final String TABLE_NAME = "ce_activity";
private static final String COLUMN_NAME = "main_component_uuid";
private static final String INDEX_NAME = "ce_activity_main_component";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropIndexMainComponentUuidInCeActivity.class);
private final DropIndexMainComponentUuidInCeActivity underTest = new DropIndexMainComponentUuidInCeActivity(db.database());
@Test
- public void index_is_dropped() throws SQLException {
+ void index_is_dropped() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
@@ -46,7 +46,7 @@ public class DropIndexMainComponentUuidInCeActivityIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexMainComponentUuidInCeQueueIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexMainComponentUuidInCeQueueIT.java
index 7200ae997be..f57c06d4ab9 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexMainComponentUuidInCeQueueIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexMainComponentUuidInCeQueueIT.java
@@ -20,24 +20,24 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class DropIndexMainComponentUuidInCeQueueIT {
+class DropIndexMainComponentUuidInCeQueueIT {
private static final String TABLE_NAME = "ce_queue";
private static final String COLUMN_NAME = "main_component_uuid";
private static final String INDEX_NAME = "ce_queue_main_component";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropIndexMainComponentUuidInCeQueue.class);
private final DropIndexMainComponentUuidInCeQueue underTest = new DropIndexMainComponentUuidInCeQueue(db.database());
@Test
- public void index_is_dropped() throws SQLException {
+ void index_is_dropped() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
@@ -46,7 +46,7 @@ public class DropIndexMainComponentUuidInCeQueueIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexOnMainBranchProjectUuidIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexOnMainBranchProjectUuidIT.java
index 03fc68c2ee1..5361755735b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexOnMainBranchProjectUuidIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexOnMainBranchProjectUuidIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropIndexOnMainBranchProjectUuidIT {
+class DropIndexOnMainBranchProjectUuidIT {
private static final String TABLE_NAME = "components";
private static final String COLUMN_NAME = "main_branch_project_uuid";
private static final String INDEX_NAME = "idx_main_branch_prj_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropIndexOnMainBranchProjectUuid.class);
private final DdlChange underTest = new DropIndexOnMainBranchProjectUuid(db.database());
@Test
- public void drops_index() throws SQLException {
+ void drops_index() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexProjectUuidInWebhookDeliveriesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexProjectUuidInWebhookDeliveriesIT.java
index ffae2856175..73e0a4bb4ba 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexProjectUuidInWebhookDeliveriesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexProjectUuidInWebhookDeliveriesIT.java
@@ -20,13 +20,13 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.CoreDbTester;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropIndexProjectUuidInWebhookDeliveriesIT {
+class DropIndexProjectUuidInWebhookDeliveriesIT {
private static final String TABLE_NAME = "webhook_deliveries";
private static final String COLUMN_NAME = "project_uuid";
@@ -36,12 +36,12 @@ public class DropIndexProjectUuidInWebhookDeliveriesIT {
* {@link MigrationDbTester} is not used because we are expecting index with component_uuid to exist. However, renaming the column component_uuid to entity_uuid
* also updated the index
*/
- @Rule
+ @RegisterExtension
public final CoreDbTester db = CoreDbTester.createForSchema(DropIndexProjectUuidInWebhookDeliveriesIT.class, "schema.sql");
private final DdlChange underTest = new DropIndexProjectUuidInWebhookDeliveries(db.database());
@Test
- public void index_is_dropped() throws SQLException {
+ void index_is_dropped() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
@@ -50,7 +50,7 @@ public class DropIndexProjectUuidInWebhookDeliveriesIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexTaskUuidInWebhookDeliveriesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexTaskUuidInWebhookDeliveriesIT.java
index 322fb30e302..594de8a656b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexTaskUuidInWebhookDeliveriesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexTaskUuidInWebhookDeliveriesIT.java
@@ -20,23 +20,23 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropIndexTaskUuidInWebhookDeliveriesIT {
+class DropIndexTaskUuidInWebhookDeliveriesIT {
private static final String TABLE_NAME = "webhook_deliveries";
private static final String COLUMN_NAME = "ce_task_uuid";
private static final String INDEX_NAME = "ce_task_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropIndexTaskUuidInWebhookDeliveries.class);
private final DdlChange underTest = new DropIndexTaskUuidInWebhookDeliveries(db.database());
@Test
- public void index_is_dropped() throws SQLException {
+ void index_is_dropped() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
@@ -45,7 +45,7 @@ public class DropIndexTaskUuidInWebhookDeliveriesIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexWebhookUuidInWebhookDeliveriesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexWebhookUuidInWebhookDeliveriesIT.java
index 3653304ae3d..42fd7c23970 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexWebhookUuidInWebhookDeliveriesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropIndexWebhookUuidInWebhookDeliveriesIT.java
@@ -20,23 +20,23 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropIndexWebhookUuidInWebhookDeliveriesIT {
+class DropIndexWebhookUuidInWebhookDeliveriesIT {
private static final String TABLE_NAME = "webhook_deliveries";
private static final String COLUMN_NAME = "webhook_uuid";
private static final String INDEX_NAME = "idx_wbhk_dlvrs_wbhk_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropIndexWebhookUuidInWebhookDeliveries.class);
private final DdlChange underTest = new DropIndexWebhookUuidInWebhookDeliveries(db.database());
@Test
- public void index_is_dropped() throws SQLException {
+ void index_is_dropped() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
@@ -45,7 +45,7 @@ public class DropIndexWebhookUuidInWebhookDeliveriesIT {
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertIndex(TABLE_NAME, INDEX_NAME, COLUMN_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropMainBranchProjectUuidInComponentsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropMainBranchProjectUuidInComponentsIT.java
index 46d1e1a3755..b94f7f7dd3a 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropMainBranchProjectUuidInComponentsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropMainBranchProjectUuidInComponentsIT.java
@@ -21,29 +21,29 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
import static org.sonar.server.platform.db.migration.version.v102.DropMainBranchProjectUuidInComponents.COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v102.DropMainBranchProjectUuidInComponents.TABLE_NAME;
-public class DropMainBranchProjectUuidInComponentsIT {
+class DropMainBranchProjectUuidInComponentsIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropMainBranchProjectUuidInComponents.class);
private final DdlChange underTest = new DropMainBranchProjectUuidInComponents(db.database());
@Test
- public void drops_column() throws SQLException {
+ void drops_column() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 50, true);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 50, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropPurgeStatusColumnInSnapshotsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropPurgeStatusColumnInSnapshotsIT.java
index 211ae43b9ea..bd0f6d90734 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropPurgeStatusColumnInSnapshotsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropPurgeStatusColumnInSnapshotsIT.java
@@ -21,30 +21,30 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class DropPurgeStatusColumnInSnapshotsIT {
+class DropPurgeStatusColumnInSnapshotsIT {
private static final String TABLE_NAME = "snapshots";
private static final String COLUMN_NAME = "purge_status";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropPurgeStatusColumnInSnapshots.class);
private final DropPurgeStatusColumnInSnapshots underTest = new DropPurgeStatusColumnInSnapshots(db.database());
@Test
- public void drops_column() throws SQLException {
+ void drops_column() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.INTEGER, null, null);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.INTEGER, null, null);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropTableProjectMappingsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropTableProjectMappingsIT.java
index 12653b4483d..39eda7c3768 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropTableProjectMappingsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/DropTableProjectMappingsIT.java
@@ -20,28 +20,28 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class DropTableProjectMappingsIT {
+class DropTableProjectMappingsIT {
public static final String TABLE_NAME = "project_mappings";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropTableProjectMappings.class);
private final DropTableProjectMappings underTest = new DropTableProjectMappings(db.database());
@Test
- public void execute_shouldDropTable() throws SQLException {
+ void execute_shouldDropTable() throws SQLException {
db.assertTableExists(TABLE_NAME);
underTest.execute();
db.assertTableDoesNotExist(TABLE_NAME);
}
@Test
- public void execute_shouldSupportReentrantMigrationExecution() throws SQLException {
+ void execute_shouldSupportReentrantMigrationExecution() throws SQLException {
db.assertTableExists(TABLE_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/FixSqaleIndexMetricDescriptionIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/FixSqaleIndexMetricDescriptionIT.java
index 30f3f6c35d5..5c69c15ec4d 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/FixSqaleIndexMetricDescriptionIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/FixSqaleIndexMetricDescriptionIT.java
@@ -20,22 +20,22 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
-public class FixSqaleIndexMetricDescriptionIT {
+class FixSqaleIndexMetricDescriptionIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(FixSqaleIndexMetricDescription.class);
private final FixSqaleIndexMetricDescription underTest = new FixSqaleIndexMetricDescription(db.database());
private final String OLD_DESCRIPTION = "Total effort (in hours) to fix all the issues on the component and therefore to comply to all the requirements.";
private final String NEW_DESCRIPTION = "Total effort (in minutes) to fix all the issues on the component and therefore to comply to all the requirements.";
- @Before
+ @BeforeEach
public void setUp() {
db.executeInsert("metrics",
"uuid", "uuid",
@@ -44,14 +44,14 @@ public class FixSqaleIndexMetricDescriptionIT {
}
@Test
- public void execute_whenExecuted_shouldUpdateSqaleIndexDescription() throws SQLException {
+ void execute_whenExecuted_shouldUpdateSqaleIndexDescription() throws SQLException {
assertThat(select()).isEqualTo(OLD_DESCRIPTION);
underTest.execute();
assertThat(select()).isEqualTo(NEW_DESCRIPTION);
}
@Test
- public void execute_WhenExecutedTwice_shouldBeReentrant() throws SQLException {
+ void execute_WhenExecutedTwice_shouldBeReentrant() throws SQLException {
assertThat(select()).isEqualTo(OLD_DESCRIPTION);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/IncreaseIsLastKeyInCeActivityIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/IncreaseIsLastKeyInCeActivityIT.java
index f4953590681..2d95297524c 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/IncreaseIsLastKeyInCeActivityIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/IncreaseIsLastKeyInCeActivityIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
@@ -29,21 +29,21 @@ import static org.sonar.server.platform.db.migration.version.v102.IncreaseIsLast
import static org.sonar.server.platform.db.migration.version.v102.IncreaseIsLastKeyInCeActivity.NEW_COLUMN_SIZE;
import static org.sonar.server.platform.db.migration.version.v102.IncreaseIsLastKeyInCeActivity.TABLE_NAME;
-public class IncreaseIsLastKeyInCeActivityIT {
+class IncreaseIsLastKeyInCeActivityIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(IncreaseIsLastKeyInCeActivity.class);
private final IncreaseIsLastKeyInCeActivity underTest = new IncreaseIsLastKeyInCeActivity(db.database());
@Test
- public void execute_increaseColumnSize() throws SQLException {
+ void execute_increaseColumnSize() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 55, false);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, NEW_COLUMN_SIZE, false);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 55, false);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/IncreaseMainIsLastKeyInCeActivityIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/IncreaseMainIsLastKeyInCeActivityIT.java
index b2e239a898e..235e902fa22 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/IncreaseMainIsLastKeyInCeActivityIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/IncreaseMainIsLastKeyInCeActivityIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
@@ -29,21 +29,21 @@ import static org.sonar.server.platform.db.migration.version.v102.IncreaseMainIs
import static org.sonar.server.platform.db.migration.version.v102.IncreaseMainIsLastKeyInCeActivity.NEW_COLUMN_SIZE;
import static org.sonar.server.platform.db.migration.version.v102.IncreaseMainIsLastKeyInCeActivity.TABLE_NAME;
-public class IncreaseMainIsLastKeyInCeActivityIT {
+class IncreaseMainIsLastKeyInCeActivityIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(IncreaseMainIsLastKeyInCeActivity.class);
private final IncreaseMainIsLastKeyInCeActivity underTest = new IncreaseMainIsLastKeyInCeActivity(db.database());
@Test
- public void execute_increaseColumnSize() throws SQLException {
+ void execute_increaseColumnSize() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 55, false);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, NEW_COLUMN_SIZE, false);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 55, false);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/MakeProjectUuidNullableInUserDismissedMessagesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/MakeProjectUuidNullableInUserDismissedMessagesIT.java
index 024922efe9c..b21e06bd5fe 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/MakeProjectUuidNullableInUserDismissedMessagesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/MakeProjectUuidNullableInUserDismissedMessagesIT.java
@@ -20,30 +20,30 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
-public class MakeProjectUuidNullableInUserDismissedMessagesIT {
+class MakeProjectUuidNullableInUserDismissedMessagesIT {
private static final String TABLE_NAME = "user_dismissed_messages";
private static final String COLUMN_NAME = "project_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(MakeProjectUuidNullableInUserDismissedMessages.class);
private final MakeProjectUuidNullableInUserDismissedMessages underTest = new MakeProjectUuidNullableInUserDismissedMessages(db.database());
@Test
- public void execute_shouldBeNullable() throws SQLException {
+ void execute_shouldBeNullable() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 40, false);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 40, true);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, VARCHAR, 40, false);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/MakePurgedColumnNotNullableInSnapshotsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/MakePurgedColumnNotNullableInSnapshotsIT.java
index dd1e5b11446..ce561cf9d8e 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/MakePurgedColumnNotNullableInSnapshotsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/MakePurgedColumnNotNullableInSnapshotsIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.BOOLEAN;
-public class MakePurgedColumnNotNullableInSnapshotsIT {
+class MakePurgedColumnNotNullableInSnapshotsIT {
private static final String TABLE_NAME = "snapshots";
private static final String COLUMN_NAME = "purged";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(MakePurgedColumnNotNullableInSnapshots.class);
private final MakePurgedColumnNotNullableInSnapshots underTest = new MakePurgedColumnNotNullableInSnapshots(db.database());
@Test
- public void execute_whenColumnIsNullable_shouldMakeColumnNullable() throws SQLException {
+ void execute_whenColumnIsNullable_shouldMakeColumnNullable() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, true);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, false);
}
@Test
- public void execute_whenExecutedTwice_shouldMakeColumnNullable() throws SQLException {
+ void execute_whenExecutedTwice_shouldMakeColumnNullable() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, BOOLEAN, null, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulateCleanCodeAttributeColumnInRulesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulateCleanCodeAttributeColumnInRulesIT.java
index f0ac747ad54..053e60cf4af 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulateCleanCodeAttributeColumnInRulesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulateCleanCodeAttributeColumnInRulesIT.java
@@ -21,8 +21,8 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import javax.annotation.Nullable;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.api.rules.CleanCodeAttribute;
import org.sonar.api.rules.RuleType;
import org.sonar.db.MigrationDbTester;
@@ -30,21 +30,21 @@ import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
-public class PopulateCleanCodeAttributeColumnInRulesIT {
+class PopulateCleanCodeAttributeColumnInRulesIT {
private static final String TABLE_NAME = "rules";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateCleanCodeAttributeColumnInRules.class);
private final PopulateCleanCodeAttributeColumnInRules underTest = new PopulateCleanCodeAttributeColumnInRules(db.database());
@Test
- public void execute_whenRulesDoNotExist_shouldNotFail() {
+ void execute_whenRulesDoNotExist_shouldNotFail() {
assertThatCode(underTest::execute).doesNotThrowAnyException();
}
@Test
- public void execute_whenRuleWithUndefinedCleanCodeAttribute_shouldUpdate() throws SQLException {
+ void execute_whenRuleWithUndefinedCleanCodeAttribute_shouldUpdate() throws SQLException {
insertRule("1", null);
underTest.execute();
assertThat(db.select("select uuid, clean_code_attribute from rules"))
@@ -53,7 +53,7 @@ public class PopulateCleanCodeAttributeColumnInRulesIT {
}
@Test
- public void execute_whenRuleWithUndefinedCleanCodeAttribute_shouldBeReentrant() throws SQLException {
+ void execute_whenRuleWithUndefinedCleanCodeAttribute_shouldBeReentrant() throws SQLException {
insertRule("1", null);
underTest.execute();
underTest.execute();
@@ -63,7 +63,7 @@ public class PopulateCleanCodeAttributeColumnInRulesIT {
}
@Test
- public void execute_whenRuleWithDefinedCleanCodeAttribute_shouldNotUpdate() throws SQLException {
+ void execute_whenRuleWithDefinedCleanCodeAttribute_shouldNotUpdate() throws SQLException {
insertRule("1", CleanCodeAttribute.FOCUSED);
underTest.execute();
assertThat(db.select("select uuid, clean_code_attribute from rules"))
@@ -72,7 +72,7 @@ public class PopulateCleanCodeAttributeColumnInRulesIT {
}
@Test
- public void execute_whenRuleIsHotspot_shouldNotUpdate() throws SQLException {
+ void execute_whenRuleIsHotspot_shouldNotUpdate() throws SQLException {
insertRule("1", RuleType.SECURITY_HOTSPOT, null, null);
underTest.execute();
assertThat(db.select("select uuid, clean_code_attribute from rules"))
@@ -81,7 +81,7 @@ public class PopulateCleanCodeAttributeColumnInRulesIT {
}
@Test
- public void execute_whenAdhocRuleIsHotspot_shouldNotUpdate() throws SQLException {
+ void execute_whenAdhocRuleIsHotspot_shouldNotUpdate() throws SQLException {
insertRule("1", null, RuleType.SECURITY_HOTSPOT, null);
underTest.execute();
assertThat(db.select("select uuid, clean_code_attribute from rules"))
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulateDefaultImpactsInRulesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulateDefaultImpactsInRulesIT.java
index 1eb137d93ce..fea88b667aa 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulateDefaultImpactsInRulesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulateDefaultImpactsInRulesIT.java
@@ -21,12 +21,12 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import javax.annotation.Nullable;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.api.batch.rule.Severity;
import org.sonar.api.issue.impact.SoftwareQuality;
import org.sonar.api.rules.RuleType;
-import org.sonar.api.testfixtures.log.LogTester;
+import org.sonar.api.testfixtures.log.LogTesterJUnit5;
import org.sonar.core.util.Uuids;
import org.sonar.db.MigrationDbTester;
@@ -34,23 +34,23 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.tuple;
-public class PopulateDefaultImpactsInRulesIT {
+class PopulateDefaultImpactsInRulesIT {
private static final String TABLE_NAME = "rules";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateDefaultImpactsInRules.class);
- @Rule
- public LogTester logTester = new LogTester();
+ @RegisterExtension
+ public final LogTesterJUnit5 logTester = new LogTesterJUnit5();
private final PopulateDefaultImpactsInRules underTest = new PopulateDefaultImpactsInRules(db.database());
@Test
- public void execute_whenRulesDoNotExist_shouldNotFail() {
+ void execute_whenRulesDoNotExist_shouldNotFail() {
assertThatCode(underTest::execute).doesNotThrowAnyException();
}
@Test
- public void execute_whenRulesHasTypeAndSeverity_shouldCreateImpact() throws SQLException {
+ void execute_whenRulesHasTypeAndSeverity_shouldCreateImpact() throws SQLException {
insertRuleWithType("uuid", RuleType.CODE_SMELL, Severity.MAJOR);
underTest.execute();
@@ -61,7 +61,7 @@ public class PopulateDefaultImpactsInRulesIT {
}
@Test
- public void execute_shouldBeReentrant() throws SQLException {
+ void execute_shouldBeReentrant() throws SQLException {
insertRuleWithType("uuid", RuleType.CODE_SMELL, Severity.MAJOR);
underTest.execute();
underTest.execute();
@@ -75,7 +75,7 @@ public class PopulateDefaultImpactsInRulesIT {
}
@Test
- public void execute_shouldNotBeExecuted_whenImpactsTableHasAlreadyRecords() throws SQLException {
+ void execute_shouldNotBeExecuted_whenImpactsTableHasAlreadyRecords() throws SQLException {
insertRuleWithType("uuid", RuleType.CODE_SMELL, Severity.MAJOR);
insertRuleWithType("uuid2", RuleType.CODE_SMELL, Severity.MAJOR);
insertImpact("uuid", SoftwareQuality.SECURITY, org.sonar.api.issue.impact.Severity.HIGH);
@@ -90,7 +90,7 @@ public class PopulateDefaultImpactsInRulesIT {
}
@Test
- public void execute_whenAdhocRulesHasTypeAndSeverity_shouldCreateImpact() throws SQLException {
+ void execute_whenAdhocRulesHasTypeAndSeverity_shouldCreateImpact() throws SQLException {
insertRuleWithAdHocType("uuid", RuleType.CODE_SMELL, Severity.MAJOR);
underTest.execute();
@@ -103,7 +103,7 @@ public class PopulateDefaultImpactsInRulesIT {
}
@Test
- public void execute_whenAdhocRulesHasImpactAlready_shouldNotCreateImpact() throws SQLException {
+ void execute_whenAdhocRulesHasImpactAlready_shouldNotCreateImpact() throws SQLException {
insertRuleWithAdHocType("uuid", RuleType.CODE_SMELL, Severity.MAJOR);
insertImpact("uuid", SoftwareQuality.SECURITY, org.sonar.api.issue.impact.Severity.HIGH);
underTest.execute();
@@ -117,7 +117,7 @@ public class PopulateDefaultImpactsInRulesIT {
}
@Test
- public void execute_whenNoTypeAndSeverityDefined_shouldNotCreateImpact() throws SQLException {
+ void execute_whenNoTypeAndSeverityDefined_shouldNotCreateImpact() throws SQLException {
insertRuleWithType("uuid", null, null);
underTest.execute();
@@ -127,7 +127,7 @@ public class PopulateDefaultImpactsInRulesIT {
}
@Test
- public void execute_whenInvalidValueDefined_shouldNotCreateImpactAndLog() throws SQLException {
+ void execute_whenInvalidValueDefined_shouldNotCreateImpactAndLog() throws SQLException {
insertInvalidRule("uuid");
underTest.execute();
@@ -138,7 +138,7 @@ public class PopulateDefaultImpactsInRulesIT {
}
@Test
- public void execute_whenTypeIsHotspot_shouldNotCreateImpactAndLog() throws SQLException {
+ void execute_whenTypeIsHotspot_shouldNotCreateImpactAndLog() throws SQLException {
insertRuleWithType("uuid", RuleType.SECURITY_HOTSPOT, Severity.MAJOR);
underTest.execute();
@@ -148,7 +148,7 @@ public class PopulateDefaultImpactsInRulesIT {
}
@Test
- public void execute_whenRuleHasEmptyFields_shouldCreateADefaultImpact() throws SQLException {
+ void execute_whenRuleHasEmptyFields_shouldCreateADefaultImpact() throws SQLException {
insertPlaceholderAdhocRule("uuid");
underTest.execute();
@@ -160,7 +160,7 @@ public class PopulateDefaultImpactsInRulesIT {
}
@Test
- public void execute_whenStandardRuleHasBothAdhocAndStandardTypeAndSeverity_shouldCreateADefaultImpactWithAdhocTypes() throws SQLException {
+ void execute_whenStandardRuleHasBothAdhocAndStandardTypeAndSeverity_shouldCreateADefaultImpactWithAdhocTypes() throws SQLException {
insertRule("uuid", RuleType.CODE_SMELL, Severity.CRITICAL, RuleType.VULNERABILITY, Severity.MINOR, true);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulatePurgedColumnInSnapshotsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulatePurgedColumnInSnapshotsIT.java
index 5b0744f1bb8..b65d0892167 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulatePurgedColumnInSnapshotsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/PopulatePurgedColumnInSnapshotsIT.java
@@ -21,29 +21,29 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import javax.annotation.Nullable;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.tuple;
-public class PopulatePurgedColumnInSnapshotsIT {
+class PopulatePurgedColumnInSnapshotsIT {
private static final String TABLE_NAME = "snapshots";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulatePurgedColumnInSnapshots.class);
private final PopulatePurgedColumnInSnapshots underTest = new PopulatePurgedColumnInSnapshots(db.database());
@Test
- public void execute_whenSnapshotsDoesNotExist_shouldNotFail() {
+ void execute_whenSnapshotsDoesNotExist_shouldNotFail() {
assertThatCode(underTest::execute)
.doesNotThrowAnyException();
}
@Test
- public void execute_whenSnapshotsExist_shouldPopulatePurgedColumn() throws SQLException {
+ void execute_whenSnapshotsExist_shouldPopulatePurgedColumn() throws SQLException {
insertSnapshot("uuid-1", null);
insertSnapshot("uuid-2", 1);
insertSnapshot("uuid-3", 0);
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameBuildDateInSnapshotsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameBuildDateInSnapshotsIT.java
index 24e02f21c8c..d47db608543 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameBuildDateInSnapshotsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameBuildDateInSnapshotsIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class RenameBuildDateInSnapshotsIT {
+class RenameBuildDateInSnapshotsIT {
private static final String TABLE_NAME = "snapshots";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RenameBuildDateInSnapshots.class);
private final RenameBuildDateInSnapshots underTest = new RenameBuildDateInSnapshots(db.database());
@Test
- public void execute_whenExecuted_shouldRenameColumn() throws SQLException {
+ void execute_whenExecuted_shouldRenameColumn() throws SQLException {
assertColumnExists("build_date");
underTest.execute();
assertColumnExists("analysis_date");
}
@Test
- public void execute_whenExecutedTwice_shouldNotFail() throws SQLException {
+ void execute_whenExecutedTwice_shouldNotFail() throws SQLException {
assertColumnExists("build_date");
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInGroupRolesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInGroupRolesIT.java
index 5334b2bf2e7..cbe5f9b22d8 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInGroupRolesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInGroupRolesIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
-public class RenameComponentUuidInGroupRolesIT {
+class RenameComponentUuidInGroupRolesIT {
public static final String TABLE_NAME = "group_roles";
public static final String NEW_COLUMN_NAME = "entity_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RenameComponentUuidInGroupRoles.class);
private final RenameComponentUuidInGroupRoles underTest = new RenameComponentUuidInGroupRoles(db.database());
@Test
- public void columnIsRenamed() throws SQLException {
+ void columnIsRenamed() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, NEW_COLUMN_NAME, VARCHAR, 40, true);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInSnapshotsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInSnapshotsIT.java
index 48fb4662392..48aaa7cef69 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInSnapshotsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInSnapshotsIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
-public class RenameComponentUuidInSnapshotsIT {
+class RenameComponentUuidInSnapshotsIT {
public static final String TABLE_NAME = "snapshots";
public static final String NEW_COLUMN_NAME = "root_component_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RenameComponentUuidInSnapshots.class);
private final RenameComponentUuidInSnapshots underTest = new RenameComponentUuidInSnapshots(db.database());
@Test
- public void columnIsRenamed() throws SQLException {
+ void columnIsRenamed() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, NEW_COLUMN_NAME, VARCHAR, 50, false);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInUserRolesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInUserRolesIT.java
index 6631b3256dd..c113efc5589 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInUserRolesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInUserRolesIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
-public class RenameComponentUuidInUserRolesIT {
+class RenameComponentUuidInUserRolesIT {
public static final String TABLE_NAME = "user_roles";
public static final String NEW_COLUMN_NAME = "entity_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RenameComponentUuidInUserRoles.class);
private final RenameComponentUuidInUserRoles underTest = new RenameComponentUuidInUserRoles(db.database());
@Test
- public void columnIsRenamed() throws SQLException {
+ void columnIsRenamed() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, NEW_COLUMN_NAME, VARCHAR, 40, true);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInWebhookDeliveriesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInWebhookDeliveriesIT.java
index f5c95827e0b..4945506867b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInWebhookDeliveriesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameComponentUuidInWebhookDeliveriesIT.java
@@ -20,17 +20,17 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.AbstractDbTester;
-import org.sonar.db.TestDb;
import org.sonar.db.MigrationDbTester;
+import org.sonar.db.TestDb;
import org.sonar.server.platform.db.migration.step.RenameVarcharColumnChange;
import org.sonar.server.platform.db.migration.version.RenameVarcharColumnAbstractTest;
-public class RenameComponentUuidInWebhookDeliveriesIT extends RenameVarcharColumnAbstractTest {
+class RenameComponentUuidInWebhookDeliveriesIT extends RenameVarcharColumnAbstractTest {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RenameComponentUuidInWebhookDeliveries.class);
public RenameComponentUuidInWebhookDeliveriesIT() {
@@ -38,12 +38,12 @@ public class RenameComponentUuidInWebhookDeliveriesIT extends RenameVarcharColum
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
super.verifyMigrationIsReentrant();
}
@Test
- public void column_is_renamed() throws SQLException {
+ void column_is_renamed() throws SQLException {
super.verifyColumnIsRenamed();
}
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameMainComponentUuidInCeActivityIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameMainComponentUuidInCeActivityIT.java
index 66ba036aece..24ad24509c9 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameMainComponentUuidInCeActivityIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameMainComponentUuidInCeActivityIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
-public class RenameMainComponentUuidInCeActivityIT {
+class RenameMainComponentUuidInCeActivityIT {
public static final String TABLE_NAME = "ce_activity";
public static final String NEW_COLUMN_NAME = "entity_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RenameMainComponentUuidInCeActivity.class);
private final RenameMainComponentUuidInCeActivity underTest = new RenameMainComponentUuidInCeActivity(db.database());
@Test
- public void column_is_renamed() throws SQLException {
+ void column_is_renamed() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, NEW_COLUMN_NAME, VARCHAR, 40, true);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameMainComponentUuidInCeQueueIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameMainComponentUuidInCeQueueIT.java
index 6138d66bb39..a5bf85f38ff 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameMainComponentUuidInCeQueueIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/RenameMainComponentUuidInCeQueueIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
-public class RenameMainComponentUuidInCeQueueIT {
+class RenameMainComponentUuidInCeQueueIT {
public static final String TABLE_NAME = "ce_queue";
public static final String NEW_COLUMN_NAME = "entity_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RenameMainComponentUuidInCeQueue.class);
private final RenameMainComponentUuidInCeQueue underTest = new RenameMainComponentUuidInCeQueue(db.database());
@Test
- public void column_is_renamed() throws SQLException {
+ void column_is_renamed() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, NEW_COLUMN_NAME, VARCHAR, 40, true);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, NEW_COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/UpdateValueAndPopulatePreviousNonCompliantValueInNewCodePeriodsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/UpdateValueAndPopulatePreviousNonCompliantValueInNewCodePeriodsIT.java
index bb58bf58d25..4b8f5470766 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/UpdateValueAndPopulatePreviousNonCompliantValueInNewCodePeriodsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v102/UpdateValueAndPopulatePreviousNonCompliantValueInNewCodePeriodsIT.java
@@ -21,25 +21,25 @@ package org.sonar.server.platform.db.migration.version.v102;
import java.sql.SQLException;
import javax.annotation.Nullable;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
-public class UpdateValueAndPopulatePreviousNonCompliantValueInNewCodePeriodsIT {
+class UpdateValueAndPopulatePreviousNonCompliantValueInNewCodePeriodsIT {
private static final String TABLE_NAME = "new_code_periods";
private static final String PROJECT_UUID = "project-uuid";
private static final String BRANCH_UUID = "branch-uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(UpdateValueAndPopulatePreviousNonCompliantValueInNewCodePeriods.class);
public final UpdateValueAndPopulatePreviousNonCompliantValueInNewCodePeriods underTest = new UpdateValueAndPopulatePreviousNonCompliantValueInNewCodePeriods(db.database());
@Test
- public void execute_whenSnapshotsExist_shouldPopulatePurgedColumn() throws SQLException {
+ void execute_whenSnapshotsExist_shouldPopulatePurgedColumn() throws SQLException {
insertNewCodePeriods("uuid-1", PROJECT_UUID, BRANCH_UUID, "PREVIOUS_VERSION", null);
insertNewCodePeriods("uuid-2", PROJECT_UUID, null, "NUMBER_OF_DAYS", "90");
insertNewCodePeriods("uuid-3", null, null, "NUMBER_OF_DAYS", "97");
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddCleanCodeAttributeColumnInIssuesTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddCleanCodeAttributeColumnInIssuesTableIT.java
index d08a5f17e3e..9377eefa5af 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddCleanCodeAttributeColumnInIssuesTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddCleanCodeAttributeColumnInIssuesTableIT.java
@@ -21,29 +21,29 @@ package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThatCode;
-public class AddCleanCodeAttributeColumnInIssuesTableIT {
+class AddCleanCodeAttributeColumnInIssuesTableIT {
private static final String TABLE_NAME = "issues";
private static final String COLUMN_NAME = "clean_code_attribute";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddCleanCodeAttributeColumnInIssuesTable.class);
private final AddCleanCodeAttributeColumnInIssuesTable underTest = new AddCleanCodeAttributeColumnInIssuesTable(db.database());
@Test
- public void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
+ void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 40, true);
}
@Test
- public void execute_whenColumnsAlreadyExists_shouldNotFail() throws SQLException {
+ void execute_whenColumnsAlreadyExists_shouldNotFail() throws SQLException {
underTest.execute();
assertThatCode(underTest::execute).doesNotThrowAnyException();
}
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddCreationMethodColumnInProjectsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddCreationMethodColumnInProjectsTableIT.java
index ff51c47362f..7d91db50e91 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddCreationMethodColumnInProjectsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddCreationMethodColumnInProjectsTableIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
@@ -30,20 +30,20 @@ import static org.sonar.server.platform.db.migration.version.v103.AddCreationMet
import static org.sonar.server.platform.db.migration.version.v103.AddCreationMethodColumnInProjectsTable.PROJECTS_CREATION_METHOD_COLUMN_SIZE;
import static org.sonar.server.platform.db.migration.version.v103.AddCreationMethodColumnInProjectsTable.PROJECTS_TABLE_NAME;
-public class AddCreationMethodColumnInProjectsTableIT {
- @Rule
+class AddCreationMethodColumnInProjectsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddCreationMethodColumnInProjectsTable.class);
private final AddCreationMethodColumnInProjectsTable underTest = new AddCreationMethodColumnInProjectsTable(db.database());
@Test
- public void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
+ void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
db.assertColumnDoesNotExist(PROJECTS_TABLE_NAME, PROJECTS_CREATION_METHOD_COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(PROJECTS_TABLE_NAME, PROJECTS_CREATION_METHOD_COLUMN_NAME, VARCHAR, PROJECTS_CREATION_METHOD_COLUMN_SIZE, true);
}
@Test
- public void execute_whenColumnsAlreadyExists_shouldNotFail() throws SQLException {
+ void execute_whenColumnsAlreadyExists_shouldNotFail() throws SQLException {
underTest.execute();
assertThatCode(underTest::execute).doesNotThrowAnyException();
}
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddRuleChangesUuidColumnInQProfileChangesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddRuleChangesUuidColumnInQProfileChangesIT.java
index 9e1884e6254..3bf8bcbd13d 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddRuleChangesUuidColumnInQProfileChangesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddRuleChangesUuidColumnInQProfileChangesIT.java
@@ -21,30 +21,30 @@ package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThatCode;
-public class AddRuleChangesUuidColumnInQProfileChangesIT {
+class AddRuleChangesUuidColumnInQProfileChangesIT {
private static final String TABLE_NAME = "qprofile_changes";
private static final String COLUMN_NAME = "rule_change_uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddRuleChangesUuidColumnInQProfileChanges.class);
private final AddRuleChangesUuidColumnInQProfileChanges underTest = new AddRuleChangesUuidColumnInQProfileChanges(db.database());
@Test
- public void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
+ void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 40, true);
}
@Test
- public void execute_whenColumnsAlreadyExists_shouldNotFail() throws SQLException {
+ void execute_whenColumnsAlreadyExists_shouldNotFail() throws SQLException {
underTest.execute();
assertThatCode(underTest::execute).doesNotThrowAnyException();
}
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddSqVersionColumnInQprofileChangesTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddSqVersionColumnInQprofileChangesTableIT.java
index ae03b998865..280cf614ce2 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddSqVersionColumnInQprofileChangesTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/AddSqVersionColumnInQprofileChangesTableIT.java
@@ -21,30 +21,30 @@ package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThatCode;
-public class AddSqVersionColumnInQprofileChangesTableIT {
+class AddSqVersionColumnInQprofileChangesTableIT {
private static final String TABLE_NAME = "qprofile_changes";
private static final String COLUMN_NAME = "sq_version";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddSqVersionColumnInQprofileChangesTable.class);
private final AddSqVersionColumnInQprofileChangesTable underTest = new AddSqVersionColumnInQprofileChangesTable(db.database());
@Test
- public void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
+ void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 40, true);
}
@Test
- public void execute_whenColumnsAlreadyExists_shouldNotFail() throws SQLException {
+ void execute_whenColumnsAlreadyExists_shouldNotFail() throws SQLException {
underTest.execute();
assertThatCode(underTest::execute).doesNotThrowAnyException();
}
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateGithubPermissionsMappingTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateGithubPermissionsMappingTableIT.java
index 23895f74091..e592d9ca0a6 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateGithubPermissionsMappingTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateGithubPermissionsMappingTableIT.java
@@ -21,22 +21,22 @@ package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE;
import static org.sonar.server.platform.db.migration.version.v103.CreateGithubPermissionsMappingTable.GITHUB_PERMISSIONS_MAPPING_TABLE_NAME;
-public class CreateGithubPermissionsMappingTableIT {
- @Rule
+class CreateGithubPermissionsMappingTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateGithubPermissionsMappingTable.class);
private final DdlChange createGithubPermissionsMappingTable = new CreateGithubPermissionsMappingTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(GITHUB_PERMISSIONS_MAPPING_TABLE_NAME);
createGithubPermissionsMappingTable.execute();
@@ -49,7 +49,7 @@ public class CreateGithubPermissionsMappingTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(GITHUB_PERMISSIONS_MAPPING_TABLE_NAME);
createGithubPermissionsMappingTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateIndexForRuleImpactChangesTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateIndexForRuleImpactChangesTableIT.java
index 8c9ae56d988..453e2921785 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateIndexForRuleImpactChangesTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateIndexForRuleImpactChangesTableIT.java
@@ -20,22 +20,22 @@
package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
-public class CreateIndexForRuleImpactChangesTableIT {
+class CreateIndexForRuleImpactChangesTableIT {
static final String INDEX_NAME = "rule_impact_changes_r_c_uuid";
static final String TABLE_NAME = "rule_impact_changes";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIndexForRuleImpactChangesTable.class);
private final CreateIndexForRuleImpactChangesTable underTest = new CreateIndexForRuleImpactChangesTable(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(TABLE_NAME, INDEX_NAME);
underTest.execute();
@@ -44,7 +44,7 @@ public class CreateIndexForRuleImpactChangesTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateRuleChangesTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateRuleChangesTableIT.java
index 21e97096594..6e6983202e8 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateRuleChangesTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateRuleChangesTableIT.java
@@ -21,24 +21,24 @@ package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE;
-public class CreateRuleChangesTableIT {
+class CreateRuleChangesTableIT {
private final static String TABLE_NAME = "rule_changes";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateRuleChangesTable.class);
private final DdlChange underTest = new CreateRuleChangesTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
@@ -51,7 +51,7 @@ public class CreateRuleChangesTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateRuleImpactChangesTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateRuleImpactChangesTableIT.java
index 97f013b2559..091b3e55d6b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateRuleImpactChangesTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateRuleImpactChangesTableIT.java
@@ -21,25 +21,25 @@ package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE;
-public class CreateRuleImpactChangesTableIT {
+class CreateRuleImpactChangesTableIT {
private final static String TABLE_NAME = "rule_impact_changes";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateRuleImpactChangesTable.class);
private final DdlChange underTest = new CreateRuleImpactChangesTable(db.database());
@Test
- public void migration_should_create_a_table() throws SQLException {
+ void migration_should_create_a_table() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
@@ -53,7 +53,7 @@ public class CreateRuleImpactChangesTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateUniqueIndexForGithubPermissionsMappingTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateUniqueIndexForGithubPermissionsMappingTableIT.java
index 7adab113148..9f7acdcc1fa 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateUniqueIndexForGithubPermissionsMappingTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateUniqueIndexForGithubPermissionsMappingTableIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.sonar.server.platform.db.migration.version.v103.CreateGithubPermissionsMappingTable.GITHUB_PERMISSIONS_MAPPING_TABLE_NAME;
@@ -29,13 +29,13 @@ import static org.sonar.server.platform.db.migration.version.v103.CreateGithubPe
import static org.sonar.server.platform.db.migration.version.v103.CreateGithubPermissionsMappingTable.SONARQUBE_PERMISSION_COLUMN;
import static org.sonar.server.platform.db.migration.version.v103.CreateUniqueIndexForGithubPermissionsMappingTable.INDEX_NAME;
-public class CreateUniqueIndexForGithubPermissionsMappingTableIT {
- @Rule
+class CreateUniqueIndexForGithubPermissionsMappingTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateUniqueIndexForGithubPermissionsMappingTable.class);
private final CreateUniqueIndexForGithubPermissionsMappingTable createIndex = new CreateUniqueIndexForGithubPermissionsMappingTable(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(GITHUB_PERMISSIONS_MAPPING_TABLE_NAME, INDEX_NAME);
createIndex.execute();
@@ -44,7 +44,7 @@ public class CreateUniqueIndexForGithubPermissionsMappingTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateUniqueIndexForPropertiesTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateUniqueIndexForPropertiesTableIT.java
index d01a9f75ec8..e2c15c2d8a5 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateUniqueIndexForPropertiesTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/CreateUniqueIndexForPropertiesTableIT.java
@@ -20,22 +20,22 @@
package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.sonar.server.platform.db.migration.version.v103.CreateUniqueIndexForPropertiesTable.INDEX_NAME;
import static org.sonar.server.platform.db.migration.version.v103.CreateUniqueIndexForPropertiesTable.PROPERTIES_TABLE_NAME;
-public class CreateUniqueIndexForPropertiesTableIT {
+class CreateUniqueIndexForPropertiesTableIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateUniqueIndexForPropertiesTable.class);
private final CreateUniqueIndexForPropertiesTable createIndex = new CreateUniqueIndexForPropertiesTable(db.database());
@Test
- public void migration_should_create_index() throws SQLException {
+ void migration_should_create_index() throws SQLException {
db.assertIndexDoesNotExist(PROPERTIES_TABLE_NAME, INDEX_NAME);
createIndex.execute();
@@ -44,7 +44,7 @@ public class CreateUniqueIndexForPropertiesTableIT {
}
@Test
- public void migration_should_be_reentrant() throws SQLException {
+ void migration_should_be_reentrant() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/DeduplicatePropertiesTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/DeduplicatePropertiesTableIT.java
index b9db929e598..69c838375ff 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/DeduplicatePropertiesTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/DeduplicatePropertiesTableIT.java
@@ -22,19 +22,19 @@ package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
import java.util.Date;
import javax.annotation.Nullable;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.Uuids;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
-public class DeduplicatePropertiesTableIT {
+class DeduplicatePropertiesTableIT {
public static final String KEY = "key";
public static final String ENTITY = "entity";
public static final String USER = "user";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DeduplicatePropertiesTable.class);
private final DeduplicatePropertiesTable underTest = new DeduplicatePropertiesTable(db.database());
@@ -57,7 +57,7 @@ public class DeduplicatePropertiesTableIT {
}
@Test
- public void execute_shouldDeduplicateRows_WhenOnlyKeyIsSpecified() throws SQLException {
+ void execute_shouldDeduplicateRows_WhenOnlyKeyIsSpecified() throws SQLException {
createBaseProperties();
createProperty(KEY, null, null);
createProperty(KEY, null, null);
@@ -69,7 +69,7 @@ public class DeduplicatePropertiesTableIT {
}
@Test
- public void execute_shouldDeduplicateRows_WhenOnlyKeyAndUserAreSpecified() throws SQLException {
+ void execute_shouldDeduplicateRows_WhenOnlyKeyAndUserAreSpecified() throws SQLException {
createBaseProperties();
createProperty(KEY, USER, null);
createProperty(KEY, USER, null);
@@ -81,7 +81,7 @@ public class DeduplicatePropertiesTableIT {
}
@Test
- public void execute_shouldDeduplicateRows_WhenKeyUserAndEntityAreSpecified() throws SQLException {
+ void execute_shouldDeduplicateRows_WhenKeyUserAndEntityAreSpecified() throws SQLException {
createBaseProperties();
createProperty(KEY, USER, ENTITY);
createProperty(KEY, USER, ENTITY);
@@ -93,7 +93,7 @@ public class DeduplicatePropertiesTableIT {
}
@Test
- public void execute_shouldBeReentrant() throws SQLException {
+ void execute_shouldBeReentrant() throws SQLException {
createBaseProperties();
createProperty(KEY, USER, ENTITY);
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/MakeCreationMethodColumnInProjectsNotNullableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/MakeCreationMethodColumnInProjectsNotNullableIT.java
index fef596121d9..d160db48414 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/MakeCreationMethodColumnInProjectsNotNullableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/MakeCreationMethodColumnInProjectsNotNullableIT.java
@@ -20,28 +20,28 @@
package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
import static org.sonar.server.platform.db.migration.version.v103.AddCreationMethodColumnInProjectsTable.PROJECTS_CREATION_METHOD_COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v103.AddCreationMethodColumnInProjectsTable.PROJECTS_TABLE_NAME;
-public class MakeCreationMethodColumnInProjectsNotNullableIT {
- @Rule
+class MakeCreationMethodColumnInProjectsNotNullableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(MakeCreationMethodColumnInProjectsNotNullable.class);
private final MakeCreationMethodColumnInProjectsNotNullable underTest = new MakeCreationMethodColumnInProjectsNotNullable(db.database());
@Test
- public void user_local_column_is_not_null() throws SQLException {
+ void user_local_column_is_not_null() throws SQLException {
db.assertColumnDefinition(PROJECTS_TABLE_NAME, PROJECTS_CREATION_METHOD_COLUMN_NAME, VARCHAR, null, true);
underTest.execute();
db.assertColumnDefinition(PROJECTS_TABLE_NAME, PROJECTS_CREATION_METHOD_COLUMN_NAME, VARCHAR, null, false);
}
@Test
- public void migration_is_reentrant() throws SQLException {
+ void migration_is_reentrant() throws SQLException {
db.assertColumnDefinition(PROJECTS_TABLE_NAME, PROJECTS_CREATION_METHOD_COLUMN_NAME, VARCHAR, null, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/PopulateCreationMethodColumnInProjectsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/PopulateCreationMethodColumnInProjectsTableIT.java
index fa65f104266..0e040f01276 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/PopulateCreationMethodColumnInProjectsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/PopulateCreationMethodColumnInProjectsTableIT.java
@@ -20,28 +20,28 @@
package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.platform.db.migration.version.v103.AddCreationMethodColumnInProjectsTable.PROJECTS_TABLE_NAME;
-public class PopulateCreationMethodColumnInProjectsTableIT {
+class PopulateCreationMethodColumnInProjectsTableIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateCreationMethodColumnInProjectsTable.class);
private final PopulateCreationMethodColumnInProjectsTable underTest = new PopulateCreationMethodColumnInProjectsTable(db.database());
@Test
- public void execute_whenProjectsTableIsEmpty_shouldDoNothing() throws SQLException {
+ void execute_whenProjectsTableIsEmpty_shouldDoNothing() throws SQLException {
underTest.execute();
assertThat(db.select("select creation_method from projects")).isEmpty();
}
@Test
- public void execute_whenProjectsExist_shouldPopulateCreationMethodColumn() throws SQLException {
+ void execute_whenProjectsExist_shouldPopulateCreationMethodColumn() throws SQLException {
insertProject("uuid-1");
insertProject("uuid-2");
@@ -53,7 +53,7 @@ public class PopulateCreationMethodColumnInProjectsTableIT {
}
@Test
- public void execute_isReentrant() throws SQLException {
+ void execute_isReentrant() throws SQLException {
insertProject("uuid-1");
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/PopulateGithubPermissionsMappingIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/PopulateGithubPermissionsMappingIT.java
index ef20a61ad73..d0de06f288e 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/PopulateGithubPermissionsMappingIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/PopulateGithubPermissionsMappingIT.java
@@ -20,9 +20,9 @@
package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.api.testfixtures.log.LogTester;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.sonar.api.testfixtures.log.LogTesterJUnit5;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
@@ -30,17 +30,17 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
import static org.sonar.server.platform.db.migration.version.v103.CreateGithubPermissionsMappingTable.GITHUB_PERMISSIONS_MAPPING_TABLE_NAME;
-public class PopulateGithubPermissionsMappingIT {
+class PopulateGithubPermissionsMappingIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateGithubPermissionsMapping.class);
- @Rule
- public LogTester logTester = new LogTester();
+ @RegisterExtension
+ public final LogTesterJUnit5 logTester = new LogTesterJUnit5();
private final PopulateGithubPermissionsMapping migration = new PopulateGithubPermissionsMapping(db.database(), UuidFactoryFast.getInstance());
@Test
- public void execute_whenTableAlreadyPopulated_doesNothing() throws SQLException {
+ void execute_whenTableAlreadyPopulated_doesNothing() throws SQLException {
db.executeInsert(GITHUB_PERMISSIONS_MAPPING_TABLE_NAME,
"UUID", UuidFactoryFast.getInstance().create(),
"github_role", "gh_role",
@@ -54,14 +54,14 @@ public class PopulateGithubPermissionsMappingIT {
}
@Test
- public void execute_whenTableIsEmpty_shouldPopulate() throws SQLException {
+ void execute_whenTableIsEmpty_shouldPopulate() throws SQLException {
migration.execute();
verifyMapping();
}
@Test
- public void execute_isReentrant() throws SQLException {
+ void execute_isReentrant() throws SQLException {
migration.execute();
migration.execute();
migration.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/SetAllowQualityProfileDisableInheritedRulesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/SetAllowQualityProfileDisableInheritedRulesIT.java
index d4bd821de11..06f8bf3b3e3 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/SetAllowQualityProfileDisableInheritedRulesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v103/SetAllowQualityProfileDisableInheritedRulesIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v103;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.api.impl.utils.TestSystem2;
import org.sonar.api.utils.System2;
import org.sonar.core.util.UuidFactoryFast;
@@ -29,25 +29,25 @@ import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
-public class SetAllowQualityProfileDisableInheritedRulesIT {
+class SetAllowQualityProfileDisableInheritedRulesIT {
private static final long NOW = 1;
- @Rule
+ @RegisterExtension
public final MigrationDbTester dbTester = MigrationDbTester.createForMigrationStep(SetAllowQualityProfileDisableInheritedRules.class);
private final System2 system2 = new TestSystem2().setNow(NOW);
private final SetAllowQualityProfileDisableInheritedRules script = new SetAllowQualityProfileDisableInheritedRules(dbTester.database(), system2, UuidFactoryFast.getInstance());
@Test
- public void execute_shouldInsertPropertyWithFalseValue() throws SQLException {
+ void execute_shouldInsertPropertyWithFalseValue() throws SQLException {
script.execute();
assertThatForceAuthenticationEquals("false");
}
@Test
- public void execute_shouldBeReentrant() throws SQLException {
+ void execute_shouldBeReentrant() throws SQLException {
script.execute();
// re-entrant
script.execute();
@@ -56,7 +56,7 @@ public class SetAllowQualityProfileDisableInheritedRulesIT {
}
@Test
- public void execute_shouldNotUpdateTheValueThatAlreadyExistsInTheDatabase() throws SQLException {
+ void execute_shouldNotUpdateTheValueThatAlreadyExistsInTheDatabase() throws SQLException {
insertPropertyWithValueAsTrue();
script.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/AddUuidColumnToGroupsUsersIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/AddUuidColumnToGroupsUsersIT.java
index 9ceacdb6c83..b36eb2c8fda 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/AddUuidColumnToGroupsUsersIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/AddUuidColumnToGroupsUsersIT.java
@@ -21,30 +21,30 @@ package org.sonar.server.platform.db.migration.version.v104;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThatCode;
-public class AddUuidColumnToGroupsUsersIT {
+class AddUuidColumnToGroupsUsersIT {
private static final String TABLE_NAME = "groups_users";
private static final String COLUMN_NAME = "uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(AddUuidColumnToGroupsUsers.class);
private final AddUuidColumnToGroupsUsers underTest = new AddUuidColumnToGroupsUsers(db.database());
@Test
- public void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
+ void execute_whenColumnDoesNotExist_shouldCreateColumn() throws SQLException {
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
underTest.execute();
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 40, true);
}
@Test
- public void execute_whenColumnsAlreadyExists_shouldNotFail() throws SQLException {
+ void execute_whenColumnsAlreadyExists_shouldNotFail() throws SQLException {
underTest.execute();
assertThatCode(underTest::execute).doesNotThrowAnyException();
}
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreateIssuesFixedTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreateIssuesFixedTableIT.java
index df91a20a802..d9988b6bbda 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreateIssuesFixedTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreateIssuesFixedTableIT.java
@@ -21,8 +21,8 @@ package org.sonar.server.platform.db.migration.version.v104;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
@@ -31,15 +31,15 @@ import static org.sonar.server.platform.db.migration.version.v104.CreateIssuesFi
import static org.sonar.server.platform.db.migration.version.v104.CreateIssuesFixedTable.COLUMN_PULL_REQUEST_UUID;
import static org.sonar.server.platform.db.migration.version.v104.CreateIssuesFixedTable.TABLE_NAME;
-public class CreateIssuesFixedTableIT {
+class CreateIssuesFixedTableIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateIssuesFixedTable.class);
private final DdlChange underTest = new CreateIssuesFixedTable(db.database());
@Test
- public void execute_shouldCreateTable() throws SQLException {
+ void execute_shouldCreateTable() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
@@ -51,7 +51,7 @@ public class CreateIssuesFixedTableIT {
}
@Test
- public void execute_shouldBeReentrant() throws SQLException {
+ void execute_shouldBeReentrant() throws SQLException {
db.assertTableDoesNotExist(TABLE_NAME);
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreatePrimaryKeyOnGroupsUsersTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreatePrimaryKeyOnGroupsUsersTableIT.java
index ffb66081cef..ec714c8d3c7 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreatePrimaryKeyOnGroupsUsersTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreatePrimaryKeyOnGroupsUsersTableIT.java
@@ -20,21 +20,21 @@
package org.sonar.server.platform.db.migration.version.v104;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.sonar.server.platform.db.migration.version.v104.AddUuidColumnToGroupsUsers.GROUPS_USERS_TABLE_NAME;
import static org.sonar.server.platform.db.migration.version.v104.AddUuidColumnToGroupsUsers.GROUPS_USERS_UUID_COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v104.CreatePrimaryKeyOnGroupsUsersTable.PK_NAME;
-public class CreatePrimaryKeyOnGroupsUsersTableIT {
- @Rule
+class CreatePrimaryKeyOnGroupsUsersTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreatePrimaryKeyOnGroupsUsersTable.class);
private final CreatePrimaryKeyOnGroupsUsersTable createIndex = new CreatePrimaryKeyOnGroupsUsersTable(db.database());
@Test
- public void execute_whenPrimaryKeyDoesntExist_shouldCreatePrimaryKey() throws SQLException {
+ void execute_whenPrimaryKeyDoesntExist_shouldCreatePrimaryKey() throws SQLException {
db.assertNoPrimaryKey(GROUPS_USERS_TABLE_NAME);
createIndex.execute();
@@ -42,7 +42,7 @@ public class CreatePrimaryKeyOnGroupsUsersTableIT {
}
@Test
- public void execute_whenPrimaryKeyAlreadyExist_shouldKeepThePrimaryKeyAndNotFail() throws SQLException {
+ void execute_whenPrimaryKeyAlreadyExist_shouldKeepThePrimaryKeyAndNotFail() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreateRuleTagsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreateRuleTagsTableIT.java
index 1b797efd1c9..0a1641964f5 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreateRuleTagsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/CreateRuleTagsTableIT.java
@@ -21,8 +21,8 @@ package org.sonar.server.platform.db.migration.version.v104;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
@@ -33,14 +33,14 @@ import static org.sonar.server.platform.db.migration.version.v104.CreateRuleTags
import static org.sonar.server.platform.db.migration.version.v104.CreateRuleTagsTable.VALUE_COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v104.CreateRuleTagsTable.VALUE_COLUMN_SIZE;
-public class CreateRuleTagsTableIT {
- @Rule
+class CreateRuleTagsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreateRuleTagsTable.class);
private final DdlChange createScmAccountsTable = new CreateRuleTagsTable(db.database());
@Test
- public void execute_whenRun_shouldCreateRuleTagsTable() throws SQLException {
+ void execute_whenRun_shouldCreateRuleTagsTable() throws SQLException {
db.assertTableDoesNotExist(RULE_TAGS_TABLE_NAME);
createScmAccountsTable.execute();
@@ -53,7 +53,7 @@ public class CreateRuleTagsTableIT {
}
@Test
- public void execute_whenRunMoreThanOnce_shouldBeReentrant() throws SQLException {
+ void execute_whenRunMoreThanOnce_shouldBeReentrant() throws SQLException {
db.assertTableDoesNotExist(RULE_TAGS_TABLE_NAME);
createScmAccountsTable.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DeleteRedundantFailedAlertsForApplicationsIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DeleteRedundantFailedAlertsForApplicationsIT.java
index 57b2e422bc1..19d7d6500e3 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DeleteRedundantFailedAlertsForApplicationsIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DeleteRedundantFailedAlertsForApplicationsIT.java
@@ -21,21 +21,21 @@ package org.sonar.server.platform.db.migration.version.v104;
import java.sql.SQLException;
import java.util.Map;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DataChange;
import static org.assertj.core.api.Assertions.assertThat;
-public class DeleteRedundantFailedAlertsForApplicationsIT {
+class DeleteRedundantFailedAlertsForApplicationsIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DeleteRedundantFailedAlertsForApplications.class);
private final DataChange underTest = new DeleteRedundantFailedAlertsForApplications(db.database());
- @Before
+ @BeforeEach
public void setUp() {
// cleanup db
db.executeUpdateSql("truncate table events");
@@ -44,7 +44,7 @@ public class DeleteRedundantFailedAlertsForApplicationsIT {
}
@Test
- public void givenFailedAlertsForApplication_whenExecuted_thenFailedAlertsAreDeleted() throws SQLException {
+ void givenFailedAlertsForApplication_whenExecuted_thenFailedAlertsAreDeleted() throws SQLException {
// given
insertComponent("app1", "appUuid1", "appUuid1", "APP");
@@ -71,7 +71,7 @@ public class DeleteRedundantFailedAlertsForApplicationsIT {
}
@Test
- public void givenFailedAlertsForProject_whenExecute_thenTheEventsAreNotDeleted() throws SQLException {
+ void givenFailedAlertsForProject_whenExecute_thenTheEventsAreNotDeleted() throws SQLException {
// given
insertComponent("project1", "projectUuid1", "projectUuid1", "TRK");
@@ -89,7 +89,7 @@ public class DeleteRedundantFailedAlertsForApplicationsIT {
}
@Test
- public void givenMigration_whenExecutedMoreThanOnce_thenNoError() throws SQLException {
+ void givenMigration_whenExecutedMoreThanOnce_thenNoError() throws SQLException {
// given
insertComponent("app1", "appUuid1", "appUuid1", "APP");
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DropSystemTagsInRulesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DropSystemTagsInRulesIT.java
index 088b0d59148..929689e43c0 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DropSystemTagsInRulesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DropSystemTagsInRulesIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v104;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropSystemTagsInRulesIT {
+class DropSystemTagsInRulesIT {
private static final String TABLE_NAME = "rules";
private static final String COLUMN_NAME = "system_tags";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropSystemTagsInRules.class);
private final DdlChange underTest = new DropSystemTagsInRules(db.database());
@Test
- public void executed_whenRun_shouldDropSystemTagsColumn() throws SQLException {
+ void executed_whenRun_shouldDropSystemTagsColumn() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 4000, true);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void execute_whenRunMoreThanOnce_shouldBeReentrant() throws SQLException {
+ void execute_whenRunMoreThanOnce_shouldBeReentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 4000, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DropTagsInRulesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DropTagsInRulesIT.java
index 8354acae196..476d5cf8ccf 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DropTagsInRulesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/DropTagsInRulesIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v104;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropTagsInRulesIT {
+class DropTagsInRulesIT {
static final String TABLE_NAME = "rules";
static final String COLUMN_NAME = "tags";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropTagsInRules.class);
private final DdlChange underTest = new DropTagsInRules(db.database());
@Test
- public void executed_whenRun_shouldDropTagsColumn() throws SQLException {
+ void executed_whenRun_shouldDropTagsColumn() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 4000, true);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void execute_whenExecutedMoreThanOnce_shouldBeReentrant() throws SQLException {
+ void execute_whenExecutedMoreThanOnce_shouldBeReentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 4000, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/MakeUuidInGroupsUsersNotNullableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/MakeUuidInGroupsUsersNotNullableIT.java
index 876a7517535..238d125c303 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/MakeUuidInGroupsUsersNotNullableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/MakeUuidInGroupsUsersNotNullableIT.java
@@ -20,29 +20,29 @@
package org.sonar.server.platform.db.migration.version.v104;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static java.sql.Types.VARCHAR;
import static org.sonar.server.platform.db.migration.version.v104.AddUuidColumnToGroupsUsers.GROUPS_USERS_TABLE_NAME;
import static org.sonar.server.platform.db.migration.version.v104.AddUuidColumnToGroupsUsers.GROUPS_USERS_UUID_COLUMN_NAME;
-public class MakeUuidInGroupsUsersNotNullableIT {
+class MakeUuidInGroupsUsersNotNullableIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep( MakeUuidInGroupsUsersNotNullable.class);
private final MakeUuidInGroupsUsersNotNullable underTest = new MakeUuidInGroupsUsersNotNullable(db.database());
@Test
- public void execute_whenUuidColumnIsNullable_shouldMakeItNonNullable() throws SQLException {
+ void execute_whenUuidColumnIsNullable_shouldMakeItNonNullable() throws SQLException {
db.assertColumnDefinition(GROUPS_USERS_TABLE_NAME, GROUPS_USERS_UUID_COLUMN_NAME, VARCHAR, null, true);
underTest.execute();
db.assertColumnDefinition(GROUPS_USERS_TABLE_NAME, GROUPS_USERS_UUID_COLUMN_NAME, VARCHAR, null, false);
}
@Test
- public void execute_whenUuidColumnIsNullable_shouldKeepItNullableAndNotFail() throws SQLException {
+ void execute_whenUuidColumnIsNullable_shouldKeepItNullableAndNotFail() throws SQLException {
db.assertColumnDefinition(GROUPS_USERS_TABLE_NAME, GROUPS_USERS_UUID_COLUMN_NAME, VARCHAR, null, true);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/PopulateGroupsUsersUuidIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/PopulateGroupsUsersUuidIT.java
index df42ba5b6cc..b794628c534 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/PopulateGroupsUsersUuidIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/PopulateGroupsUsersUuidIT.java
@@ -23,24 +23,24 @@ import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.assertj.core.groups.Tuple;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
-public class PopulateGroupsUsersUuidIT {
+class PopulateGroupsUsersUuidIT {
private static final String GROUPS_USERS_TABLE_NAME = "groups_users";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateGroupsUsersUuid.class);
private final PopulateGroupsUsersUuid migration = new PopulateGroupsUsersUuid(db.database(), UuidFactoryFast.getInstance());
@Test
- public void execute_whenTableIsEmpty_shouldPopulate() throws SQLException {
+ void execute_whenTableIsEmpty_shouldPopulate() throws SQLException {
insertRowsWithoutUuid();
migration.execute();
@@ -51,7 +51,7 @@ public class PopulateGroupsUsersUuidIT {
@Test
- public void execute_isReentrant() throws SQLException {
+ void execute_isReentrant() throws SQLException {
insertRowsWithoutUuid();
migration.execute();
List<Tuple> existingUuids = getExistingUuids();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/PopulateRuleTagsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/PopulateRuleTagsTableIT.java
index 7ca957a4f68..f7bb7df824b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/PopulateRuleTagsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/PopulateRuleTagsTableIT.java
@@ -21,22 +21,22 @@ package org.sonar.server.platform.db.migration.version.v104;
import java.sql.SQLException;
import javax.annotation.Nullable;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
-public class PopulateRuleTagsTableIT {
+class PopulateRuleTagsTableIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(PopulateRuleTagsTable.class);
private final PopulateRuleTagsTable migration = new PopulateRuleTagsTable(db.database());
@Test
- public void execute_whenTagsExist_shouldPopulateProperly() throws SQLException {
+ void execute_whenTagsExist_shouldPopulateProperly() throws SQLException {
insertRule("uuid-1", null, "tag_1,tag_2");
insertRule("uuid-2", "systag_1,systag_2", null);
insertRule("uuid-3", "systag_3,systag_4", "tag_3,tag_4");
@@ -58,7 +58,7 @@ public class PopulateRuleTagsTableIT {
}
@Test
- public void execute_whenEmptyOrDuplicateTagsExist_shouldNotBeMigrated() throws SQLException {
+ void execute_whenEmptyOrDuplicateTagsExist_shouldNotBeMigrated() throws SQLException {
insertRule("uuid-1", null, "tag_1,,tag_2");
insertRule("uuid-2", "systag_1,,systag_2,systag_2,", null);
@@ -75,7 +75,7 @@ public class PopulateRuleTagsTableIT {
}
@Test
- public void execute_whenRunMoreThanOnce_shouldBeReentrant() throws SQLException {
+ void execute_whenRunMoreThanOnce_shouldBeReentrant() throws SQLException {
insertRule("uuid-3", "sys_tag", "tag");
migration.execute();
migration.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/RemoveCleanCodeAttributeFromCustomHotspotRulesIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/RemoveCleanCodeAttributeFromCustomHotspotRulesIT.java
index 3436a4c7b34..b5285f8560a 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/RemoveCleanCodeAttributeFromCustomHotspotRulesIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/RemoveCleanCodeAttributeFromCustomHotspotRulesIT.java
@@ -23,28 +23,28 @@ import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;
-public class RemoveCleanCodeAttributeFromCustomHotspotRulesIT {
+class RemoveCleanCodeAttributeFromCustomHotspotRulesIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RemoveCleanCodeAttributeFromCustomHotspotRules.class);
private final RemoveCleanCodeAttributeFromCustomHotspotRules underTest = new RemoveCleanCodeAttributeFromCustomHotspotRules(db.database());
@Test
- public void execute_whenRulesTableIsEmpty_shouldDoNothing() throws SQLException {
+ void execute_whenRulesTableIsEmpty_shouldDoNothing() throws SQLException {
underTest.execute();
assertThat(db.select("select clean_code_attribute from rules")).isEmpty();
}
@Test
- public void execute_whenCustomHotspotRuleExist_shouldRemoveCleanCodeAttributeOnlyFromHotspot() throws SQLException {
+ void execute_whenCustomHotspotRuleExist_shouldRemoveCleanCodeAttributeOnlyFromHotspot() throws SQLException {
insertRule("custom_hotspot_rule", 4, "CONVENTIONAL");
insertRule("other_rule", 1, "ETHICAL");
@@ -66,7 +66,7 @@ public class RemoveCleanCodeAttributeFromCustomHotspotRulesIT {
}
@Test
- public void execute_whenCustomHotspotRuleExist_isReentrant() throws SQLException {
+ void execute_whenCustomHotspotRuleExist_isReentrant() throws SQLException {
insertRule("custom_hotspot_rule", 4, "CONVENTIONAL");
insertRule("other_rule", 1, "ETHICAL");
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/RenameWontFixIssuesMetricIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/RenameWontFixIssuesMetricIT.java
index c50b52e59dc..d335b390a2d 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/RenameWontFixIssuesMetricIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v104/RenameWontFixIssuesMetricIT.java
@@ -20,28 +20,28 @@
package org.sonar.server.platform.db.migration.version.v104;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.assertj.core.api.Assertions.assertThat;
-public class RenameWontFixIssuesMetricIT {
+class RenameWontFixIssuesMetricIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(RenameWontFixIssuesMetric.class);
private final RenameWontFixIssuesMetric underTest = new RenameWontFixIssuesMetric(db.database());
@Test
- public void execute_whenMetricsTableIsEmpty_shouldDoNothing() throws SQLException {
+ void execute_whenMetricsTableIsEmpty_shouldDoNothing() throws SQLException {
underTest.execute();
assertThat(db.select("select name from metrics")).isEmpty();
}
@Test
- public void execute_whenWontFixMetricExist_shouldRenameToAccepted() throws SQLException {
+ void execute_whenWontFixMetricExist_shouldRenameToAccepted() throws SQLException {
insertMetric("wont_fix_issues");
insertMetric("other_metric");
@@ -53,7 +53,7 @@ public class RenameWontFixIssuesMetricIT {
}
@Test
- public void execute_isReentrant() throws SQLException {
+ void execute_isReentrant() throws SQLException {
insertMetric("wont_fix_issues");
insertMetric("other_metric");
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/CreatePrimaryKeyOnIssuesImpactsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/CreatePrimaryKeyOnIssuesImpactsTableIT.java
index 3e295373be1..08ea6d5558b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/CreatePrimaryKeyOnIssuesImpactsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/CreatePrimaryKeyOnIssuesImpactsTableIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v105;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.sonar.server.platform.db.migration.version.v105.CreatePrimaryKeyOnIssuesImpactsTable.ISSUE_KEY_COLUMN_NAME;
@@ -29,14 +29,14 @@ import static org.sonar.server.platform.db.migration.version.v105.CreatePrimaryK
import static org.sonar.server.platform.db.migration.version.v105.CreatePrimaryKeyOnIssuesImpactsTable.SOFTWARE_QUALITY_COLUMN;
import static org.sonar.server.platform.db.migration.version.v105.CreatePrimaryKeyOnIssuesImpactsTable.TABLE_NAME;
-public class CreatePrimaryKeyOnIssuesImpactsTableIT {
- @Rule
+class CreatePrimaryKeyOnIssuesImpactsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreatePrimaryKeyOnIssuesImpactsTable.class);
private final CreatePrimaryKeyOnIssuesImpactsTable createIndex = new CreatePrimaryKeyOnIssuesImpactsTable(db.database());
@Test
- public void execute_whenPrimaryKeyDoesntExist_shouldCreatePrimaryKey() throws SQLException {
+ void execute_whenPrimaryKeyDoesntExist_shouldCreatePrimaryKey() throws SQLException {
db.assertNoPrimaryKey(TABLE_NAME);
createIndex.execute();
@@ -44,7 +44,7 @@ public class CreatePrimaryKeyOnIssuesImpactsTableIT {
}
@Test
- public void execute_whenPrimaryKeyAlreadyExist_shouldKeepThePrimaryKeyAndNotFail() throws SQLException {
+ void execute_whenPrimaryKeyAlreadyExist_shouldKeepThePrimaryKeyAndNotFail() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/CreatePrimaryKeyOnRulesDefaultImpactsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/CreatePrimaryKeyOnRulesDefaultImpactsTableIT.java
index a2749be32c5..b0f4df29981 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/CreatePrimaryKeyOnRulesDefaultImpactsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/CreatePrimaryKeyOnRulesDefaultImpactsTableIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v105;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import static org.sonar.server.platform.db.migration.version.v105.CreatePrimaryKeyOnRulesDefaultImpactsTable.PK_NAME;
@@ -29,14 +29,14 @@ import static org.sonar.server.platform.db.migration.version.v105.CreatePrimaryK
import static org.sonar.server.platform.db.migration.version.v105.CreatePrimaryKeyOnRulesDefaultImpactsTable.SOFTWARE_QUALITY_COLUMN;
import static org.sonar.server.platform.db.migration.version.v105.CreatePrimaryKeyOnRulesDefaultImpactsTable.TABLE_NAME;
-public class CreatePrimaryKeyOnRulesDefaultImpactsTableIT {
- @Rule
+class CreatePrimaryKeyOnRulesDefaultImpactsTableIT {
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(CreatePrimaryKeyOnRulesDefaultImpactsTable.class);
private final CreatePrimaryKeyOnRulesDefaultImpactsTable createIndex = new CreatePrimaryKeyOnRulesDefaultImpactsTable(db.database());
@Test
- public void execute_whenPrimaryKeyDoesntExist_shouldCreatePrimaryKey() throws SQLException {
+ void execute_whenPrimaryKeyDoesntExist_shouldCreatePrimaryKey() throws SQLException {
db.assertNoPrimaryKey(TABLE_NAME);
createIndex.execute();
@@ -44,7 +44,7 @@ public class CreatePrimaryKeyOnRulesDefaultImpactsTableIT {
}
@Test
- public void execute_whenPrimaryKeyAlreadyExist_shouldKeepThePrimaryKeyAndNotFail() throws SQLException {
+ void execute_whenPrimaryKeyAlreadyExist_shouldKeepThePrimaryKeyAndNotFail() throws SQLException {
createIndex.execute();
createIndex.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropPrimaryKeyConstraintInIssuesImpactsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropPrimaryKeyConstraintInIssuesImpactsTableIT.java
index 22c92f8bdcc..f88850d503b 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropPrimaryKeyConstraintInIssuesImpactsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropPrimaryKeyConstraintInIssuesImpactsTableIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v105;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.sql.DbPrimaryKeyConstraintFinder;
import org.sonar.server.platform.db.migration.sql.DropPrimaryKeySqlGenerator;
@@ -31,9 +31,9 @@ import static org.sonar.server.platform.db.migration.version.v105.DropPrimaryKey
import static org.sonar.server.platform.db.migration.version.v105.DropPrimaryKeyConstraintInIssuesImpactsTable.CONSTRAINT_NAME;
import static org.sonar.server.platform.db.migration.version.v105.DropPrimaryKeyConstraintInIssuesImpactsTable.TABLE_NAME;
-public class DropPrimaryKeyConstraintInIssuesImpactsTableIT {
+class DropPrimaryKeyConstraintInIssuesImpactsTableIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropPrimaryKeyConstraintInIssuesImpactsTable.class);
private final DbPrimaryKeyConstraintFinder dbPrimaryKeyConstraintFinder = new DbPrimaryKeyConstraintFinder(db.database());
@@ -41,14 +41,14 @@ public class DropPrimaryKeyConstraintInIssuesImpactsTableIT {
new DropPrimaryKeySqlGenerator(db.database(), dbPrimaryKeyConstraintFinder), dbPrimaryKeyConstraintFinder);
@Test
- public void execute_shouldRemoveExistingPrimaryKey() throws SQLException {
+ void execute_shouldRemoveExistingPrimaryKey() throws SQLException {
db.assertPrimaryKey(TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME);
underTest.execute();
db.assertNoPrimaryKey(TABLE_NAME);
}
@Test
- public void execute_when_reentrant_shouldRemoveExistingPrimaryKey() throws SQLException {
+ void execute_when_reentrant_shouldRemoveExistingPrimaryKey() throws SQLException {
db.assertPrimaryKey(TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropPrimaryKeyConstraintInRulesDefaultImpactsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropPrimaryKeyConstraintInRulesDefaultImpactsTableIT.java
index 4dec602889d..16dfefbb258 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropPrimaryKeyConstraintInRulesDefaultImpactsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropPrimaryKeyConstraintInRulesDefaultImpactsTableIT.java
@@ -20,8 +20,8 @@
package org.sonar.server.platform.db.migration.version.v105;
import java.sql.SQLException;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.sql.DbPrimaryKeyConstraintFinder;
import org.sonar.server.platform.db.migration.sql.DropPrimaryKeySqlGenerator;
@@ -31,9 +31,9 @@ import static org.sonar.server.platform.db.migration.version.v105.DropPrimaryKey
import static org.sonar.server.platform.db.migration.version.v105.DropPrimaryKeyConstraintInRulesDefaultImpactsTable.CONSTRAINT_NAME;
import static org.sonar.server.platform.db.migration.version.v105.DropPrimaryKeyConstraintInRulesDefaultImpactsTable.TABLE_NAME;
-public class DropPrimaryKeyConstraintInRulesDefaultImpactsTableIT {
+class DropPrimaryKeyConstraintInRulesDefaultImpactsTableIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropPrimaryKeyConstraintInRulesDefaultImpactsTable.class);
private final DbPrimaryKeyConstraintFinder dbPrimaryKeyConstraintFinder = new DbPrimaryKeyConstraintFinder(db.database());
@@ -41,14 +41,14 @@ public class DropPrimaryKeyConstraintInRulesDefaultImpactsTableIT {
new DropPrimaryKeySqlGenerator(db.database(), dbPrimaryKeyConstraintFinder), dbPrimaryKeyConstraintFinder);
@Test
- public void execute_shouldRemoveExistingPrimaryKey() throws SQLException {
+ void execute_shouldRemoveExistingPrimaryKey() throws SQLException {
db.assertPrimaryKey(TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME);
underTest.execute();
db.assertNoPrimaryKey(TABLE_NAME);
}
@Test
- public void execute_when_reentrant_shouldRemoveExistingPrimaryKey() throws SQLException {
+ void execute_when_reentrant_shouldRemoveExistingPrimaryKey() throws SQLException {
db.assertPrimaryKey(TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropUuidColumnInIssuesImpactsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropUuidColumnInIssuesImpactsTableIT.java
index ae4dbce13aa..245dd4b4f13 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropUuidColumnInIssuesImpactsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropUuidColumnInIssuesImpactsTableIT.java
@@ -21,29 +21,29 @@ package org.sonar.server.platform.db.migration.version.v105;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
import static org.sonar.server.platform.db.migration.version.v105.DropUuidColumnInIssuesImpactsTable.COLUMN_NAME;
import static org.sonar.server.platform.db.migration.version.v105.DropUuidColumnInIssuesImpactsTable.TABLE_NAME;
-public class DropUuidColumnInIssuesImpactsTableIT {
+class DropUuidColumnInIssuesImpactsTableIT {
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropUuidColumnInIssuesImpactsTable.class);
private final DdlChange underTest = new DropUuidColumnInIssuesImpactsTable(db.database());
@Test
- public void executed_whenRun_shouldDropSystemTagsColumn() throws SQLException {
+ void executed_whenRun_shouldDropSystemTagsColumn() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 40, false);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void execute_whenRunMoreThanOnce_shouldBeReentrant() throws SQLException {
+ void execute_whenRunMoreThanOnce_shouldBeReentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 40, false);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropUuidColumnInRulesDefaultImpactsTableIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropUuidColumnInRulesDefaultImpactsTableIT.java
index 6428c67b0ab..503de4e9a67 100644
--- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropUuidColumnInRulesDefaultImpactsTableIT.java
+++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v105/DropUuidColumnInRulesDefaultImpactsTableIT.java
@@ -21,28 +21,28 @@ package org.sonar.server.platform.db.migration.version.v105;
import java.sql.SQLException;
import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.db.MigrationDbTester;
import org.sonar.server.platform.db.migration.step.DdlChange;
-public class DropUuidColumnInRulesDefaultImpactsTableIT {
+class DropUuidColumnInRulesDefaultImpactsTableIT {
private static final String TABLE_NAME = "issues_impacts";
private static final String COLUMN_NAME = "uuid";
- @Rule
+ @RegisterExtension
public final MigrationDbTester db = MigrationDbTester.createForMigrationStep(DropUuidColumnInIssuesImpactsTable.class);
private final DdlChange underTest = new DropUuidColumnInIssuesImpactsTable(db.database());
@Test
- public void executed_whenRun_shouldDropSystemTagsColumn() throws SQLException {
+ void executed_whenRun_shouldDropSystemTagsColumn() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 40, false);
underTest.execute();
db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
}
@Test
- public void execute_whenRunMoreThanOnce_shouldBeReentrant() throws SQLException {
+ void execute_whenRunMoreThanOnce_shouldBeReentrant() throws SQLException {
db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.VARCHAR, 40, false);
underTest.execute();
underTest.execute();
diff --git a/server/sonar-db-migration/src/testFixtures/java/org/sonar/db/MigrationDbTester.java b/server/sonar-db-migration/src/testFixtures/java/org/sonar/db/MigrationDbTester.java
index 69ebcb8fadc..1622b3bb9f1 100644
--- a/server/sonar-db-migration/src/testFixtures/java/org/sonar/db/MigrationDbTester.java
+++ b/server/sonar-db-migration/src/testFixtures/java/org/sonar/db/MigrationDbTester.java
@@ -21,9 +21,12 @@ package org.sonar.db;
import java.sql.SQLException;
import javax.annotation.Nullable;
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
import org.sonar.server.platform.db.migration.step.MigrationStep;
-public class MigrationDbTester extends AbstractDbTester<MigrationTestDb> {
+public class MigrationDbTester extends AbstractDbTester<MigrationTestDb> implements BeforeEachCallback, AfterEachCallback {
private MigrationDbTester(@Nullable Class<? extends MigrationStep> migrationStepClass) {
super(new MigrationTestDb(migrationStepClass));
@@ -57,4 +60,14 @@ public class MigrationDbTester extends AbstractDbTester<MigrationTestDb> {
throw new IllegalStateException("Fail to truncate db tables", e);
}
}
+
+ @Override
+ public void afterEach(ExtensionContext extensionContext) throws Exception {
+ after();
+ }
+
+ @Override
+ public void beforeEach(ExtensionContext extensionContext) throws Exception {
+ before();
+ }
}