]> source.dussan.org Git - sonarqube.git/commitdiff
Redundant throws clause in tests
authorDavid Gageot <david@gageot.net>
Thu, 7 May 2015 17:04:22 +0000 (19:04 +0200)
committerDavid Gageot <david@gageot.net>
Thu, 7 May 2015 17:12:29 +0000 (19:12 +0200)
682 files changed:
plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/dashboards/ProjectIssuesDashboardTest.java
plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/notifications/alerts/NewAlertsTest.java
plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzerTest.java
plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationChannelTest.java
server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/JavaCommandTest.java
server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/JavaProcessLauncherTest.java
server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java
server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/StreamGobblerTest.java
server/sonar-process/src/test/java/org/sonar/process/AesCipherTest.java
server/sonar-process/src/test/java/org/sonar/process/ConfigurationUtilsTest.java
server/sonar-process/src/test/java/org/sonar/process/LifecycleTest.java
server/sonar-process/src/test/java/org/sonar/process/LogbackHelperTest.java
server/sonar-process/src/test/java/org/sonar/process/LoopbackAddressTest.java
server/sonar-process/src/test/java/org/sonar/process/MinimumViableSystemTest.java
server/sonar-process/src/test/java/org/sonar/process/NetworkUtilsTest.java
server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java
server/sonar-process/src/test/java/org/sonar/process/ProcessPropertiesTest.java
server/sonar-process/src/test/java/org/sonar/process/ProcessUtilsTest.java
server/sonar-process/src/test/java/org/sonar/process/PropsTest.java
server/sonar-process/src/test/java/org/sonar/process/SystemExitTest.java
server/sonar-search/src/test/java/org/sonar/search/SearchLoggingTest.java
server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java
server/sonar-search/src/test/java/org/sonar/search/script/UpdateListScriptTest.java
server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/IssueIndexBenchmarkTest.java
server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java
server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java
server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceIndexBenchmarkTest.java
server/sonar-server/src/test/java/org/sonar/core/computation/dbcleaner/ProjectCleanerTest.java
server/sonar-server/src/test/java/org/sonar/server/activity/ActivityServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/activity/RubyQProfileActivityServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/activity/db/ActivityDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityIndexDefinitionTest.java
server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/activity/ws/ActivitiesWebServiceMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/app/StartupLogsTest.java
server/sonar-server/src/test/java/org/sonar/server/app/TomcatConnectorsTest.java
server/sonar-server/src/test/java/org/sonar/server/app/WebLoggingTest.java
server/sonar-server/src/test/java/org/sonar/server/app/WebappTest.java
server/sonar-server/src/test/java/org/sonar/server/authentication/ws/AuthenticationWsTest.java
server/sonar-server/src/test/java/org/sonar/server/batch/BatchIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsTest.java
server/sonar-server/src/test/java/org/sonar/server/batch/GlobalRepositoryActionTest.java
server/sonar-server/src/test/java/org/sonar/server/batch/IssuesActionTest.java
server/sonar-server/src/test/java/org/sonar/server/batch/ProjectRepositoryActionTest.java
server/sonar-server/src/test/java/org/sonar/server/batch/ProjectRepositoryLoaderMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/batch/UsersActionTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ComponentCleanerServiceMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ComponentQueryTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ComponentServiceMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/component/DefaultComponentFinderTest.java
server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentIndexDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentLinkDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/component/db/SnapshotDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentsWsTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ws/EventsWsTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ws/ProjectsWsTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ws/ResourcesWsTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ws/SearchActionTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ComputationContainerTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ComputationContextTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ComputationThreadTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ReportQueueTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/db/AnalysisReportDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueComputationTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleCacheLoaderTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleCacheTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/ScmAccountCacheLoaderTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/SourceLinesCacheTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/measure/MetricCacheTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/source/ComputeFileSourceDataTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/source/CoverageLineReaderTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/source/DuplicationLineReaderTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/source/RangeOffsetHelperTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/source/ReportIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/source/ScmLineReaderTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/source/SymbolsLineReaderTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/BaseStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/ComponentUuidsCacheTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputationStepsTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexComponentsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexIssuesStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexSourceLinesStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexTestsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexViewsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistComponentLinksStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileDependenciesStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistIssuesStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistTestsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeRemovedViewsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/SendIssueNotificationsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/SwitchSnapshotStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ws/ComputationWebServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ws/HistoryWsActionMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ws/IsQueueEmptyWebServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ws/QueueWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ws/SubmitReportWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/config/ws/PropertiesWsTest.java
server/sonar-server/src/test/java/org/sonar/server/dashboard/db/WidgetDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseFactoryTest.java
server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseTest.java
server/sonar-server/src/test/java/org/sonar/server/db/ResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/AddColumnsBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/BaseDataChangeTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/DatabaseMigratorTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/DropColumnsBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/MigrationStepsTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/PlatformDatabaseMigrationConcurrentAccessTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/PlatformDatabaseMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ProgressTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ViolationConvertersTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v36/ViolationMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/ConvertIssueDebtToMinutesMigrationStepTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/DevelopmentCostMeasuresMigrationStepTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/IssueChangelogMigrationStepTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/NotResolvedIssuesOnRemovedComponentsMigrationStepTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/RequirementMeasuresMigrationStepTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/TechnicalDebtMeasuresMigrationStepTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v43/WorkDurationConvertorTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/ChangeLogMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/ConvertProfileMeasuresMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/IssueActionPlanKeyMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v44/MeasureDataMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v45/AddMissingRuleParameterDefaultValuesMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v45/DeleteMeasuresOnDeletedProfilesMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v451/AddMissingCustomRuleParametersMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v451/DeleteUnescapedActivitiesTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/FeedFileSourcesTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/PopulateProjectsUuidColumnsMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/RemoveSortFieldFromIssueFiltersMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/ReplaceIssueFiltersProjectKeyByUuidTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/AddIssuesColumnsTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/AddNewCharacteristicsTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/CopyScmAccountsFromAuthorsToUsersTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/DropIssuesColumnsTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedEventsLongDatesTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedIssueComponentUuidsTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedIssueTagsTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedManualMeasuresLongDatesTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/FeedSemaphoresLongDatesTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/RemovePermissionsOnModulesMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/RenameComponentRelatedParamsInIssueFiltersMigrationTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/AddDependenciesColumnsTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/AddDependenciesComponentUuidColumnsTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/DropDependenciesComponentColumnsTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/FeedDependenciesComponentUuidsTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/FeedEventsComponentUuidTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/FeedFileSourcesDataTypeTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/FeedProjectLinksComponentUuidTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/v52/MoveProjectProfileAssociationTest.java
server/sonar-server/src/test/java/org/sonar/server/debt/DebtMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java
server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelLookupTest.java
server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelOperationsTest.java
server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelPluginRepositoryTest.java
server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelXMLExporterTest.java
server/sonar-server/src/test/java/org/sonar/server/design/db/FileDependencyDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/design/ws/DependenciesWsTest.java
server/sonar-server/src/test/java/org/sonar/server/design/ws/ShowActionTest.java
server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsJsonWriterTest.java
server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsParserTest.java
server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsWsTest.java
server/sonar-server/src/test/java/org/sonar/server/duplication/ws/ShowActionTest.java
server/sonar-server/src/test/java/org/sonar/server/es/BulkIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/es/DefaultIndexSettingsTest.java
server/sonar-server/src/test/java/org/sonar/server/es/EsClientTest.java
server/sonar-server/src/test/java/org/sonar/server/es/EsUtilsTest.java
server/sonar-server/src/test/java/org/sonar/server/es/IndexDefinitionContextTest.java
server/sonar-server/src/test/java/org/sonar/server/es/IndexDefinitionHashTest.java
server/sonar-server/src/test/java/org/sonar/server/es/NewIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/es/SearchOptionsTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyBulkRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClearCacheRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterHealthRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterStateRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyClusterStatsRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyCountRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyCreateIndexRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyDeleteByQueryRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyDeleteRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyFlushRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyGetRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndexRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndicesExistsRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyIndicesStatsRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyMultiGetRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyNodesStatsRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyPutMappingRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxyRefreshRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxySearchRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/request/ProxySearchScrollRequestBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/event/db/EventDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/exceptions/BadRequestExceptionTest.java
server/sonar-server/src/test/java/org/sonar/server/exceptions/MessageTest.java
server/sonar-server/src/test/java/org/sonar/server/exceptions/VerificationsTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/AddTagsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/AssignActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/IssueBulkChangeServiceMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/IssueCommentServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/IssueServiceMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/PlanActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/RemoveTagsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/RulesAggregationTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ServerIssueStorageTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/actionplan/ActionPlanWsTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/db/IssueDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/filter/AppActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/filter/FavoritesActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterWriterTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/filter/IssueFilterWsTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/filter/RegisterIssueFiltersTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/filter/ShowActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexDefinitionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcherTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcherTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/IssueChangeNotificationTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcherTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesStatisticsTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/AuthorsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/ComponentTagsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueActionsWriterTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueShowActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueTagsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssuesWsTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/SetTagsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/language/ws/LanguageWsTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterEngineTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/persistence/MeasureDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/persistence/MetricDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/ws/ManualMeasuresWsTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/ws/MetricsWsTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/ws/TimeMachineWsTest.java
server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ApplyPermissionTemplateQueryTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/InternalPermissionServiceMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/InternalPermissionTemplateServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/PermissionChangeTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/PermissionFinderTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/PermissionQueryParserTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/PermissionQueryTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/PermissionTemplateTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/PermissionTemplateUpdaterTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/PermissionsWsTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/BackendCleanupMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/MasterServletFilterTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/PersistentSettingsTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/RailsAppsDeployerTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ServerSettingsTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/DatabaseMonitorTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/EsMonitorTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/JvmPropertiesMonitorTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/PluginsMonitorTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/SonarQubeMonitorTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/SystemMonitorTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ws/MigrateDbSystemWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ws/ServerWsTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemInfoWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemWsTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ws/UpgradesSystemWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/PluginDownloaderTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/StaticResourcesServletTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/AbstractUpdateCenterBasedPluginsWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/AvailablePluginsWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/CancelAllPluginsWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstallPluginsWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstalledPluginsWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PendingPluginsWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PluginUpdateAggregateBuilderTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PluginUpdateAggregatorTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PluginsWsTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/UninstallPluginsWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/UpdatePluginsWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/UpdatesPluginsWsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/properties/ProjectSettingsFactoryTest.java
server/sonar-server/src/test/java/org/sonar/server/properties/ProjectSettingsTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/QualityGatesTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesWsTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ActiveRuleBackendMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/BuiltInProfilesTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileBackuperMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileComparisonMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileCopierMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileExportersTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileProjectOperationsMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileResetMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileServiceMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfilesTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/RegisterQualityProfilesMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/RuleActivatorMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileBackupActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileChangeParentActionMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileChangelogActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileCompareActionMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileCopyActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileCreateActionMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileDeleteActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileExportActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileInheritanceActionMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileProjectsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileRenameActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileRestoreActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileRestoreBuiltInActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileSearchActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfileSetDefaultActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsTest.java
server/sonar-server/src/test/java/org/sonar/server/ruby/PlatformRackBridgeTest.java
server/sonar-server/src/test/java/org/sonar/server/ruby/PlatformRubyBridgeTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/DefaultRuleFinderMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/DeprecatedRulesDefinitionLoaderTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RubyRuleServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RuleBackendMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RuleCreatorMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RuleDeleterMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RuleOperationsTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RuleServiceMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RuleTagHelperTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RuleUpdaterMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/db/RuleDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/ws/CreateActionMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/ws/DeleteActionTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/ws/RuleMappingTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/ws/ShowActionMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/ws/UpdateActionMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/search/BaseDocTest.java
server/sonar-server/src/test/java/org/sonar/server/search/BaseIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/search/QueryContextTest.java
server/sonar-server/src/test/java/org/sonar/server/search/SearchClientMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/search/action/DeleteKeyTest.java
server/sonar-server/src/test/java/org/sonar/server/search/action/RefreshIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/search/ws/SearchOptionsTest.java
server/sonar-server/src/test/java/org/sonar/server/source/DecorationDataHolderTest.java
server/sonar-server/src/test/java/org/sonar/server/source/HtmlTextDecoratorTest.java
server/sonar-server/src/test/java/org/sonar/server/source/SourceServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/source/db/FileSourceDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexDefinitionTest.java
server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/source/ws/HashActionTest.java
server/sonar-server/src/test/java/org/sonar/server/source/ws/IndexActionTest.java
server/sonar-server/src/test/java/org/sonar/server/source/ws/LinesActionTest.java
server/sonar-server/src/test/java/org/sonar/server/source/ws/RawActionTest.java
server/sonar-server/src/test/java/org/sonar/server/source/ws/ScmActionTest.java
server/sonar-server/src/test/java/org/sonar/server/source/ws/ShowActionTest.java
server/sonar-server/src/test/java/org/sonar/server/source/ws/SourcesWsTest.java
server/sonar-server/src/test/java/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest.java
server/sonar-server/src/test/java/org/sonar/server/startup/JdbcDriverDeployerTest.java
server/sonar-server/src/test/java/org/sonar/server/startup/RegisterDebtModelTest.java
server/sonar-server/src/test/java/org/sonar/server/startup/RegisterPermissionTemplatesTest.java
server/sonar-server/src/test/java/org/sonar/server/startup/RenameIssueWidgetsTest.java
server/sonar-server/src/test/java/org/sonar/server/test/CoverageServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/test/index/TestIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsCoveredFilesActionTest.java
server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsListActionTest.java
server/sonar-server/src/test/java/org/sonar/server/test/ws/TestsWsTest.java
server/sonar-server/src/test/java/org/sonar/server/text/RubyTextServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/ui/JRubyI18nTest.java
server/sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java
server/sonar-server/src/test/java/org/sonar/server/ui/ws/ComponentNavigationActionTest.java
server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalNavigationActionTest.java
server/sonar-server/src/test/java/org/sonar/server/ui/ws/SettingsNavigationActionTest.java
server/sonar-server/src/test/java/org/sonar/server/updatecenter/ws/UpdateCenterWsTest.java
server/sonar-server/src/test/java/org/sonar/server/user/DefaultUserServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipFinderTest.java
server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/UserSessionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java
server/sonar-server/src/test/java/org/sonar/server/user/db/GroupDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/user/db/UserDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/user/db/UserGroupDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexDefinitionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/DeactivateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/FavoritesWsTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/GroupsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/UserPropertiesWsTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/UsersWsTest.java
server/sonar-server/src/test/java/org/sonar/server/util/BooleanTypeValidationTest.java
server/sonar-server/src/test/java/org/sonar/server/util/CloseableIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/util/DateCollectorTest.java
server/sonar-server/src/test/java/org/sonar/server/util/FloatTypeValidationTest.java
server/sonar-server/src/test/java/org/sonar/server/util/IntegerTypeValidationTest.java
server/sonar-server/src/test/java/org/sonar/server/util/ProgressLoggerTest.java
server/sonar-server/src/test/java/org/sonar/server/util/RubyUtilsTest.java
server/sonar-server/src/test/java/org/sonar/server/util/SlugTest.java
server/sonar-server/src/test/java/org/sonar/server/util/StringListTypeValidationTest.java
server/sonar-server/src/test/java/org/sonar/server/util/StringTypeValidationTest.java
server/sonar-server/src/test/java/org/sonar/server/util/TextTypeValidationTest.java
server/sonar-server/src/test/java/org/sonar/server/util/TypeValidationsTest.java
server/sonar-server/src/test/java/org/sonar/server/util/cache/DiskCacheTest.java
server/sonar-server/src/test/java/org/sonar/server/util/cache/MemoryCacheTest.java
server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexDefinitionTest.java
server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexerMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/ws/ListingWsTest.java
server/sonar-server/src/test/java/org/sonar/server/ws/ServletRequestTest.java
server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarClientTest.java
server/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java
server/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java
server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/DefaultActionPlanClientTest.java
server/sonar-ws-client/src/test/java/org/sonar/wsclient/system/internal/DefaultSystemClientTest.java
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PluginUnmarshallerTest.java
server/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshallerTest.java
server/sonar-ws-client/src/test/java/org/sonar/wsclient/user/DefaultUserClientTest.java
server/sonar-ws-client/src/test/java/org/sonar/wsclient/user/UserQueryTest.java
sonar-application/src/test/java/org/sonar/application/AppLoggingTest.java
sonar-application/src/test/java/org/sonar/application/CommandLineParserTest.java
sonar-application/src/test/java/org/sonar/application/JdbcSettingsTest.java
sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/ProtobufUtilTest.java
sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/input/GlobalRepositoriesTest.java
sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportReaderTest.java
sonar-batch-protocol/src/test/java/org/sonar/batch/protocol/output/BatchReportWriterTest.java
sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java
sonar-batch/src/test/java/org/sonar/batch/bootstrap/DatabaseCompatibilityTest.java
sonar-batch/src/test/java/org/sonar/batch/bootstrap/DefaultPluginsRepositoryTest.java
sonar-batch/src/test/java/org/sonar/batch/bootstrap/ExtensionInstallerTest.java
sonar-batch/src/test/java/org/sonar/batch/bootstrap/JdbcDriverHolderTest.java
sonar-batch/src/test/java/org/sonar/batch/bootstrap/ServerClientTest.java
sonar-batch/src/test/java/org/sonar/batch/components/PastSnapshotFinderTest.java
sonar-batch/src/test/java/org/sonar/batch/debt/DebtDecoratorTest.java
sonar-batch/src/test/java/org/sonar/batch/debt/DebtModelProviderTest.java
sonar-batch/src/test/java/org/sonar/batch/debt/IssueChangelogDebtCalculatorTest.java
sonar-batch/src/test/java/org/sonar/batch/debt/NewDebtDecoratorTest.java
sonar-batch/src/test/java/org/sonar/batch/debt/SqaleRatingDecoratorTest.java
sonar-batch/src/test/java/org/sonar/batch/debt/SqaleRatingGridTest.java
sonar-batch/src/test/java/org/sonar/batch/debt/SqaleRatingSettingsTest.java
sonar-batch/src/test/java/org/sonar/batch/deprecated/ResourceFiltersTest.java
sonar-batch/src/test/java/org/sonar/batch/deprecated/components/PastSnapshotFinderByPreviousVersionTest.java
sonar-batch/src/test/java/org/sonar/batch/duplication/DuplicationCacheTest.java
sonar-batch/src/test/java/org/sonar/batch/index/CacheTest.java
sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java
sonar-batch/src/test/java/org/sonar/batch/index/ResourceCacheTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/DefaultIssueFilterChainTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/DefaultProjectIssuesTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/IssuableFactoryTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/IssueCacheTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/IssueFiltersTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/ModuleIssuesTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/ignore/pattern/PatternMatcherTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/ignore/scanner/IssueExclusionsLoaderTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/tracking/InitialOpenIssuesStackTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/tracking/IssueHandlersTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/tracking/IssueTrackingDecoratorTest.java
sonar-batch/src/test/java/org/sonar/batch/issue/tracking/IssueTrackingTest.java
sonar-batch/src/test/java/org/sonar/batch/language/LanguageDistributionDecoratorTest.java
sonar-batch/src/test/java/org/sonar/batch/maven/MavenProjectBootstrapperTest.java
sonar-batch/src/test/java/org/sonar/batch/mediumtest/fs/FileSystemMediumTest.java
sonar-batch/src/test/java/org/sonar/batch/postjob/PostJobOptimizerTest.java
sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java
sonar-batch/src/test/java/org/sonar/batch/qualitygate/QualityGateVerifierTest.java
sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java
sonar-batch/src/test/java/org/sonar/batch/rule/QProfileDecoratorTest.java
sonar-batch/src/test/java/org/sonar/batch/rule/QProfileSensorTest.java
sonar-batch/src/test/java/org/sonar/batch/rule/RulesProfileProviderTest.java
sonar-batch/src/test/java/org/sonar/batch/rule/RulesProviderTest.java
sonar-batch/src/test/java/org/sonar/batch/rule/UsedQProfilesTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/LanguageVerifierTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorBuilderTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorValidatorTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/AdditionalFilePredicatesTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/DefaultModuleFileSystemTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/DeprecatedFileFiltersTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/ExclusionFiltersTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/InputFileBuilderFactoryTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/InputPathCacheTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/LanguageDetectionTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/StatusDetectionTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/measure/MeasureCacheTest.java
sonar-batch/src/test/java/org/sonar/batch/sensor/SensorOptimizerTest.java
sonar-batch/src/test/java/org/sonar/batch/source/DefaultHighlightableTest.java
sonar-batch/src/test/java/org/sonar/batch/source/DefaultSymbolTableTest.java
sonar-batch/src/test/java/org/sonar/batch/source/DefaultSymbolizableTest.java
sonar-batch/src/test/java/org/sonar/batch/source/HighlightableBuilderTest.java
sonar-batch/src/test/java/org/sonar/batch/source/SymbolizableBuilderTest.java
sonar-core/src/test/java/org/sonar/core/UtcDateUtilsTest.java
sonar-core/src/test/java/org/sonar/core/component/ComponentDtoTest.java
sonar-core/src/test/java/org/sonar/core/component/GraphPerspectiveBuilderTest.java
sonar-core/src/test/java/org/sonar/core/computation/dbcleaner/DefaultPurgeTaskTest.java
sonar-core/src/test/java/org/sonar/core/dashboard/ActiveDashboardDaoTest.java
sonar-core/src/test/java/org/sonar/core/dashboard/DashboardDaoTest.java
sonar-core/src/test/java/org/sonar/core/duplication/DuplicationDaoTest.java
sonar-core/src/test/java/org/sonar/core/graph/graphson/GraphsonReaderTest.java
sonar-core/src/test/java/org/sonar/core/graph/graphson/GraphsonUtilTest.java
sonar-core/src/test/java/org/sonar/core/i18n/I18nClassloaderTest.java
sonar-core/src/test/java/org/sonar/core/issue/ActionPlanDeadlineComparatorTest.java
sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueBuilderTest.java
sonar-core/src/test/java/org/sonar/core/issue/IssueUpdaterTest.java
sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDaoTest.java
sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeDtoTest.java
sonar-core/src/test/java/org/sonar/core/issue/db/IssueChangeMapperTest.java
sonar-core/src/test/java/org/sonar/core/issue/db/IssueDaoTest.java
sonar-core/src/test/java/org/sonar/core/issue/db/IssueMapperTest.java
sonar-core/src/test/java/org/sonar/core/issue/db/IssueStorageTest.java
sonar-core/src/test/java/org/sonar/core/issue/db/UpdateConflictResolverTest.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/IsEndOfLifeTest.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/IsManualTest.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/IssueWorkflowTest.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/SetAssigneeTest.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/SetCloseDateTest.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/SetEndOfLifeTest.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/SetResolutionTest.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/StateMachineTest.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/StateTest.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/TransitionTest.java
sonar-core/src/test/java/org/sonar/core/measure/db/MeasureDtoTest.java
sonar-core/src/test/java/org/sonar/core/measure/db/MetricDtoTest.java
sonar-core/src/test/java/org/sonar/core/notification/DefaultNotificationManagerTest.java
sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionDaoTest.java
sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionDtoTest.java
sonar-core/src/test/java/org/sonar/core/permission/GroupWithPermissionTemplateDaoTest.java
sonar-core/src/test/java/org/sonar/core/permission/PermissionFacadeTest.java
sonar-core/src/test/java/org/sonar/core/permission/PermissionTemplateDaoTest.java
sonar-core/src/test/java/org/sonar/core/permission/UserWithPermissionDaoTest.java
sonar-core/src/test/java/org/sonar/core/permission/UserWithPermissionDtoTest.java
sonar-core/src/test/java/org/sonar/core/permission/UserWithPermissionTemplateDaoTest.java
sonar-core/src/test/java/org/sonar/core/persistence/DaoUtilsTest.java
sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java
sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreUpdaterTest.java
sonar-core/src/test/java/org/sonar/core/persistence/dialect/H2Test.java
sonar-core/src/test/java/org/sonar/core/persistence/dialect/MsSqlTest.java
sonar-core/src/test/java/org/sonar/core/persistence/dialect/MySqlTest.java
sonar-core/src/test/java/org/sonar/core/persistence/dialect/OracleTest.java
sonar-core/src/test/java/org/sonar/core/persistence/dialect/PostgreSqlTest.java
sonar-core/src/test/java/org/sonar/core/persistence/profiling/InvocationUtilsTest.java
sonar-core/src/test/java/org/sonar/core/plugins/PluginClassloadersTest.java
sonar-core/src/test/java/org/sonar/core/properties/PropertiesDaoTest.java
sonar-core/src/test/java/org/sonar/core/purge/IdUuidPairsTest.java
sonar-core/src/test/java/org/sonar/core/purge/PurgeConfigurationTest.java
sonar-core/src/test/java/org/sonar/core/qualitygate/db/ProjectQgateAssociationDaoTest.java
sonar-core/src/test/java/org/sonar/core/qualitygate/db/ProjectQgateAssociationDtoTest.java
sonar-core/src/test/java/org/sonar/core/qualitygate/db/ProjectQgateAssociationQueryTest.java
sonar-core/src/test/java/org/sonar/core/qualitygate/db/QualityGateConditionDaoTest.java
sonar-core/src/test/java/org/sonar/core/qualitygate/db/QualityGateDaoTest.java
sonar-core/src/test/java/org/sonar/core/qualityprofile/db/ActiveRuleKeyTest.java
sonar-core/src/test/java/org/sonar/core/qualityprofile/db/ActiveRuleParamDtoTest.java
sonar-core/src/test/java/org/sonar/core/resource/DefaultResourcePermissionsTest.java
sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java
sonar-core/src/test/java/org/sonar/core/resource/ResourceKeyUpdaterDaoTest.java
sonar-core/src/test/java/org/sonar/core/rule/RuleDaoTest.java
sonar-core/src/test/java/org/sonar/core/source/db/FileSourceDtoTest.java
sonar-core/src/test/java/org/sonar/core/technicaldebt/DefaultTechnicalDebtModelTest.java
sonar-core/src/test/java/org/sonar/core/technicaldebt/db/CharacteristicDaoTest.java
sonar-core/src/test/java/org/sonar/core/technicaldebt/db/CharacteristicDtoTest.java
sonar-core/src/test/java/org/sonar/core/template/LoadedTemplateDaoTest.java
sonar-core/src/test/java/org/sonar/core/user/AuthorDaoTest.java
sonar-core/src/test/java/org/sonar/core/user/AuthorizationDaoTest.java
sonar-core/src/test/java/org/sonar/core/user/DefaultUserFinderTest.java
sonar-core/src/test/java/org/sonar/core/user/GroupDtoTest.java
sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDaoTest.java
sonar-core/src/test/java/org/sonar/core/user/GroupMembershipDtoTest.java
sonar-core/src/test/java/org/sonar/core/user/GroupMembershipQueryTest.java
sonar-core/src/test/java/org/sonar/core/user/RoleDaoTest.java
sonar-core/src/test/java/org/sonar/core/user/UserDaoTest.java
sonar-core/src/test/java/org/sonar/core/user/UserDtoTest.java
sonar-core/src/test/java/org/sonar/core/util/MultiSetsTest.java
sonar-core/src/test/java/org/sonar/core/util/NonNullInputFunctionTest.java
sonar-core/src/test/java/org/sonar/jpa/dao/MeasuresDaoTest.java
sonar-core/src/test/java/org/sonar/jpa/session/DatabaseSessionTest.java
sonar-deprecated/src/test/java/org/sonar/api/checks/NoSonarFilterTest.java
sonar-home/src/test/java/org/sonar/home/cache/FileCacheBuilderTest.java
sonar-home/src/test/java/org/sonar/home/cache/FileCacheTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/debt/DebtRemediationFunctionTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/debt/internal/DefaultDebtCharacteristicTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/debt/internal/DefaultDebtModelTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultFilePredicatesTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultFileSystemTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/PathPatternTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/internal/ActiveRulesBuilderTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/rule/internal/RulesBuilderTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/sensor/highlighting/internal/DefaultHighlightingTest.java
sonar-plugin-api/src/test/java/org/sonar/api/config/AesCipherTest.java
sonar-plugin-api/src/test/java/org/sonar/api/config/CategoryTest.java
sonar-plugin-api/src/test/java/org/sonar/api/config/SettingsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/database/model/MeasureModelTest.java
sonar-plugin-api/src/test/java/org/sonar/api/issue/NoSonarFilterTest.java
sonar-plugin-api/src/test/java/org/sonar/api/issue/action/ActionTest.java
sonar-plugin-api/src/test/java/org/sonar/api/issue/action/ActionsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/issue/condition/HasResolutionTest.java
sonar-plugin-api/src/test/java/org/sonar/api/issue/condition/HasStatusTest.java
sonar-plugin-api/src/test/java/org/sonar/api/issue/condition/IsUnResolvedTest.java
sonar-plugin-api/src/test/java/org/sonar/api/issue/condition/NotConditionTest.java
sonar-plugin-api/src/test/java/org/sonar/api/issue/internal/DefaultIssueTest.java
sonar-plugin-api/src/test/java/org/sonar/api/issue/internal/FieldDiffsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureUtilsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/measures/SumChildDistributionFormulaTest.java
sonar-plugin-api/src/test/java/org/sonar/api/platform/ComponentContainerTest.java
sonar-plugin-api/src/test/java/org/sonar/api/platform/ComponentKeysTest.java
sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleKeyTest.java
sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleStatusTest.java
sonar-plugin-api/src/test/java/org/sonar/api/rule/SeverityTest.java
sonar-plugin-api/src/test/java/org/sonar/api/server/debt/internal/DefaultDebtCharacteristicTest.java
sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RuleParamTypeTest.java
sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionI18nLoaderTest.java
sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionTest.java
sonar-plugin-api/src/test/java/org/sonar/api/server/rule/RulesDefinitionXmlLoaderTest.java
sonar-plugin-api/src/test/java/org/sonar/api/server/ws/RequestTest.java
sonar-plugin-api/src/test/java/org/sonar/api/server/ws/internal/SimpleGetRequestTest.java
sonar-plugin-api/src/test/java/org/sonar/api/technicaldebt/batch/internal/DefaultCharacteristicTest.java
sonar-plugin-api/src/test/java/org/sonar/api/technicaldebt/server/internal/DefaultCharacteristicTest.java
sonar-plugin-api/src/test/java/org/sonar/api/user/UserQueryTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/DurationTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/DurationsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/KeyValueFormatTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/PagingTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/PathUtilsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/TimeUtilsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/UriReaderTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/WorkUnitTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/internal/UuidsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/internal/WorkDurationTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/BaseLoggerTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/ConsoleFormatterTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/ConsoleLoggerTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/ConsoleLoggersTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/DefaultProfilerTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/LogInterceptorsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/LogbackLoggerTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/LoggersTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/NullInterceptorTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/NullProfilerTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/ProfilerTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/text/XmlWriterTest.java
sonar-testing-harness/src/test/java/org/sonar/test/JsonAssertTest.java
sonar-testing-harness/src/test/java/org/sonar/test/JsonComparisonTest.java

index 28924a132934c59875a7a5296a21bc3689715a4a..716a43843b63281d06246e07909e28f35ff12247 100644 (file)
@@ -42,7 +42,7 @@ public class ProjectIssuesDashboardTest {
   ProjectIssuesDashboard template;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     IssueFilterDao issueFilterDao = new IssueFilterDao(dbTester.myBatis());
     template = new ProjectIssuesDashboard(issueFilterDao);
   }
index dd35f5871ccb26eef7a790678be4b78b3e551b1c..4dab1794650e92560b243c5b3022a55cc5c4e84a 100644 (file)
@@ -39,7 +39,7 @@ public class NewAlertsTest {
   NewAlerts dispatcher = new NewAlerts(notificationManager);
 
   @Test
-  public void should_not_dispatch_if_not_alerts_notification() throws Exception {
+  public void should_not_dispatch_if_not_alerts_notification() {
     Notification notification = new Notification("other-notif");
     dispatcher.performDispatch(notification, context);
 
index b0efe8961946ffa4a19fffee7ab5a912e85006d4..75297f6578f74ac39071d669680d36ae62d2ed3e 100644 (file)
@@ -78,7 +78,7 @@ public class NewCoverageFileAnalyzerTest {
   }
 
   @Test
-  public void shouldDoNothingIfNoScmData() throws ParseException {
+  public void shouldDoNothingIfNoScmData() {
     when(context.getMeasure(CoreMetrics.COVERAGE_LINE_HITS_DATA))
       .thenReturn(new Measure(CoreMetrics.COVERAGE_LINE_HITS_DATA, "1=10"));
 
@@ -87,7 +87,7 @@ public class NewCoverageFileAnalyzerTest {
   }
 
   @Test
-  public void shouldDoNothingIfNoCoverageData() throws ParseException {
+  public void shouldDoNothingIfNoCoverageData() {
     writer.writeComponentChangesets(BatchReport.Changesets.newBuilder()
       .setComponentRef(1)
       .addChangeset(Changeset.newBuilder()
@@ -102,7 +102,7 @@ public class NewCoverageFileAnalyzerTest {
   }
 
   @Test
-  public void shouldGetNewLines() throws ParseException {
+  public void shouldGetNewLines() {
     when(context.getMeasure(CoreMetrics.COVERAGE_LINE_HITS_DATA)).thenReturn(
       new Measure(CoreMetrics.COVERAGE_LINE_HITS_DATA, "10=2;11=3"));
     writer.writeComponentChangesets(BatchReport.Changesets.newBuilder()
@@ -148,7 +148,7 @@ public class NewCoverageFileAnalyzerTest {
   }
 
   @Test
-  public void shouldGetNewConditions() throws ParseException {
+  public void shouldGetNewConditions() {
     when(context.getMeasure(CoreMetrics.COVERAGE_LINE_HITS_DATA)).thenReturn(
       new Measure(CoreMetrics.COVERAGE_LINE_HITS_DATA, "10=2;11=3"));
     when(context.getMeasure(CoreMetrics.CONDITIONS_BY_LINE)).thenReturn(
@@ -198,7 +198,7 @@ public class NewCoverageFileAnalyzerTest {
   }
 
   @Test
-  public void shouldNotGetNewConditionsWhenNewLineHasNoConditions() throws ParseException {
+  public void shouldNotGetNewConditionsWhenNewLineHasNoConditions() {
     when(context.getMeasure(CoreMetrics.COVERAGE_LINE_HITS_DATA)).thenReturn(
       new Measure(CoreMetrics.COVERAGE_LINE_HITS_DATA, "10=2;11=3"));
     when(context.getMeasure(CoreMetrics.CONDITIONS_BY_LINE)).thenReturn(
@@ -236,7 +236,7 @@ public class NewCoverageFileAnalyzerTest {
   }
 
   @Test
-  public void shouldLeaveNullValueWhenNothingHasChanged() throws Exception {
+  public void shouldLeaveNullValueWhenNothingHasChanged() {
 
     when(context.getMeasure(CoreMetrics.COVERAGE_LINE_HITS_DATA)).thenReturn(
       new Measure(CoreMetrics.COVERAGE_LINE_HITS_DATA, "2=1;3=1"));
index cd7113e44e069663c649dc6321d4c0c1aaed8185..02c43eb00d217e60542fcd5bdfde2fb85153c795 100644 (file)
@@ -95,7 +95,7 @@ public class EmailNotificationChannelTest {
   }
 
   @Test
-  public void shouldThrowAnExceptionWhenUnableToSendTestEmail() throws Exception {
+  public void shouldThrowAnExceptionWhenUnableToSendTestEmail() {
     configure();
     server.stop();
 
@@ -108,7 +108,7 @@ public class EmailNotificationChannelTest {
   }
 
   @Test
-  public void shouldNotSendEmailWhenHostnameNotConfigured() throws Exception {
+  public void shouldNotSendEmailWhenHostnameNotConfigured() {
     EmailMessage emailMessage = new EmailMessage()
       .setTo("user@nowhere")
       .setSubject("Foo")
@@ -176,7 +176,7 @@ public class EmailNotificationChannelTest {
   }
 
   @Test
-  public void shouldNotThrowAnExceptionWhenUnableToSendEmail() throws Exception {
+  public void shouldNotThrowAnExceptionWhenUnableToSendEmail() {
     configure();
     server.stop();
 
@@ -188,7 +188,7 @@ public class EmailNotificationChannelTest {
   }
 
   @Test
-  public void shouldSendTestEmailWithSTARTTLS() throws Exception {
+  public void shouldSendTestEmailWithSTARTTLS() {
     server.getServer().setEnableTLS(true);
     server.getServer().setRequireTLS(true);
     configure();
index c6e96e1e3f4d9b92bf517fe4ea79743bc2d88741..d24b194dfeb2bf6e00907af68c18fc48be657681 100644 (file)
@@ -65,7 +65,7 @@ public class JavaCommandTest {
   }
 
   @Test
-  public void add_java_options() throws Exception {
+  public void add_java_options() {
     JavaCommand command = new JavaCommand("foo");
     assertThat(command.getJavaOptions()).isEmpty();
 
index f88481019c8ea91a2f00546d98629d782959e79f..5104542e0d97b79350b5c728c800e9448144d8ee 100644 (file)
@@ -27,7 +27,7 @@ import static org.junit.Assert.fail;
 public class JavaProcessLauncherTest {
 
   @Test
-  public void fail_to_launch() throws Exception {
+  public void fail_to_launch() {
     JavaCommand command = new JavaCommand("test");
     JavaProcessLauncher launcher = new JavaProcessLauncher(new Timeouts());
     try {
index e417b5fd26890d661bfd0f6f51ae52a06c005398..57e3478162ca5d8168d043b344a29cf2ca150ec4 100644 (file)
@@ -87,7 +87,7 @@ public class MonitorTest {
    * Safeguard
    */
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     try {
       if (monitor != null) {
         monitor.stop();
@@ -97,7 +97,7 @@ public class MonitorTest {
   }
 
   @Test
-  public void fail_to_start_if_no_commands() throws Exception {
+  public void fail_to_start_if_no_commands() {
     monitor = newDefaultMonitor();
     try {
       monitor.start(Collections.<JavaCommand>emptyList());
@@ -264,7 +264,7 @@ public class MonitorTest {
       this.httpPort = httpPort;
     }
 
-    JavaCommand newCommand() throws IOException {
+    JavaCommand newCommand() {
       return new JavaCommand(commandKey)
         .addClasspath(testJar.getAbsolutePath())
         .setClassName("org.sonar.process.test.HttpProcess")
@@ -313,7 +313,7 @@ public class MonitorTest {
       return readTimeFromFile("terminatedAt");
     }
 
-    boolean wasReady() throws IOException {
+    boolean wasReady() {
       return fileExists("readyAt");
     }
 
index 16ebb2837c5137aab5cf34bcb1aa8c333670a9b3..05e6dff57bfdeb80252ce577a7e47c460bfef420 100644 (file)
@@ -33,7 +33,7 @@ import static org.mockito.Mockito.verifyZeroInteractions;
 public class StreamGobblerTest {
 
   @Test
-  public void forward_stream_to_log() throws Exception {
+  public void forward_stream_to_log() {
     InputStream stream = IOUtils.toInputStream("one\nsecond log\nthird log\n");
     Logger logger = mock(Logger.class);
 
index 58e4d594fea7d77c910c37e2118dd8c90959edba..fd94c291d0ab84e25b3dee4638abba5a759f6d52 100644 (file)
@@ -52,7 +52,7 @@ public class AesCipherTest {
   }
 
   @Test
-  public void encrypt() throws Exception {
+  public void encrypt() {
     AesCipher cipher = new AesCipher(pathToSecretKey());
 
     String encryptedText = cipher.encrypt("this is a secret");
@@ -62,7 +62,7 @@ public class AesCipherTest {
   }
 
   @Test
-  public void encrypt_bad_key() throws Exception {
+  public void encrypt_bad_key() {
     thrown.expect(RuntimeException.class);
     thrown.expectMessage("Invalid AES key");
 
@@ -72,7 +72,7 @@ public class AesCipherTest {
   }
 
   @Test
-  public void decrypt() throws Exception {
+  public void decrypt() {
     AesCipher cipher = new AesCipher(pathToSecretKey());
 
     // the following value has been encrypted with the key /org/sonar/api/config/AesCipherTest/aes_secret_key.txt
@@ -82,7 +82,7 @@ public class AesCipherTest {
   }
 
   @Test
-  public void decrypt_bad_key() throws Exception {
+  public void decrypt_bad_key() {
     AesCipher cipher = new AesCipher(getPath("bad_secret_key.txt"));
 
     try {
@@ -95,7 +95,7 @@ public class AesCipherTest {
   }
 
   @Test
-  public void decrypt_other_key() throws Exception {
+  public void decrypt_other_key() {
     AesCipher cipher = new AesCipher(getPath("other_secret_key.txt"));
 
     try {
@@ -109,7 +109,7 @@ public class AesCipherTest {
   }
 
   @Test
-  public void encryptThenDecrypt() throws Exception {
+  public void encryptThenDecrypt() {
     AesCipher cipher = new AesCipher(pathToSecretKey());
 
     assertThat(cipher.decrypt(cipher.encrypt("foo"))).isEqualTo("foo");
@@ -161,14 +161,14 @@ public class AesCipherTest {
   }
 
   @Test
-  public void hasSecretKey() throws Exception {
+  public void hasSecretKey() {
     AesCipher cipher = new AesCipher(pathToSecretKey());
 
     assertThat(cipher.hasSecretKey()).isTrue();
   }
 
   @Test
-  public void doesNotHaveSecretKey() throws Exception {
+  public void doesNotHaveSecretKey() {
     AesCipher cipher = new AesCipher("/my/twitter/id/is/SimonBrandhof");
 
     assertThat(cipher.hasSecretKey()).isFalse();
@@ -178,7 +178,7 @@ public class AesCipherTest {
     return Resources.getResource(AesCipherTest.class, "AesCipherTest/" + file).getPath();
   }
 
-  private static String pathToSecretKey() throws Exception {
+  private static String pathToSecretKey() {
     return getPath("aes_secret_key.txt");
   }
 
index 6ed9dc357cbf2401d1419ec13587e04ec532364d..28cd557a3d1f62575b1bd4aff9f4cd471b58925e 100644 (file)
@@ -62,7 +62,7 @@ public class ConfigurationUtilsTest {
   }
 
   @Test
-  public void loadPropsFromCommandLineArgs_missing_argument() throws Exception {
+  public void loadPropsFromCommandLineArgs_missing_argument() {
     try {
       ConfigurationUtils.loadPropsFromCommandLineArgs(new String[0]);
       fail();
@@ -95,7 +95,7 @@ public class ConfigurationUtilsTest {
   }
 
   @Test
-  public void private_constructor() throws Exception {
+  public void private_constructor() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(ConfigurationUtils.class)).isTrue();
   }
 }
index 11b267b3e777c6dab2cf518f644b599a49b25263..fdcdbb1d957752ab4726a86a87348ef636fb2999 100644 (file)
@@ -27,7 +27,7 @@ import static org.sonar.process.Lifecycle.State;
 public class LifecycleTest {
 
   @Test
-  public void equals_and_hashcode() throws Exception {
+  public void equals_and_hashcode() {
     Lifecycle init = new Lifecycle();
     assertThat(init.equals(init)).isTrue();
     assertThat(init.equals(new Lifecycle())).isTrue();
@@ -42,7 +42,7 @@ public class LifecycleTest {
   }
 
   @Test
-  public void try_to_move() throws Exception {
+  public void try_to_move() {
     Lifecycle lifecycle = new Lifecycle();
     assertThat(lifecycle.getState()).isEqualTo(State.INIT);
 
index 753d06e67c4116a33303407252b639de2182339d..e4cad8faea8aee6eae004d99c153e5fed02463db 100644 (file)
@@ -79,7 +79,7 @@ public class LogbackHelperTest {
   }
 
   @Test
-  public void newConsoleAppender() throws Exception {
+  public void newConsoleAppender() {
     LoggerContext ctx = sut.getRootContext();
     ConsoleAppender appender = sut.newConsoleAppender(ctx, "MY_APPENDER", "%msg%n");
 
@@ -90,7 +90,7 @@ public class LogbackHelperTest {
   }
 
   @Test
-  public void configureLogger() throws Exception {
+  public void configureLogger() {
     LoggerContext ctx = sut.getRootContext();
 
     Logger logger = sut.configureLogger(ctx, "my_logger", Level.WARN);
@@ -100,7 +100,7 @@ public class LogbackHelperTest {
   }
 
   @Test
-  public void createRollingPolicy_defaults() throws Exception {
+  public void createRollingPolicy_defaults() {
     LoggerContext ctx = sut.getRootContext();
     LogbackHelper.RollingPolicy policy = sut.createRollingPolicy(ctx, props, "sonar");
     FileAppender appender = policy.createAppender("SONAR_FILE");
@@ -114,7 +114,7 @@ public class LogbackHelperTest {
   }
 
   @Test
-  public void createRollingPolicy_none() throws Exception {
+  public void createRollingPolicy_none() {
     props.set("sonar.log.rollingPolicy", "none");
     LoggerContext ctx = sut.getRootContext();
     LogbackHelper.RollingPolicy policy = sut.createRollingPolicy(ctx, props, "sonar");
@@ -124,7 +124,7 @@ public class LogbackHelperTest {
   }
 
   @Test
-  public void createRollingPolicy_size() throws Exception {
+  public void createRollingPolicy_size() {
     props.set("sonar.log.rollingPolicy", "size:1MB");
     props.set("sonar.log.maxFiles", "20");
     LoggerContext ctx = sut.getRootContext();
@@ -143,7 +143,7 @@ public class LogbackHelperTest {
   }
 
   @Test
-  public void createRollingPolicy_time() throws Exception {
+  public void createRollingPolicy_time() {
     props.set("sonar.log.rollingPolicy", "time:yyyy-MM");
     props.set("sonar.log.maxFiles", "20");
 
@@ -159,7 +159,7 @@ public class LogbackHelperTest {
   }
 
   @Test
-  public void createRollingPolicy_fail_if_unknown_policy() throws Exception {
+  public void createRollingPolicy_fail_if_unknown_policy() {
     props.set("sonar.log.rollingPolicy", "unknown:foo");
     try {
       LoggerContext ctx = sut.getRootContext();
index 782923d9aeed4b3c569741c54d9194022589c5d5..39b75fd03b0e130db2bd77e2e5730866a31e43d8 100644 (file)
@@ -33,14 +33,14 @@ import static org.junit.Assert.fail;
 public class LoopbackAddressTest {
 
   @Test
-  public void get() throws Exception {
+  public void get() {
     assertThat(LoopbackAddress.get()).isNotNull();
     assertThat(LoopbackAddress.get().isLoopbackAddress()).isTrue();
     assertThat(LoopbackAddress.get().getHostAddress()).isNotNull();
   }
 
   @Test
-  public void fail_to_get_loopback_address() throws Exception {
+  public void fail_to_get_loopback_address() {
     Enumeration<NetworkInterface> ifaces = Iterators.asEnumeration(Collections.<NetworkInterface>emptyList().iterator());
     try {
       LoopbackAddress.doGet(ifaces);
@@ -51,7 +51,7 @@ public class LoopbackAddressTest {
   }
 
   @Test
-  public void private_constructor() throws Exception {
+  public void private_constructor() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(LoopbackAddress.class)).isTrue();
   }
 }
index de339683db6f5d62c7e9b4f155e1bc7d3440c3aa..dc2bdf2c4a6b0376c50662c94f6d12a0b350d4ee 100644 (file)
@@ -38,7 +38,7 @@ public class MinimumViableSystemTest {
    * Test environment does not necessarily follows all checks.
    */
   @Test
-  public void check() throws Exception {
+  public void check() {
     MinimumViableSystem mve = new MinimumViableSystem();
 
     try {
@@ -50,7 +50,7 @@ public class MinimumViableSystemTest {
   }
 
   @Test
-  public void checkJavaVersion() throws Exception {
+  public void checkJavaVersion() {
     MinimumViableSystem mve = new MinimumViableSystem();
 
     // yes, sources are compiled with a supported Java version!
@@ -66,7 +66,7 @@ public class MinimumViableSystemTest {
   }
 
   @Test
-  public void checkJavaOption() throws Exception {
+  public void checkJavaOption() {
     String key = "MinimumViableEnvironmentTest.test.prop";
     MinimumViableSystem mve = new MinimumViableSystem()
       .setRequiredJavaOption(key, "true");
index c14aa4daa9b573c102630e53e35cafc5e1fad29f..e5723aa99cc9cd3c6d4ad9573ca5a870d38542fe 100644 (file)
@@ -27,13 +27,13 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class NetworkUtilsTest {
 
   @Test
-  public void find_free_port() throws Exception {
+  public void find_free_port() {
     int port = NetworkUtils.freePort();
     assertThat(port).isGreaterThan(0);
   }
 
   @Test
-  public void find_multiple_free_port() throws Exception {
+  public void find_multiple_free_port() {
     int port1 = NetworkUtils.freePort();
     int port2 = NetworkUtils.freePort();
 
@@ -41,7 +41,7 @@ public class NetworkUtilsTest {
   }
 
   @Test
-  public void private_constructor() throws Exception {
+  public void private_constructor() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(NetworkUtils.class)).isTrue();
   }
 }
index bfca7cb63bafd92a5d65b4ad93d7803fb63628f5..a24fec1870463c8384043cc2a2abf3a1bcb43d0f 100644 (file)
@@ -70,7 +70,7 @@ public class ProcessEntryPointTest {
   }
 
   @Test
-  public void fail_to_launch_multiple_times() throws Exception {
+  public void fail_to_launch_multiple_times() {
     Props props = new Props(new Properties());
     props.set(ProcessEntryPoint.PROPERTY_PROCESS_KEY, "test");
     props.set(ProcessEntryPoint.PROPERTY_TERMINATION_TIMEOUT, "30000");
@@ -146,7 +146,7 @@ public class ProcessEntryPointTest {
   }
 
   @Test
-  public void terminate_if_startup_error() throws Exception {
+  public void terminate_if_startup_error() {
     Props props = new Props(new Properties());
     props.set(ProcessEntryPoint.PROPERTY_PROCESS_KEY, "foo");
     props.set(ProcessEntryPoint.PROPERTY_TERMINATION_TIMEOUT, "30000");
index 2a8cdddd3d7107cb6f4175be48ca8790630c4f06..65fb20ee3fc184a749901cf1de731f06d9378d1b 100644 (file)
@@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ProcessPropertiesTest {
 
   @Test
-  public void init_defaults() throws Exception {
+  public void init_defaults() {
     Props props = new Props(new Properties());
     ProcessProperties.completeDefaults(props);
 
@@ -39,7 +39,7 @@ public class ProcessPropertiesTest {
   }
 
   @Test
-  public void do_not_override_existing_properties() throws Exception {
+  public void do_not_override_existing_properties() {
     Properties p = new Properties();
     p.setProperty("sonar.jdbc.username", "angela");
     Props props = new Props(p);
@@ -49,7 +49,7 @@ public class ProcessPropertiesTest {
   }
 
   @Test
-  public void use_random_port_if_zero() throws Exception {
+  public void use_random_port_if_zero() {
     Properties p = new Properties();
     p.setProperty("sonar.search.port", "0");
     Props props = new Props(p);
@@ -59,7 +59,7 @@ public class ProcessPropertiesTest {
   }
 
   @Test
-  public void private_constructor() throws Exception {
+  public void private_constructor() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(ProcessProperties.class)).isTrue();
   }
 }
index fa97e2ae2f44e5a90c37f2913a6ad8325fc77aeb..8ac5bab177d74cd433ea37e62be51e28d7fefb0d 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ProcessUtilsTest {
 
   @Test
-  public void private_constructor() throws Exception {
+  public void private_constructor() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(ProcessUtils.class)).isTrue();
   }
 }
index 8af1e96c086dd0c64288a1df03ffbf5fe378c1c5..0a180f3717cd53911f2641581c2b71f58b4bad36 100644 (file)
@@ -36,7 +36,7 @@ public class PropsTest {
   public TemporaryFolder temp = new TemporaryFolder();
 
   @Test
-  public void value() throws Exception {
+  public void value() {
     Properties p = new Properties();
     p.setProperty("foo", "bar");
     Props props = new Props(p);
@@ -56,7 +56,7 @@ public class PropsTest {
   }
 
   @Test
-  public void valueAsInt() throws Exception {
+  public void valueAsInt() {
     Properties p = new Properties();
     p.setProperty("foo", "33");
     p.setProperty("blank", "");
@@ -71,7 +71,7 @@ public class PropsTest {
   }
 
   @Test
-  public void valueAsInt_not_integer() throws Exception {
+  public void valueAsInt_not_integer() {
     Properties p = new Properties();
     p.setProperty("foo", "bar");
     Props props = new Props(p);
@@ -85,7 +85,7 @@ public class PropsTest {
   }
 
   @Test
-  public void booleanOf() throws Exception {
+  public void booleanOf() {
     Properties p = new Properties();
     p.setProperty("foo", "True");
     p.setProperty("bar", "false");
@@ -97,7 +97,7 @@ public class PropsTest {
   }
 
   @Test
-  public void booleanOf_default_value() throws Exception {
+  public void booleanOf_default_value() {
     Properties p = new Properties();
     p.setProperty("foo", "true");
     p.setProperty("bar", "false");
@@ -110,7 +110,7 @@ public class PropsTest {
   }
 
   @Test
-  public void setDefault() throws Exception {
+  public void setDefault() {
     Properties p = new Properties();
     p.setProperty("foo", "foo_value");
     Props props = new Props(p);
@@ -123,7 +123,7 @@ public class PropsTest {
   }
 
   @Test
-  public void set() throws Exception {
+  public void set() {
     Properties p = new Properties();
     p.setProperty("foo", "old_foo");
     Props props = new Props(p);
@@ -135,7 +135,7 @@ public class PropsTest {
   }
 
   @Test
-  public void raw_properties() throws Exception {
+  public void raw_properties() {
     Properties p = new Properties();
     p.setProperty("encrypted_prop", "{aes}abcde");
     p.setProperty("clear_prop", "foo");
index d2bb4e495c517da182cba3f1fd71cdd6d05c217c..64bf66216bd32be55a3bef77a1de89778e8335c7 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class SystemExitTest {
 
   @Test
-  public void do_not_exit_if_in_shutdown_hook() throws Exception {
+  public void do_not_exit_if_in_shutdown_hook() {
     SystemExit systemExit = new SystemExit();
 
     systemExit.setInShutdownHook();
@@ -39,7 +39,7 @@ public class SystemExitTest {
   }
 
   @Test
-  public void exit_if_not_in_shutdown_hook() throws Exception {
+  public void exit_if_not_in_shutdown_hook() {
     final AtomicInteger got = new AtomicInteger();
     SystemExit systemExit = new SystemExit() {
       @Override
index f85772f7340f49f2c6905034c1276416dde0bb33..2a8f9e8977483189a8dd73a97ad7924170786a07 100644 (file)
@@ -39,7 +39,7 @@ public class SearchLoggingTest {
   }
 
   @Test
-  public void log_to_console() throws Exception {
+  public void log_to_console() {
     LoggerContext ctx = sut.configure();
 
     Logger root = ctx.getLogger(Logger.ROOT_LOGGER_NAME);
index bd8f49b511a3d0137cbb4aaa8704cfa405fcf115..92a1047889df7055f4c3bcac20fcf9b94b7db65c 100644 (file)
@@ -58,7 +58,7 @@ public class SearchServerTest {
   public TemporaryFolder temp = new TemporaryFolder();
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     if (searchServer != null) {
       searchServer.stop();
       searchServer.awaitStop();
index 0c1f603831cf9a555186138e414d76a896351b0a..06c2c355c7352759d9270aae43ed6d1fcb9e0822 100644 (file)
@@ -37,7 +37,7 @@ public class UpdateListScriptTest {
   ListUpdate.UpdateListScriptFactory factory;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     factory = new ListUpdate.UpdateListScriptFactory();
   }
 
@@ -101,7 +101,7 @@ public class UpdateListScriptTest {
   }
 
   @Test
-  public void update_list() throws Exception {
+  public void update_list() {
 
     String listField = "listField";
     Collection<Map<String, Object>> mapFields;
index ded7df36c5c45b2b84970839a810792de6e68c5a..460b785d64b5f36d235009cdf801c52c48bd9503 100644 (file)
@@ -67,7 +67,7 @@ public class IssueIndexBenchmarkTest {
   public Benchmark benchmark = new Benchmark();
 
   @Test
-  public void benchmark() throws Exception {
+  public void benchmark() {
     // initialization - feed issues/issueAuthorization with projects and hardcoded users
     indexAuthorizations();
 
index eb871e7be7c5cd8d2fa3f530c921ea1576bab1dd..9ecf6f4786e928a7939e23ca77809ef8f84ba3ea 100644 (file)
@@ -70,7 +70,7 @@ public class PersistFileSourcesStepTest {
     persistFileSources(reportDir);
   }
 
-  private void persistFileSources(File reportDir) throws SQLException {
+  private void persistFileSources(File reportDir) {
     LOGGER.info("Persist file sources");
     DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new FileSourceDao(dbTester.myBatis()));
 
index 5ce4e1e6c55d9eb02f07b09f242b1b9163c7b71d..e6e8885e01059de5c50517b538c931dbf9602073 100644 (file)
@@ -116,7 +116,7 @@ public class SourceDbBenchmarkTest {
     return dto;
   }
 
-  private byte[] generateData() throws IOException {
+  private byte[] generateData() {
     FileSourceDb.Data.Builder dataBuilder = FileSourceDb.Data.newBuilder();
     FileSourceDb.Line.Builder lineBuilder = FileSourceDb.Line.newBuilder();
     for (int i = 1; i <= NUMBER_OF_LINES; i++) {
index 73943f97720e03e897b6f99e4e6d3ca986950f69..658b701874b3871177c35cbaf08d5f7b7ea9da95 100644 (file)
@@ -56,7 +56,7 @@ public class SourceIndexBenchmarkTest {
   public Benchmark benchmark = new Benchmark();
 
   @Test
-  public void benchmark() throws Exception {
+  public void benchmark() {
     // index source lines
     benchmarkIndexing();
 
index c8fceca3a3d4064fbb3b4c4aa330e867e57217e3..95a673731c56748005e5bddab6b708434a87506e 100644 (file)
@@ -53,14 +53,14 @@ public class ProjectCleanerTest {
   private Settings settings = new Settings();
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     this.projectSettingsFactory = mock(ProjectSettingsFactory.class);
 
     this.sut = new ProjectCleaner(dao, periodCleaner, profiler, purgeListener, issueIndex);
   }
 
   @Test
-  public void no_profiling_when_property_is_false() throws Exception {
+  public void no_profiling_when_property_is_false() {
     settings.setProperty(CoreProperties.PROFILING_LOG_PROPERTY, false);
 
     sut.purge(mock(DbSession.class), mock(IdUuidPair.class), settings);
@@ -69,14 +69,14 @@ public class ProjectCleanerTest {
   }
 
   @Test
-  public void no_indexing_when_no_issue_to_delete() throws Exception {
+  public void no_indexing_when_no_issue_to_delete() {
     sut.purge(mock(DbSession.class), mock(IdUuidPair.class), settings);
 
     verifyZeroInteractions(issueIndex);
   }
 
   @Test
-  public void profiling_when_property_is_true() throws Exception {
+  public void profiling_when_property_is_true() {
     settings.setProperty(CoreProperties.PROFILING_LOG_PROPERTY, true);
 
     sut.purge(mock(DbSession.class), mock(IdUuidPair.class), settings);
@@ -85,7 +85,7 @@ public class ProjectCleanerTest {
   }
 
   @Test
-  public void call_period_cleaner_index_client_and_purge_dao() throws Exception {
+  public void call_period_cleaner_index_client_and_purge_dao() {
     settings.setProperty(DbCleanerConstants.DAYS_BEFORE_DELETING_CLOSED_ISSUES, 5);
 
     sut.purge(mock(DbSession.class), mock(IdUuidPair.class), settings);
@@ -96,7 +96,7 @@ public class ProjectCleanerTest {
   }
 
   @Test
-  public void if_dao_purge_fails_it_should_not_interrupt_program_execution() throws Exception {
+  public void if_dao_purge_fails_it_should_not_interrupt_program_execution() {
     doThrow(RuntimeException.class).when(dao).purge(any(DbSession.class), any(PurgeConfiguration.class), any(PurgeListener.class));
 
     sut.purge(mock(DbSession.class), mock(IdUuidPair.class), settings);
@@ -105,7 +105,7 @@ public class ProjectCleanerTest {
   }
 
   @Test
-  public void if_profiler_cleaning_fails_it_should_not_interrupt_program_execution() throws Exception {
+  public void if_profiler_cleaning_fails_it_should_not_interrupt_program_execution() {
     doThrow(RuntimeException.class).when(periodCleaner).clean(any(DbSession.class), anyLong(), any(Settings.class));
 
     sut.purge(mock(DbSession.class), mock(IdUuidPair.class), settings);
index d12d072f1f38ba12ac167c5678576e5274c9773e..21a53442e810501c411b67f3736d6f19a20853c4 100644 (file)
@@ -64,7 +64,7 @@ public class ActivityServiceTest {
   }
 
   @Test
-  public void insert_and_index() throws Exception {
+  public void insert_and_index() {
     when(system.now()).thenReturn(1_500_000_000_000L);
 
     Activity activity = new Activity();
index ef446052923e08964c117d0df23f85453816eb46..691b34d69a1b1725615b95c8ef1774548f98c734 100644 (file)
@@ -57,12 +57,12 @@ public class RubyQProfileActivityServiceTest {
   RubyQProfileActivityService rubyQProfileActivityService;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     rubyQProfileActivityService = new RubyQProfileActivityService(service);
   }
 
   @Test
-  public void search() throws Exception {
+  public void search() {
     Date since = DateUtils.parseDate("2014-05-19");
     Date to = DateUtils.parseDate("2014-06-19");
 
@@ -84,7 +84,7 @@ public class RubyQProfileActivityServiceTest {
   }
 
   @Test
-  public void search_with_empty_fields() throws Exception {
+  public void search_with_empty_fields() {
     Result<QProfileActivity> result = mock(Result.class);
     when(result.getHits()).thenReturn(Lists.<QProfileActivity>newArrayList());
     when(result.getTotal()).thenReturn(10L);
index 2aea0522ce86907b070e3ccd4e91f1991b69ee9f..5608f473118762c45c7efbded335c08d12d0a6a5 100644 (file)
@@ -44,12 +44,12 @@ public class ActivityDaoTest {
   ActivityDao sut;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     sut = new ActivityDao(dbTester.myBatis(), system);
   }
 
   @Test
-  public void insert() throws Exception {
+  public void insert() {
     when(system.now()).thenReturn(1_500_000_000_000L);
     ActivityDto dto = new ActivityDto()
       .setKey("UUID_1").setAction("THE_ACTION").setType("THE_TYPE")
index 3e5336d9194a49863349f7f22cfab9ea28123a71..c05e98cbde68da91873e7fe2019024e71bbd82a3 100644 (file)
@@ -32,7 +32,7 @@ public class ActivityIndexDefinitionTest {
   IndexDefinition.IndexDefinitionContext context = new IndexDefinition.IndexDefinitionContext();
 
   @Test
-  public void define() throws Exception {
+  public void define() {
     ActivityIndexDefinition def = new ActivityIndexDefinition(new Settings());
     def.define(context);
 
@@ -47,7 +47,7 @@ public class ActivityIndexDefinitionTest {
   }
 
   @Test
-  public void enable_cluster() throws Exception {
+  public void enable_cluster() {
     Settings settings = new Settings();
     settings.setProperty(ProcessProperties.CLUSTER_ACTIVATE, true);
     ActivityIndexDefinition def = new ActivityIndexDefinition(settings);
index b52b4fabc2eec3d2af2d5845a4b79a32f2274a5b..0fae6a28d6f0bee94072c468edbe05f25366cba4 100644 (file)
@@ -54,7 +54,7 @@ public class ActivityResultSetIteratorTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     DbUtils.closeQuietly(connection);
   }
 
@@ -62,7 +62,7 @@ public class ActivityResultSetIteratorTest {
    * Iterate over two rows in table.
    */
   @Test
-  public void traverse() throws Exception {
+  public void traverse() {
     dbTester.prepareDbUnit(getClass(), "traverse.xml");
     ActivityResultSetIterator it = ActivityResultSetIterator.create(client, connection, 0L);
 
@@ -84,7 +84,7 @@ public class ActivityResultSetIteratorTest {
   }
 
   @Test
-  public void traverse_after_date() throws Exception {
+  public void traverse_after_date() {
     dbTester.prepareDbUnit(getClass(), "traverse.xml");
     ActivityResultSetIterator it = ActivityResultSetIterator.create(client, connection, DateUtils.parseDate("2014-12-01").getTime());
 
@@ -101,7 +101,7 @@ public class ActivityResultSetIteratorTest {
   }
 
   @Test
-  public void nothing_to_traverse() throws Exception {
+  public void nothing_to_traverse() {
     dbTester.prepareDbUnit(getClass(), "traverse.xml");
     ActivityResultSetIterator it = ActivityResultSetIterator.create(client, connection, DateUtils.parseDate("2030-01-01").getTime());
 
index f5462dc69fa5c3dc6516eec412c47164b174b5eb..2bf1bb92b00fef3ce0ebd7a6433cc4765fba2645 100644 (file)
@@ -40,14 +40,14 @@ public class ActivitiesWebServiceMediumTest {
   ActivityService service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     ws = tester.get(ActivitiesWebService.class);
     service = tester.get(ActivityService.class);
   }
 
   @Test
-  public void define() throws Exception {
+  public void define() {
     WebService.Context context = new WebService.Context();
     ws.define(context);
 
index 1d85a118a00bfb6155f12a62f81acdd2b759ecf8..fbf96397de01861897187c5d4e60bf41d2fd65f9 100644 (file)
@@ -40,7 +40,7 @@ public class StartupLogsTest {
   StartupLogs sut = new StartupLogs(props, logger);
 
   @Test
-  public void logAjp() throws Exception {
+  public void logAjp() {
     Connector connector = newConnector("AJP/1.3", "http");
     when(tomcat.getService().findConnectors()).thenReturn(new Connector[] {connector});
 
@@ -51,7 +51,7 @@ public class StartupLogsTest {
   }
 
   @Test
-  public void logHttp() throws Exception {
+  public void logHttp() {
     Connector connector = newConnector("HTTP/1.1", "http");
     when(tomcat.getService().findConnectors()).thenReturn(new Connector[] {connector});
 
@@ -62,7 +62,7 @@ public class StartupLogsTest {
   }
 
   @Test
-  public void logHttps_default_ciphers() throws Exception {
+  public void logHttps_default_ciphers() {
     Connector connector = newConnector("HTTP/1.1", "https");
     when(tomcat.getService().findConnectors()).thenReturn(new Connector[] {connector});
 
@@ -73,7 +73,7 @@ public class StartupLogsTest {
   }
 
   @Test
-  public void logHttps_overridden_ciphers() throws Exception {
+  public void logHttps_overridden_ciphers() {
     Connector connector = mock(Connector.class);
     when(connector.getScheme()).thenReturn("https");
     when(connector.getPort()).thenReturn(1234);
@@ -89,7 +89,7 @@ public class StartupLogsTest {
   }
 
   @Test
-  public void unsupported_connector() throws Exception {
+  public void unsupported_connector() {
     Connector connector = mock(Connector.class, Mockito.RETURNS_DEEP_STUBS);
     when(connector.getProtocol()).thenReturn("SPDY/1.1");
     when(connector.getScheme()).thenReturn("spdy");
index 6c4c7d49c80240527efc07862af26d22880f1720..1b8452ef58a94f07fd5e5fa8325415b30af48cba 100644 (file)
@@ -45,7 +45,7 @@ public class TomcatConnectorsTest {
   // ---- connectors
 
   @Test
-  public void configure_thread_pool() throws Exception {
+  public void configure_thread_pool() {
     Properties p = new Properties();
     p.setProperty("sonar.web.http.minThreads", "2");
     p.setProperty("sonar.web.http.maxThreads", "30");
@@ -60,7 +60,7 @@ public class TomcatConnectorsTest {
   }
 
   @Test
-  public void configure_default_thread_pool() throws Exception {
+  public void configure_default_thread_pool() {
     Props props = new Props(new Properties());
 
     TomcatConnectors.configure(tomcat, props);
@@ -71,7 +71,7 @@ public class TomcatConnectorsTest {
   }
 
   @Test
-  public void different_thread_pools_for_connectors() throws Exception {
+  public void different_thread_pools_for_connectors() {
     Properties p = new Properties();
     p.setProperty("sonar.web.port", "9000");
     p.setProperty("sonar.web.http.minThreads", "2");
@@ -165,7 +165,7 @@ public class TomcatConnectorsTest {
   }
 
   @Test
-  public void http_and_ajp_and_https_ports_should_be_different() throws Exception {
+  public void http_and_ajp_and_https_ports_should_be_different() {
     Properties p = new Properties();
     p.setProperty("sonar.web.port", "9000");
     p.setProperty("sonar.ajp.port", "9000");
@@ -180,7 +180,7 @@ public class TomcatConnectorsTest {
   }
 
   @Test
-  public void bind_to_all_addresses_by_default() throws Exception {
+  public void bind_to_all_addresses_by_default() {
     Properties p = new Properties();
     p.setProperty("sonar.web.port", "9000");
     p.setProperty("sonar.ajp.port", "9009");
@@ -212,7 +212,7 @@ public class TomcatConnectorsTest {
   }
 
   @Test
-  public void bind_to_specific_address() throws Exception {
+  public void bind_to_specific_address() {
     Properties p = new Properties();
     p.setProperty("sonar.web.port", "9000");
     p.setProperty("sonar.web.https.port", "9443");
@@ -237,7 +237,7 @@ public class TomcatConnectorsTest {
   }
 
   @Test
-  public void enable_client_auth() throws Exception {
+  public void enable_client_auth() {
 
     Properties p = new Properties();
 
@@ -259,7 +259,7 @@ public class TomcatConnectorsTest {
   }
 
   @Test
-  public void require_client_auth() throws Exception {
+  public void require_client_auth() {
 
     Properties p = new Properties();
 
index 6bc5f9c6d001738e6f5477b2ab0248e7d3075970..765283ebdb78cf08f8766a62f1628d3dd1a20dbc 100644 (file)
@@ -44,7 +44,7 @@ public class WebLoggingTest {
   }
 
   @Test
-  public void log_to_console() throws Exception {
+  public void log_to_console() {
     LoggerContext ctx = sut.configure(props);
 
     Logger root = ctx.getLogger(Logger.ROOT_LOGGER_NAME);
@@ -58,14 +58,14 @@ public class WebLoggingTest {
   }
 
   @Test
-  public void enable_debug_logs() throws Exception {
+  public void enable_debug_logs() {
     props.set("sonar.log.level", "DEBUG");
     LoggerContext ctx = sut.configure(props);
     assertThat(ctx.getLogger(Logger.ROOT_LOGGER_NAME).getLevel()).isEqualTo(Level.DEBUG);
   }
 
   @Test
-  public void enable_trace_logs() throws Exception {
+  public void enable_trace_logs() {
     props.set("sonar.log.level", "TRACE");
     LoggerContext ctx = sut.configure(props);
     assertThat(ctx.getLogger(Logger.ROOT_LOGGER_NAME).getLevel()).isEqualTo(Level.TRACE);
index db343c6e91943f38e444c94662b0819da770d4ea..cf9b70370d1d217625b30760ee4933355bef2d62 100644 (file)
@@ -74,7 +74,7 @@ public class WebappTest {
   }
 
   @Test
-  public void configure_rails_dev_mode() throws Exception {
+  public void configure_rails_dev_mode() {
     props.set("sonar.web.dev", "true");
     Context context = mock(Context.class);
 
@@ -85,7 +85,7 @@ public class WebappTest {
   }
 
   @Test
-  public void configure_production_mode() throws Exception {
+  public void configure_production_mode() {
     props.set("sonar.web.dev", "false");
     Context context = mock(Context.class);
 
@@ -96,7 +96,7 @@ public class WebappTest {
   }
 
   @Test
-  public void context_path_must_start_with_slash() throws Exception {
+  public void context_path_must_start_with_slash() {
     Properties p = new Properties();
     p.setProperty("sonar.web.context", "foo");
 
@@ -109,7 +109,7 @@ public class WebappTest {
   }
 
   @Test
-  public void root_context_path_must_be_blank() throws Exception {
+  public void root_context_path_must_be_blank() {
     Properties p = new Properties();
     p.setProperty("sonar.web.context", "/");
 
@@ -117,7 +117,7 @@ public class WebappTest {
   }
 
   @Test
-  public void default_context_path_is_root() throws Exception {
+  public void default_context_path_is_root() {
     String context = Webapp.getContextPath(new Props(new Properties()));
     assertThat(context).isEqualTo("");
   }
index 4fc95886c1445d8e6fce0722091f12afd93ec132..db10031a42739c8ac2d7c2d6fb024b213e751fca 100644 (file)
@@ -32,7 +32,7 @@ public class AuthenticationWsTest {
   WsTester tester = new WsTester(new AuthenticationWs());
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WebService.Controller controller = tester.controller("api/authentication");
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
index 6fbf6aa4ce44472810ee05759ac1d5b81c96e918..884524cc9cacb12c2ac4eecedcf76330608f515a 100644 (file)
@@ -59,7 +59,7 @@ public class BatchIndexTest {
   }
 
   @Test
-  public void get_index() throws Exception {
+  public void get_index() {
     BatchIndex batchIndex = new BatchIndex(server);
     batchIndex.start();
 
@@ -70,7 +70,7 @@ public class BatchIndexTest {
   }
 
   @Test
-  public void get_file() throws Exception {
+  public void get_file() {
     BatchIndex batchIndex = new BatchIndex(server);
     batchIndex.start();
 
@@ -83,7 +83,7 @@ public class BatchIndexTest {
    * /etc/passwd
    */
   @Test
-  public void check_location_of_file() throws Exception {
+  public void check_location_of_file() {
     thrown.expect(IllegalArgumentException.class);
     thrown.expectMessage("Bad filename: ../sonar-batch.jar");
 
@@ -94,7 +94,7 @@ public class BatchIndexTest {
   }
 
   @Test
-  public void file_does_not_exist() throws Exception {
+  public void file_does_not_exist() {
     thrown.expect(IllegalArgumentException.class);
     thrown.expectMessage("Bad filename: other.jar");
 
index 2e34503a7b5976b81d684574e04ca20551d7506a..582d4034f462ce682e1c33f81c0f45a43077236e 100644 (file)
@@ -55,7 +55,7 @@ public class BatchWsTest {
   WsTester tester;
 
   @Before
-  public void before() throws IOException {
+  public void before() {
     tester = new WsTester(new BatchWs(batchIndex,
       new GlobalRepositoryAction(mock(DbClient.class), mock(PropertiesDao.class)),
       new ProjectRepositoryAction(mock(ProjectRepositoryLoader.class)),
index 6548bfe6bf7d8679acd32ea912d116f0b30dc869..9d5ec7d28413c534a0d81e18f26cb264b61e74fc 100644 (file)
@@ -60,7 +60,7 @@ public class GlobalRepositoryActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     DbClient dbClient = mock(DbClient.class);
     when(dbClient.openSession(false)).thenReturn(session);
     when(dbClient.metricDao()).thenReturn(metricDao);
index efb7729e58315adcdd8aa7218ee24e630df6fe60..740b2f2c661071b74aeaddbb9b74a3dd1f65f13b 100644 (file)
@@ -86,7 +86,7 @@ public class IssuesActionTest {
   IssuesAction issuesAction;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     db.truncateTables();
     es.truncateIndices();
     this.session = db.myBatis().openSession(false);
index 806196fb2f91736b3c39d86b5d343bb275e6b033..161d65ce6d92cfa77efd421d741cfa22136600ee 100644 (file)
@@ -42,7 +42,7 @@ public class ProjectRepositoryActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester = new WsTester(new BatchWs(mock(BatchIndex.class), new ProjectRepositoryAction(projectRepositoryLoader)));
   }
 
index 79dfba70c7ca82ecf03b1c073ae7135342f2cf6c..c4074ef4536ff8301acce0a91cdb556e6e2afd20 100644 (file)
@@ -86,7 +86,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_project_settings() throws Exception {
+  public void return_project_settings() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -110,7 +110,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void not_returned_secured_settings_with_only_preview_permission() throws Exception {
+  public void not_returned_secured_settings_with_only_preview_permission() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.PREVIEW_EXECUTION).addProjectUuidPermissions(UserRole.USER, project.uuid());
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -133,7 +133,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_project_with_module_settings() throws Exception {
+  public void return_project_with_module_settings() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -169,7 +169,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_project_with_module_settings_inherited_from_project() throws Exception {
+  public void return_project_with_module_settings_inherited_from_project() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -200,7 +200,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_project_with_module_with_sub_module() throws Exception {
+  public void return_project_with_module_with_sub_module() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -248,7 +248,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_project_with_two_modules() throws Exception {
+  public void return_project_with_two_modules() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -292,7 +292,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_provisioned_project_settings() throws Exception {
+  public void return_provisioned_project_settings() {
     // No snapshot attached on the project -> provisioned project
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
@@ -313,7 +313,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_sub_module_settings() throws Exception {
+  public void return_sub_module_settings() {
 
     ComponentDto project = ComponentTesting.newProjectDto();
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -346,7 +346,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_sub_module_settings_including_settings_from_parent_modules() throws Exception {
+  public void return_sub_module_settings_including_settings_from_parent_modules() {
     ComponentDto project = ComponentTesting.newProjectDto();
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
     addDefaultProfile();
@@ -380,7 +380,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_sub_module_settings_only_inherited_from_project() throws Exception {
+  public void return_sub_module_settings_only_inherited_from_project() {
     ComponentDto project = ComponentTesting.newProjectDto();
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
     addDefaultProfile();
@@ -412,7 +412,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_sub_module_settings_inherited_from_project_and_module() throws Exception {
+  public void return_sub_module_settings_inherited_from_project_and_module() {
     ComponentDto project = ComponentTesting.newProjectDto();
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
     addDefaultProfile();
@@ -445,7 +445,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_quality_profile_from_project_profile() throws Exception {
+  public void return_quality_profile_from_project_profile() {
     Date ruleUpdatedAt = DateUtils.parseDateTime("2014-01-14T13:00:00+0100");
 
     ComponentDto project = ComponentTesting.newProjectDto();
@@ -469,7 +469,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_quality_profile_from_default_profile() throws Exception {
+  public void return_quality_profile_from_default_profile() {
     Date ruleUpdatedAt = DateUtils.parseDateTime("2014-01-14T13:00:00+0100");
 
     ComponentDto project = ComponentTesting.newProjectDto();
@@ -492,7 +492,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_quality_profile_from_given_profile_name() throws Exception {
+  public void return_quality_profile_from_given_profile_name() {
     Date ruleUpdatedAt = DateUtils.parseDateTime("2014-01-14T13:00:00+0100");
 
     ComponentDto project = ComponentTesting.newProjectDto();
@@ -515,7 +515,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_quality_profiles_even_when_project_does_not_exists() throws Exception {
+  public void return_quality_profiles_even_when_project_does_not_exists() {
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     Date ruleUpdatedAt = DateUtils.parseDateTime("2014-01-14T13:00:00+0100");
 
@@ -535,7 +535,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_provisioned_project_profile() throws Exception {
+  public void return_provisioned_project_profile() {
     Date ruleUpdatedAt = DateUtils.parseDateTime("2014-01-14T13:00:00+0100");
 
     // No snapshot attached on the project -> provisioned project
@@ -560,7 +560,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void fail_when_no_quality_profile_for_a_language() throws Exception {
+  public void fail_when_no_quality_profile_for_a_language() {
     ComponentDto project = ComponentTesting.newProjectDto().setKey("org.codehaus.sonar:sonar");
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -575,7 +575,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_active_rules() throws Exception {
+  public void return_active_rules() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -610,7 +610,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_only_active_rules_from_project_profile() throws Exception {
+  public void return_only_active_rules_from_project_profile() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -648,7 +648,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_more_than_10_active_rules() throws Exception {
+  public void return_more_than_10_active_rules() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -670,7 +670,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_custom_rule() throws Exception {
+  public void return_custom_rule() {
     Date ruleUpdatedAt = DateUtils.parseDateTime("2014-01-14T13:00:00+0100");
 
     ComponentDto project = ComponentTesting.newProjectDto();
@@ -702,7 +702,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_manual_rules() throws Exception {
+  public void return_manual_rules() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -723,7 +723,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void fail_if_no_permission() throws Exception {
+  public void fail_if_no_permission() {
     MockUserSession.set().setLogin("john").setGlobalPermissions();
 
     ComponentDto project = ComponentTesting.newProjectDto();
@@ -739,7 +739,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void fail_when_not_preview_and_only_dry_run_permission() throws Exception {
+  public void fail_when_not_preview_and_only_dry_run_permission() {
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.PREVIEW_EXECUTION);
 
     ComponentDto project = ComponentTesting.newProjectDto();
@@ -757,7 +757,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_file_data_from_single_project() throws Exception {
+  public void return_file_data_from_single_project() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -776,7 +776,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_file_data_from_multi_modules() throws Exception {
+  public void return_file_data_from_multi_modules() {
     ComponentDto project = ComponentTesting.newProjectDto();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
@@ -803,7 +803,7 @@ public class ProjectRepositoryLoaderMediumTest {
   }
 
   @Test
-  public void return_file_data_from_module() throws Exception {
+  public void return_file_data_from_module() {
     ComponentDto project = ComponentTesting.newProjectDto();
     tester.get(DbClient.class).componentDao().insert(dbSession, project);
     addDefaultProfile();
index 1daa51c3dff61d8240d7e3b12d6cfb8ef2835447..c2258e44af0d2d36fffa58a08828fafbfa32747e 100644 (file)
@@ -51,7 +51,7 @@ public class UsersActionTest {
   UsersAction usersAction;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     es.truncateIndices();
 
     userIndex = new UserIndex(es.client());
index 5c2268872f368a17fcc311af81a281c7dd90e097..9b434ba91d1e07de5ca262dbfd575dd9dd084d11 100644 (file)
@@ -60,7 +60,7 @@ public class ComponentCleanerServiceMediumTest {
   ComponentCleanerService service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
 
     db = tester.get(DbClient.class);
@@ -75,7 +75,7 @@ public class ComponentCleanerServiceMediumTest {
   }
 
   @Test
-  public void delete_project() throws Exception {
+  public void delete_project() {
     ComponentDto project = ComponentTesting.newProjectDto();
     db.componentDao().insert(session, project);
     session.commit();
@@ -86,7 +86,7 @@ public class ComponentCleanerServiceMediumTest {
   }
 
   @Test
-  public void remove_issue_permission_index_when_deleting_a_project() throws Exception {
+  public void remove_issue_permission_index_when_deleting_a_project() {
     ComponentDto project = ComponentTesting.newProjectDto();
     db.componentDao().insert(session, project);
 
@@ -103,7 +103,7 @@ public class ComponentCleanerServiceMediumTest {
   }
 
   @Test
-  public void remove_issue_when_deleting_a_project() throws Exception {
+  public void remove_issue_when_deleting_a_project() {
     // ARRANGE
     ComponentDto project = ComponentTesting.newProjectDto();
     db.componentDao().insert(session, project);
@@ -127,7 +127,7 @@ public class ComponentCleanerServiceMediumTest {
   }
 
   @Test(expected = IllegalArgumentException.class)
-  public void fail_to_delete_not_project() throws Exception {
+  public void fail_to_delete_not_project() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
     db.componentDao().insert(session, project, file);
index 0b2136f67fff1fc4844837c668136beda3483d82..06d4ce46e01d721a62ac5d556ec7a361f5ef08bd 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ComponentQueryTest {
 
   @Test
-  public void should_build_query() throws Exception {
+  public void should_build_query() {
     ComponentQuery query = ComponentQuery.builder()
       .keys(newArrayList("org.codehaus"))
       .names(newArrayList("Sona"))
@@ -48,20 +48,20 @@ public class ComponentQueryTest {
   }
 
   @Test
-  public void should_accept_null_sort() throws Exception {
+  public void should_accept_null_sort() {
     ComponentQuery query = ComponentQuery.builder().sort(null).build();
     assertThat(query.sort()).isNull();
   }
 
   @Test
-  public void should_sort_by_name_asc_by_default() throws Exception {
+  public void should_sort_by_name_asc_by_default() {
     ComponentQuery query = ComponentQuery.builder().build();
     assertThat(query.sort()).isEqualTo(ComponentQuery.SORT_BY_NAME);
     assertThat(query.asc()).isTrue();
   }
 
   @Test
-  public void should_throw_exception_if_sort_is_not_valid() throws Exception {
+  public void should_throw_exception_if_sort_is_not_valid() {
     try {
       ComponentQuery.builder()
         .sort("UNKNOWN")
@@ -79,7 +79,7 @@ public class ComponentQueryTest {
   }
 
   @Test
-  public void should_build_non_paginated_query() throws Exception {
+  public void should_build_non_paginated_query() {
     ComponentQuery query = ComponentQuery.builder().pageSize(ComponentQuery.NO_PAGINATION).build();
     assertThat(query.pageSize()).isEqualTo(ComponentQuery.NO_PAGINATION);
     assertThat(query.pageIndex()).isEqualTo(ComponentQuery.DEFAULT_PAGE_INDEX);
index 3ae19ea4b3767f55aa7a225384faa640551d0a5c..2f3d3ecc7860d4453bc7e92b0fef2dcb37f6f615 100644 (file)
@@ -62,7 +62,7 @@ public class ComponentServiceMediumTest {
   ComponentService service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     session = db.openSession(false);
@@ -75,33 +75,33 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void get_by_key() throws Exception {
+  public void get_by_key() {
     ComponentDto project = createProject("sample:root");
     assertThat(service.getByKey(project.getKey())).isNotNull();
   }
 
   @Test
-  public void get_nullable_by_key() throws Exception {
+  public void get_nullable_by_key() {
     ComponentDto project = createProject("sample:root");
     assertThat(service.getNullableByKey(project.getKey())).isNotNull();
     assertThat(service.getNullableByKey("unknown")).isNull();
   }
 
   @Test
-  public void get_by_uuid() throws Exception {
+  public void get_by_uuid() {
     ComponentDto project = createProject("sample:root");
     assertThat(service.getByUuid(project.uuid())).isNotNull();
   }
 
   @Test
-  public void get_nullable_by_uuid() throws Exception {
+  public void get_nullable_by_uuid() {
     ComponentDto project = createProject("sample:root");
     assertThat(service.getNullableByUuid(project.uuid())).isNotNull();
     assertThat(service.getNullableByUuid("unknown")).isNull();
   }
 
   @Test
-  public void update_project_key() throws Exception {
+  public void update_project_key() {
     ComponentDto project = createProject("sample:root");
     ComponentDto file = ComponentTesting.newFileDto(project).setKey("sample:root:src/File.xoo");
     tester.get(ComponentDao.class).insert(session, file);
@@ -122,7 +122,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void update_module_key() throws Exception {
+  public void update_module_key() {
     ComponentDto project = createProject("sample:root");
     ComponentDto module = ComponentTesting.newModuleDto(project).setKey("sample:root:module");
     tester.get(ComponentDao.class).insert(session, module);
@@ -149,7 +149,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void update_provisioned_project_key() throws Exception {
+  public void update_provisioned_project_key() {
     ComponentDto provisionedProject = ComponentTesting.newProjectDto().setKey("provisionedProject");
     tester.get(ComponentDao.class).insert(session, provisionedProject);
 
@@ -165,14 +165,14 @@ public class ComponentServiceMediumTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void fail_to_update_project_key_without_admin_permission() throws Exception {
+  public void fail_to_update_project_key_without_admin_permission() {
     ComponentDto project = createProject("sample:root");
     MockUserSession.set().setLogin("john").addProjectUuidPermissions(UserRole.USER, project.uuid());
     service.updateKey(project.key(), "sample2:root");
   }
 
   @Test
-  public void check_module_keys_before_renaming() throws Exception {
+  public void check_module_keys_before_renaming() {
     ComponentDto project = createProject("sample:root");
     ComponentDto module = ComponentTesting.newModuleDto(project).setKey("sample:root:module");
     tester.get(ComponentDao.class).insert(session, module);
@@ -191,7 +191,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void check_module_keys_before_renaming_return_duplicate_key() throws Exception {
+  public void check_module_keys_before_renaming_return_duplicate_key() {
     ComponentDto project = createProject("sample:root");
     ComponentDto module = ComponentTesting.newModuleDto(project).setKey("sample:root:module");
     tester.get(ComponentDao.class).insert(session, module);
@@ -210,14 +210,14 @@ public class ComponentServiceMediumTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void fail_to_check_module_keys_before_renaming_without_admin_permission() throws Exception {
+  public void fail_to_check_module_keys_before_renaming_without_admin_permission() {
     ComponentDto project = createProject("sample:root");
     MockUserSession.set().setLogin("john").addProjectUuidPermissions(UserRole.USER, project.uuid());
     service.checkModuleKeysBeforeRenaming(project.key(), "sample", "sample2");
   }
 
   @Test
-  public void bulk_update_project_key() throws Exception {
+  public void bulk_update_project_key() {
     ComponentDto project = createProject("sample:root");
     ComponentDto module = ComponentTesting.newModuleDto(project).setKey("sample:root:module");
     tester.get(ComponentDao.class).insert(session, module);
@@ -245,7 +245,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void bulk_update_provisioned_project_key() throws Exception {
+  public void bulk_update_provisioned_project_key() {
     ComponentDto provisionedProject = ComponentTesting.newProjectDto().setKey("provisionedProject");
     tester.get(ComponentDao.class).insert(session, provisionedProject);
 
@@ -261,14 +261,14 @@ public class ComponentServiceMediumTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void fail_to_bulk_update_project_key_without_admin_permission() throws Exception {
+  public void fail_to_bulk_update_project_key_without_admin_permission() {
     ComponentDto project = createProject("sample:root");
     MockUserSession.set().setLogin("john").addProjectPermissions(UserRole.USER, project.key());
     service.bulkUpdateKey("sample:root", "sample", "sample2");
   }
 
   @Test
-  public void create_project() throws Exception {
+  public void create_project() {
     executeStartupTasksToCreateDefaultPermissionTemplate();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.PROVISIONING);
 
@@ -289,7 +289,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void create_new_project_with_branch() throws Exception {
+  public void create_new_project_with_branch() {
     executeStartupTasksToCreateDefaultPermissionTemplate();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.PROVISIONING);
 
@@ -301,7 +301,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void create_view() throws Exception {
+  public void create_view() {
     executeStartupTasksToCreateDefaultPermissionTemplate();
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.PROVISIONING);
 
@@ -322,7 +322,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void fail_to_create_new_component_on_invalid_key() throws Exception {
+  public void fail_to_create_new_component_on_invalid_key() {
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.PROVISIONING);
 
     try {
@@ -335,7 +335,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void fail_to_create_new_component_on_invalid_branch() throws Exception {
+  public void fail_to_create_new_component_on_invalid_branch() {
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.PROVISIONING);
 
     try {
@@ -348,7 +348,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void fail_to_create_new_component_if_key_already_exists() throws Exception {
+  public void fail_to_create_new_component_if_key_already_exists() {
     MockUserSession.set().setLogin("john").setGlobalPermissions(GlobalPermissions.PROVISIONING);
 
     ComponentDto project = ComponentTesting.newProjectDto().setKey("struts");
@@ -364,7 +364,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void should_return_project_uuids() throws Exception {
+  public void should_return_project_uuids() {
     ComponentDto project = createProject("sample:root");
     String moduleKey = "sample:root:module";
     ComponentDto module = ComponentTesting.newModuleDto(project).setKey(moduleKey);
@@ -380,7 +380,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void should_fail_on_components_not_found() throws Exception {
+  public void should_fail_on_components_not_found() {
     String moduleKey = "sample:root:module";
     String fileKey = "sample:root:module:Foo.xoo";
 
@@ -393,7 +393,7 @@ public class ComponentServiceMediumTest {
   }
 
   @Test
-  public void should_fail_silently_on_components_not_found_if_told_so() throws Exception {
+  public void should_fail_silently_on_components_not_found_if_told_so() {
     String moduleKey = "sample:root:module";
     String fileKey = "sample:root:module:Foo.xoo";
 
index 50c4b4c4d6fd6b136abacfa8c9ddf76acbfbb417..45415e798e1ee3f53440e8c7c8aa137175b9f32b 100644 (file)
@@ -111,7 +111,7 @@ public class DefaultComponentFinderTest {
   }
 
   @Test
-  public void should_skip_pagination() throws Exception {
+  public void should_skip_pagination() {
     ComponentQuery query = ComponentQuery.builder().pageSize(ComponentQuery.NO_PAGINATION)
       .pageIndex(ComponentQuery.DEFAULT_PAGE_INDEX).build();
 
index 6f62417470be87319fb0727dd6cfda70f1d5106e..a7b643f7905bd3bc9aad78fc164f361512940c4a 100644 (file)
@@ -50,14 +50,14 @@ public class ComponentDaoTest extends AbstractDaoTestCase {
   System2 system2;
 
   @Before
-  public void createDao() throws Exception {
+  public void createDao() {
     session = getMyBatis().openSession(false);
     system2 = mock(System2.class);
     dao = new ComponentDao(system2);
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
@@ -294,7 +294,7 @@ public class ComponentDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void find_modules_by_project() throws Exception {
+  public void find_modules_by_project() {
     setupData("multi-modules");
 
     List<ComponentDto> results = dao.findModulesByProject("org.struts:struts", session);
@@ -311,7 +311,7 @@ public class ComponentDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void find_sub_projects_by_component_keys() throws Exception {
+  public void find_sub_projects_by_component_keys() {
     setupData("multi-modules");
 
     // Sub project of a file
@@ -346,7 +346,7 @@ public class ComponentDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_enabled_modules_tree() throws Exception {
+  public void select_enabled_modules_tree() {
     setupData("multi-modules");
 
     // From root project
@@ -367,7 +367,7 @@ public class ComponentDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_all_modules_tree() throws Exception {
+  public void select_all_modules_tree() {
     setupData("multi-modules");
 
     // From root project, disabled sub module is returned
@@ -383,7 +383,7 @@ public class ComponentDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_enabled_module_files_tree_from_module() throws Exception {
+  public void select_enabled_module_files_tree_from_module() {
     setupData("select_module_files_tree");
 
     // From root project
@@ -414,7 +414,7 @@ public class ComponentDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_enabled_module_files_tree_from_project() throws Exception {
+  public void select_enabled_module_files_tree_from_project() {
     setupData("select_module_files_tree");
 
     // From root project
index e830c9ef298c79845e95a511d3a76ea7e9826c79..24a480baa0feccf1ab3c2318943872dc833d4c3a 100644 (file)
@@ -42,19 +42,19 @@ public class ComponentIndexDaoTest {
   ComponentIndexDao dao;
 
   @Before
-  public void createDao() throws Exception {
+  public void createDao() {
     dbTester.truncateTables();
     session = dbTester.myBatis().openSession(false);
     dao = new ComponentIndexDao();
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void select_project_ids_from_query_and_view_or_sub_view_uuid() throws Exception {
+  public void select_project_ids_from_query_and_view_or_sub_view_uuid() {
     dbTester.prepareDbUnit(getClass(), "select_project_ids_from_query_and_view_or_sub_view_uuid.xml");
     String viewUuid = "EFGH";
 
index d8ba219baa8b1ac5e202ff667d0ba9da1262110f..f29a3ddc20b08bfcfedb06c298a9aa71dadfe326 100644 (file)
@@ -45,18 +45,18 @@ public class ComponentLinkDaoTest {
   ComponentLinkDao dao;
 
   @Before
-  public void createDao() throws Exception {
+  public void createDao() {
     session = dbTester.myBatis().openSession(false);
     dao = new ComponentLinkDao();
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void select_by_component_uuid() throws Exception {
+  public void select_by_component_uuid() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     List<ComponentLinkDto> links = dao.selectByComponentUuid(session, "ABCD");
@@ -74,7 +74,7 @@ public class ComponentLinkDaoTest {
   }
 
   @Test
-  public void insert() throws Exception {
+  public void insert() {
     dbTester.prepareDbUnit(getClass(), "empty.xml");
 
     dao.insert(session, new ComponentLinkDto()
@@ -89,7 +89,7 @@ public class ComponentLinkDaoTest {
   }
 
   @Test
-  public void update() throws Exception {
+  public void update() {
     dbTester.prepareDbUnit(getClass(), "update.xml");
 
     dao.update(session, new ComponentLinkDto()
@@ -105,7 +105,7 @@ public class ComponentLinkDaoTest {
   }
 
   @Test
-  public void delete() throws Exception {
+  public void delete() {
     dbTester.prepareDbUnit(getClass(), "delete.xml");
 
     dao.delete(session, 1L);
index 94f8c1ca48b3e7cfd99f296db275a8ce66d607ba..1f636b2b26c533db01e2bfdae03454cc053c9436 100644 (file)
@@ -45,14 +45,14 @@ public class SnapshotDaoTest extends AbstractDaoTestCase {
   System2 system2;
 
   @Before
-  public void createDao() throws Exception {
+  public void createDao() {
     session = getMyBatis().openSession(false);
     system2 = mock(System2.class);
     sut = new SnapshotDao(system2);
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index b7d0e94921692afe1c52621a2f9fe04712b585d1..95610a3deb88c9af6ba3dd7b3dadcad159e2aacc 100644 (file)
@@ -91,7 +91,7 @@ public class ComponentAppActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     DbClient dbClient = mock(DbClient.class);
     when(dbClient.openSession(false)).thenReturn(session);
     when(dbClient.componentDao()).thenReturn(componentDao);
@@ -189,7 +189,7 @@ public class ComponentAppActionTest {
   }
 
   @Test
-  public void fail_on_unknown_component() throws Exception {
+  public void fail_on_unknown_component() {
     MockUserSession.set().setLogin("john").addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
     when(componentDao.getNullableByUuid(session, COMPONENT_UUID)).thenReturn(null);
 
index 6d216685dc7a082b11ef34f8839be63853823471..f169e304c191939900bd8ca16fd08be5b2598e43 100644 (file)
@@ -37,13 +37,13 @@ public class ComponentsWsTest {
   WebService.Controller controller;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     WsTester tester = new WsTester(new ComponentsWs(new ComponentAppAction(mock(DbClient.class), mock(Durations.class), mock(I18n.class)), new SearchAction(mock(DbClient.class))));
     controller = tester.controller("api/components");
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
     assertThat(controller.since()).isEqualTo("4.2");
@@ -51,7 +51,7 @@ public class ComponentsWsTest {
   }
 
   @Test
-  public void define_suggestions_action() throws Exception {
+  public void define_suggestions_action() {
     WebService.Action action = controller.action("suggestions");
     assertThat(action).isNotNull();
     assertThat(action.isInternal()).isTrue();
@@ -62,7 +62,7 @@ public class ComponentsWsTest {
   }
 
   @Test
-  public void define_app_action() throws Exception {
+  public void define_app_action() {
     WebService.Action action = controller.action("app");
     assertThat(action).isNotNull();
     assertThat(action.isInternal()).isTrue();
@@ -72,7 +72,7 @@ public class ComponentsWsTest {
   }
 
   @Test
-  public void define_search_action() throws Exception {
+  public void define_search_action() {
     WebService.Action action = controller.action("search");
     assertThat(action).isNotNull();
     assertThat(action.isInternal()).isTrue();
index 4246751004b24df9de122b58492a0bd4b46356d3..dc8a40e4831e84a591955763b197cf03ebfdecfe 100644 (file)
@@ -31,7 +31,7 @@ public class EventsWsTest {
   WsTester tester = new WsTester(new EventsWs());
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WebService.Controller controller = tester.controller("api/events");
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
index 473dd6896dbe20a602d0d00fbf3ec94b99d0ec01..94f05808947ab037c04b444e734283060ad03f39 100644 (file)
@@ -33,13 +33,13 @@ public class ProjectsWsTest {
   WebService.Controller controller;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     WsTester tester = new WsTester(new ProjectsWs());
     controller = tester.controller("api/projects");
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
     assertThat(controller.since()).isEqualTo("2.10");
@@ -47,7 +47,7 @@ public class ProjectsWsTest {
   }
 
   @Test
-  public void define_index_action() throws Exception {
+  public void define_index_action() {
     WebService.Action action = controller.action("index");
     assertThat(action).isNotNull();
     assertThat(action.handler()).isInstanceOf(RailsHandler.class);
@@ -56,7 +56,7 @@ public class ProjectsWsTest {
   }
 
   @Test
-  public void define_create_action() throws Exception {
+  public void define_create_action() {
     WebService.Action action = controller.action("create");
     assertThat(action).isNotNull();
     assertThat(action.handler()).isInstanceOf(RailsHandler.class);
@@ -65,7 +65,7 @@ public class ProjectsWsTest {
   }
 
   @Test
-  public void define_destroy_action() throws Exception {
+  public void define_destroy_action() {
     WebService.Action action = controller.action("destroy");
     assertThat(action).isNotNull();
     assertThat(action.handler()).isInstanceOf(RailsHandler.class);
index ddf33774804eb2c41147c07536279d89f1d54793..4df182c329e1e6dd41af34801e067436b0c6b11a 100644 (file)
@@ -33,13 +33,13 @@ public class ResourcesWsTest {
   WebService.Controller controller;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     WsTester tester = new WsTester(new ResourcesWs());
     controller = tester.controller("api/resources");
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     assertThat(controller).isNotNull();
     assertThat(controller.since()).isEqualTo("2.10");
     assertThat(controller.description()).isNotEmpty();
@@ -47,7 +47,7 @@ public class ResourcesWsTest {
   }
 
   @Test
-  public void define_index_action() throws Exception {
+  public void define_index_action() {
     WebService.Action action = controller.action("index");
     assertThat(action).isNotNull();
     assertThat(action.handler()).isInstanceOf(RailsHandler.class);
@@ -56,7 +56,7 @@ public class ResourcesWsTest {
   }
 
   @Test
-  public void define_search_action() throws Exception {
+  public void define_search_action() {
     WebService.Action action = controller.action("search");
     assertThat(action).isNotNull();
     assertThat(action.handler()).isInstanceOf(RailsHandler.class);
index 8c8e4670c7102cec54b1d7b6d321b69616111f36..b3665895986d6aad8bd2c0e71d2b207734e859c5 100644 (file)
@@ -47,7 +47,7 @@ public class SearchActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis(),
       new ComponentDao(), new AuthorizationDao(dbTester.myBatis()), new ComponentIndexDao()
index bd391ffbed25eea4498357558d0268fb0ebf5c5b..43b640ddbce2530b5931a1df92a3445d3a657054 100644 (file)
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ComputationContainerTest {
 
   @Test
-  public void componentClasses() throws Exception {
+  public void componentClasses() {
     assertThat(ComputationContainer.componentClasses()).isNotEmpty();
   }
 }
index 5f20e21bb36965c2038d60bb7f329b679d71767c..82fe204eb8a18dc756eb491090467b321f672432 100644 (file)
@@ -32,7 +32,7 @@ public class ComputationContextTest {
   ComputationContext sut = new ComputationContext(mock(BatchReportReader.class), mock(ComponentDto.class));
 
   @Test(expected = IllegalStateException.class)
-  public void setProjectSettings() throws Exception {
+  public void setProjectSettings() {
     sut.setProjectSettings(mock(Settings.class));
     sut.setProjectSettings(mock(Settings.class));
   }
index 5beec075d1bb62c783e009927c714b1351a55743..d1ca0e5436ab37658016b4ab6ed66394bda86cde 100644 (file)
@@ -74,7 +74,7 @@ public class ComputationServiceTest {
   ProjectSettingsFactory settingsFactory = mock(ProjectSettingsFactory.class, Mockito.RETURNS_DEEP_STUBS);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new ComponentDao(), new SnapshotDao(system));
     sut = new ComputationService(dbClient, steps, activityService, settingsFactory, tempFolder, system);
 
index 43cac0b17005cc3c9e54d9266c6545779f52c455..f3d0993db638bbd1323ab775de8a9d81a07005a5 100644 (file)
@@ -66,7 +66,7 @@ public class ComputationThreadTest {
   }
 
   @Test
-  public void handle_error_during_queue_pop() throws Exception {
+  public void handle_error_during_queue_pop() {
     when(queue.pop()).thenThrow(new IllegalStateException());
 
     sut.run();
index b7ffeb653116b2952f117c41674ab28273b2c59c..ba5ec765781a4e6f065d86fc6d7babf693cac1ff 100644 (file)
@@ -83,7 +83,7 @@ public class ReportQueueTest {
   }
 
   @Test
-  public void add_report_to_queue() throws Exception {
+  public void add_report_to_queue() {
     // must:
     // 1. insert metadata in db
     // 2. copy report content to directory /data/analysis
@@ -112,7 +112,7 @@ public class ReportQueueTest {
   }
 
   @Test
-  public void find_by_project_key() throws Exception {
+  public void find_by_project_key() {
     sut.add("P1", generateData());
     assertThat(sut.selectByProjectKey("P1")).hasSize(1).extracting("projectKey").containsExactly("P1");
     assertThat(sut.selectByProjectKey("P2")).isEmpty();
@@ -154,7 +154,7 @@ public class ReportQueueTest {
   }
 
   @Test
-  public void do_not_pop_corrupted_item() throws Exception {
+  public void do_not_pop_corrupted_item() {
     ReportQueue.Item item = sut.add("P1", generateData());
 
     // emulate corruption: file is missing on FS
@@ -167,7 +167,7 @@ public class ReportQueueTest {
   }
 
   @Test
-  public void clear() throws Exception {
+  public void clear() {
     sut.add("P1", generateData());
     sut.add("P2", generateData());
     assertThat(analysisDir()).exists().isDirectory();
@@ -179,18 +179,18 @@ public class ReportQueueTest {
   }
 
   @Test
-  public void clear_do_not_fail_when_directory_do_not_exist() throws Exception {
+  public void clear_do_not_fail_when_directory_do_not_exist() {
     sut.clear();
     sut.clear();
   }
 
   @Test(expected = IllegalStateException.class)
-  public void add_on_non_existent_project() throws Exception {
+  public void add_on_non_existent_project() {
     sut.add("UNKNOWN_PROJECT_KEY", generateData());
   }
 
   @Test
-  public void reset_to_pending_status() throws Exception {
+  public void reset_to_pending_status() {
     // 2 pending
     sut.add("P1", generateData());
     sut.add("P2", generateData());
index 2b34564c7b18ca80a6777ec3f37b6d6c49613d1b..6e3a09a0df387b17e2bf75b03dd00e28ffc0a40d 100644 (file)
@@ -72,7 +72,7 @@ public class AnalysisReportDaoTest {
   }
 
   @Test
-  public void insert_multiple_reports() throws Exception {
+  public void insert_multiple_reports() {
     db.prepareDbUnit(getClass(), "empty.xml");
 
     AnalysisReportDto report1 = newDefaultAnalysisReport().setUuid("UUID_1");
index 7b9b56012ba2a5e981f90ea1abbfb79354cf6cdf..2bda0425723dbeabb75a7b43c98d7299bc146d3b 100644 (file)
@@ -81,19 +81,19 @@ public class IssueComputationTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     sut.afterReportProcessing();
   }
 
   @Test
-  public void store_issues_on_disk() throws Exception {
+  public void store_issues_on_disk() {
     process();
 
     assertThat(Iterators.getOnlyElement(outputIssues.traverse()).key()).isEqualTo("ISSUE_A");
   }
 
   @Test
-  public void copy_rule_tags_on_new_issues() throws Exception {
+  public void copy_rule_tags_on_new_issues() {
     inputIssue.setIsNew(true);
     rule.setTags(ImmutableSet.of("bug", "performance"));
     rule.setSystemTags(ImmutableSet.of("blocker"));
@@ -104,7 +104,7 @@ public class IssueComputationTest {
   }
 
   @Test
-  public void do_not_copy_rule_tags_on_existing_issues() throws Exception {
+  public void do_not_copy_rule_tags_on_existing_issues() {
     inputIssue.setIsNew(false);
     rule.setTags(ImmutableSet.of("bug", "performance"));
     rule.setSystemTags(ImmutableSet.of("blocker"));
@@ -115,7 +115,7 @@ public class IssueComputationTest {
   }
 
   @Test
-  public void guess_author_of_new_issues() throws Exception {
+  public void guess_author_of_new_issues() {
     inputIssue.setIsNew(true);
     inputIssue.setLine(3);
     when(lineCache.lineAuthor(3)).thenReturn("charlie");
@@ -126,7 +126,7 @@ public class IssueComputationTest {
   }
 
   @Test
-  public void do_not_fail_if_missing_author_for_new_issues() throws Exception {
+  public void do_not_fail_if_missing_author_for_new_issues() {
     inputIssue.setIsNew(true);
     inputIssue.setLine(3);
     when(lineCache.lineAuthor(3)).thenReturn(null);
@@ -137,7 +137,7 @@ public class IssueComputationTest {
   }
 
   @Test
-  public void do_not_guess_author_of_existing_issues() throws Exception {
+  public void do_not_guess_author_of_existing_issues() {
     inputIssue.setIsNew(false);
     inputIssue.setLine(3);
     when(lineCache.lineAuthor(3)).thenReturn("charlie");
@@ -148,7 +148,7 @@ public class IssueComputationTest {
   }
 
   @Test
-  public void auto_assign_new_issues() throws Exception {
+  public void auto_assign_new_issues() {
     inputIssue.setIsNew(true);
     inputIssue.setAuthorLogin("charlie");
     when(scmAccountCache.getNullable("charlie")).thenReturn("char.lie");
@@ -159,7 +159,7 @@ public class IssueComputationTest {
   }
 
   @Test
-  public void do_not_auto_assign_existing_issues() throws Exception {
+  public void do_not_auto_assign_existing_issues() {
     inputIssue.setIsNew(false);
     inputIssue.setAuthorLogin("charlie");
     when(scmAccountCache.getNullable("charlie")).thenReturn("char.lie");
@@ -170,7 +170,7 @@ public class IssueComputationTest {
   }
 
   @Test
-  public void do_not_override_author_and_assignee_set_by_old_batch_plugins() throws Exception {
+  public void do_not_override_author_and_assignee_set_by_old_batch_plugins() {
     inputIssue.setIsNew(true);
 
     // these fields were provided during project analysis, for instance
@@ -188,7 +188,7 @@ public class IssueComputationTest {
   }
 
   @Test
-  public void assign_default_assignee_when_available() throws Exception {
+  public void assign_default_assignee_when_available() {
     inputIssue.setIsNew(true);
     String wolinski = "wolinski";
     when(context.getProjectSettings().getString(CoreProperties.DEFAULT_ISSUE_ASSIGNEE)).thenReturn(wolinski);
@@ -201,7 +201,7 @@ public class IssueComputationTest {
   }
 
   @Test
-  public void do_not_assign_default_assignee_when_not_found_in_index() throws Exception {
+  public void do_not_assign_default_assignee_when_not_found_in_index() {
     inputIssue.setIsNew(true);
     String wolinski = "wolinski";
     when(context.getProjectSettings().getString(CoreProperties.DEFAULT_ISSUE_ASSIGNEE)).thenReturn(wolinski);
index 5eb35e4976d0af69fe72c956ce5a94b178f54cc6..23fb6501a82939ccbc5e581967e03194d671a06d 100644 (file)
@@ -38,12 +38,12 @@ public class RuleCacheLoaderTest {
   public static DbTester dbTester = new DbTester();
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
   }
 
   @Test
-  public void load_by_key() throws Exception {
+  public void load_by_key() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
     DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new RuleDao());
     RuleCacheLoader loader = new RuleCacheLoader(dbClient);
@@ -53,7 +53,7 @@ public class RuleCacheLoaderTest {
   }
 
   @Test
-  public void load_by_keys_is_not_supported() throws Exception {
+  public void load_by_keys_is_not_supported() {
     DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new RuleDao());
     RuleCacheLoader loader = new RuleCacheLoader(dbClient);
     try {
index 9c94c3ec2c0edc3106a768ea28d0c12dd28a00a3..57172b9b9dc7508d3a8ce990d0a6ae1e577bcd1e 100644 (file)
@@ -30,7 +30,7 @@ import static org.mockito.Mockito.when;
 public class RuleCacheTest {
 
   @Test
-  public void ruleName() throws Exception {
+  public void ruleName() {
     RuleCacheLoader loader = mock(RuleCacheLoader.class);
     when(loader.load(RuleKey.of("squid", "R002"))).thenReturn(new RuleDto().setName("Rule Two"));
     RuleCache cache = new RuleCache(loader);
index faa52fcbec68298e19f4b9dc237d46f0d68d4352..6f0fd8ae6fc198418dd42cf94d8bc35747033ae6 100644 (file)
@@ -41,7 +41,7 @@ public class ScmAccountCacheLoaderTest {
   public static EsTester esTester = new EsTester().addDefinitions(new UserIndexDefinition(new Settings()));
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     esTester.truncateIndices();
   }
 
@@ -67,7 +67,7 @@ public class ScmAccountCacheLoaderTest {
   }
 
   @Test
-  public void load_by_multiple_scm_accounts_is_not_supported_yet() throws Exception {
+  public void load_by_multiple_scm_accounts_is_not_supported_yet() {
     UserIndex index = new UserIndex(esTester.client());
     ScmAccountCacheLoader loader = new ScmAccountCacheLoader(index);
     try {
index c5635716af4693d7978a63e912ec00ba2eb19e2d..84074a7b03247565de8f92ac063eeedb9f23c0c7 100644 (file)
@@ -59,7 +59,7 @@ public class SourceLinesCacheTest {
   }
 
   @Test
-  public void line_author_from_report() throws Exception {
+  public void line_author_from_report() {
     BatchReportWriter reportWriter = new BatchReportWriter(dir);
     reportWriter.writeComponentChangesets(BatchReport.Changesets.newBuilder()
       .setComponentRef(123_456_789)
@@ -101,7 +101,7 @@ public class SourceLinesCacheTest {
   }
 
   @Test(expected = IllegalStateException.class)
-  public void fail_when_component_ref_is_not_filled() throws Exception {
+  public void fail_when_component_ref_is_not_filled() {
     sut.init("ANY_UUID", null, new BatchReportReader(dir));
     sut.lineAuthor(0);
   }
index 38f61abee62d489cc0135d53dafb3b6ce41e0a14..ef27d3ba663ea4fd748ec66dddd30457907f947c 100644 (file)
@@ -38,19 +38,19 @@ public class MetricCacheTest {
   MetricCache sut;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.prepareDbUnit(getClass(), "metrics.xml");
     sut = new MetricCache(new DbClient(db.database(), db.myBatis(), new MetricDao()));
   }
 
   @Test
-  public void cache_give_access_to_enabled_metrics() throws Exception {
+  public void cache_give_access_to_enabled_metrics() {
     assertThat(sut.get("ncloc").getId()).isEqualTo(1);
     assertThat(sut.get("coverage").getId()).isEqualTo(2);
   }
 
   @Test(expected = NotFoundException.class)
-  public void fail_when_metric_not_found() throws Exception {
+  public void fail_when_metric_not_found() {
     sut.get("complexity");
   }
 }
index 97cb70ea3461fca6ffb9936a354d2eba9d872359..55a1137fec16529701adc2a5798a8c7b0cb41067 100644 (file)
@@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ComputeFileSourceDataTest {
 
   @Test
-  public void compute_one_line() throws Exception {
+  public void compute_one_line() {
       ComputeFileSourceData computeFileSourceData = new ComputeFileSourceData(
         newArrayList("line1").iterator(),
         Lists.<LineReader>newArrayList(new MockLineReader()),
@@ -45,7 +45,7 @@ public class ComputeFileSourceDataTest {
   }
 
   @Test
-  public void compute_two_lines() throws Exception {
+  public void compute_two_lines() {
     ComputeFileSourceData computeFileSourceData = new ComputeFileSourceData(
       newArrayList("line1", "line2").iterator(),
       Lists.<LineReader>newArrayList(new MockLineReader()),
@@ -61,7 +61,7 @@ public class ComputeFileSourceDataTest {
   }
 
   @Test
-  public void compute_missing_last_line() throws Exception {
+  public void compute_missing_last_line() {
     ComputeFileSourceData computeFileSourceData = new ComputeFileSourceData(
       newArrayList("line1").iterator(),
       Lists.<LineReader>newArrayList(new MockLineReader()),
@@ -78,7 +78,7 @@ public class ComputeFileSourceDataTest {
   }
 
   @Test
-  public void remove_tabs_and_spaces_in_line_hashes() throws Exception {
+  public void remove_tabs_and_spaces_in_line_hashes() {
     String refLineHashes = new ComputeFileSourceData(
       newArrayList("line1").iterator(),
       Lists.<LineReader>newArrayList(new MockLineReader()),
@@ -93,7 +93,7 @@ public class ComputeFileSourceDataTest {
   }
 
   @Test
-  public void compute_line_hashes_of_empty_lines() throws Exception {
+  public void compute_line_hashes_of_empty_lines() {
     assertThat(new ComputeFileSourceData(
       newArrayList("   ").iterator(),
       Lists.<LineReader>newArrayList(new MockLineReader()),
index 1e8fa696cabec09ad97667f8476103707f2271da..d1791bd1592dba14edb374bcaf0c7687277d1ddc 100644 (file)
@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class CoverageLineReaderTest {
 
   @Test
-  public void set_coverage() throws Exception {
+  public void set_coverage() {
     CoverageLineReader computeCoverageLine = new CoverageLineReader(newArrayList(BatchReport.Coverage.newBuilder()
       .setLine(1)
       .setConditions(10)
@@ -56,7 +56,7 @@ public class CoverageLineReaderTest {
   }
 
   @Test
-  public void set_coverage_on_uncovered_lines() throws Exception {
+  public void set_coverage_on_uncovered_lines() {
     CoverageLineReader computeCoverageLine = new CoverageLineReader(newArrayList(BatchReport.Coverage.newBuilder()
       .setLine(1)
       .setUtHits(false)
@@ -75,7 +75,7 @@ public class CoverageLineReaderTest {
   }
 
   @Test
-  public void set_coverage_without_line_hits() throws Exception {
+  public void set_coverage_without_line_hits() {
     CoverageLineReader computeCoverageLine = new CoverageLineReader(newArrayList(BatchReport.Coverage.newBuilder()
       .setLine(1)
       .build()).iterator());
@@ -89,7 +89,7 @@ public class CoverageLineReaderTest {
   }
 
   @Test
-  public void set_overall_line_hits_with_only_ut() throws Exception {
+  public void set_overall_line_hits_with_only_ut() {
     CoverageLineReader computeCoverageLine = new CoverageLineReader(newArrayList(BatchReport.Coverage.newBuilder()
         .setLine(1)
         .setUtHits(true)
@@ -103,7 +103,7 @@ public class CoverageLineReaderTest {
   }
 
   @Test
-  public void set_overall_line_hits_with_only_it() throws Exception {
+  public void set_overall_line_hits_with_only_it() {
     CoverageLineReader computeCoverageLine = new CoverageLineReader(newArrayList(BatchReport.Coverage.newBuilder()
       .setLine(1)
       .setUtHits(false)
@@ -117,7 +117,7 @@ public class CoverageLineReaderTest {
   }
 
   @Test
-  public void set_overall_line_hits_with_ut_and_it() throws Exception {
+  public void set_overall_line_hits_with_ut_and_it() {
     CoverageLineReader computeCoverageLine = new CoverageLineReader(newArrayList(BatchReport.Coverage.newBuilder()
       .setLine(1)
       .setUtHits(true)
@@ -131,7 +131,7 @@ public class CoverageLineReaderTest {
   }
 
   @Test
-  public void nothing_to_do_when_no_coverage_info() throws Exception {
+  public void nothing_to_do_when_no_coverage_info() {
     CoverageLineReader computeCoverageLine = new CoverageLineReader(Collections.<BatchReport.Coverage>emptyList().iterator());
 
     FileSourceDb.Line.Builder lineBuilder = FileSourceDb.Data.newBuilder().addLinesBuilder().setLine(1);
@@ -147,7 +147,7 @@ public class CoverageLineReaderTest {
   }
 
   @Test
-  public void nothing_to_do_when_no_coverage_info_for_current_line() throws Exception {
+  public void nothing_to_do_when_no_coverage_info_for_current_line() {
     CoverageLineReader computeCoverageLine = new CoverageLineReader(newArrayList(
       BatchReport.Coverage.newBuilder()
         .setLine(1)
@@ -174,7 +174,7 @@ public class CoverageLineReaderTest {
   }
 
   @Test
-  public void nothing_to_do_when_no_coverage_info_for_next_line() throws Exception {
+  public void nothing_to_do_when_no_coverage_info_for_next_line() {
     CoverageLineReader computeCoverageLine = new CoverageLineReader(newArrayList(
       BatchReport.Coverage.newBuilder()
         .setLine(1)
index 8a462856e44360d4e06b452935d3d6f65b638f9e..8f64ab62772184adea4e783506042fe50fa83ecc 100644 (file)
@@ -38,7 +38,7 @@ public class DuplicationLineReaderTest {
   FileSourceDb.Line.Builder line4 = sourceData.addLinesBuilder().setSource("line4").setLine(4);
 
   @Test
-  public void read_nothing() throws Exception {
+  public void read_nothing() {
     DuplicationLineReader reader = new DuplicationLineReader(Collections.<BatchReport.Duplication>emptyList());
 
     reader.read(line1);
@@ -47,7 +47,7 @@ public class DuplicationLineReaderTest {
   }
 
   @Test
-  public void read_duplication_with_duplicates_on_same_file() throws Exception {
+  public void read_duplication_with_duplicates_on_same_file() {
     DuplicationLineReader reader = new DuplicationLineReader(newArrayList(
       BatchReport.Duplication.newBuilder()
         .setOriginPosition(BatchReport.Range.newBuilder()
@@ -75,7 +75,7 @@ public class DuplicationLineReaderTest {
   }
 
   @Test
-  public void read_duplication_with_duplicates_on_other_file() throws Exception {
+  public void read_duplication_with_duplicates_on_other_file() {
     DuplicationLineReader reader = new DuplicationLineReader(newArrayList(
       BatchReport.Duplication.newBuilder()
         .setOriginPosition(BatchReport.Range.newBuilder()
@@ -104,7 +104,7 @@ public class DuplicationLineReaderTest {
   }
 
   @Test
-  public void read_duplication_with_duplicates_on_other_file_from_other_project() throws Exception {
+  public void read_duplication_with_duplicates_on_other_file_from_other_project() {
     DuplicationLineReader reader = new DuplicationLineReader(newArrayList(
       BatchReport.Duplication.newBuilder()
         .setOriginPosition(BatchReport.Range.newBuilder()
@@ -133,7 +133,7 @@ public class DuplicationLineReaderTest {
   }
 
   @Test
-  public void read_many_duplications() throws Exception {
+  public void read_many_duplications() {
     DuplicationLineReader reader = new DuplicationLineReader(newArrayList(
       BatchReport.Duplication.newBuilder()
         .setOriginPosition(BatchReport.Range.newBuilder()
@@ -173,7 +173,7 @@ public class DuplicationLineReaderTest {
   }
 
   @Test
-  public void should_be_sorted_by_line_block() throws Exception {
+  public void should_be_sorted_by_line_block() {
     DuplicationLineReader reader = new DuplicationLineReader(newArrayList(
       BatchReport.Duplication.newBuilder()
         .setOriginPosition(BatchReport.Range.newBuilder()
@@ -213,7 +213,7 @@ public class DuplicationLineReaderTest {
   }
 
   @Test
-  public void should_be_sorted_by_line_length() throws Exception {
+  public void should_be_sorted_by_line_length() {
     DuplicationLineReader reader = new DuplicationLineReader(newArrayList(
       BatchReport.Duplication.newBuilder()
         .setOriginPosition(BatchReport.Range.newBuilder()
index 69625c5521ba387d502c3e4a5962c90f0f2b769f..8a1afbc496525d2da523f869f9a8a769d45a12de 100644 (file)
@@ -29,7 +29,7 @@ import static org.assertj.core.api.Fail.failBecauseExceptionWasNotThrown;
 public class RangeOffsetHelperTest {
 
   @Test
-  public void append_range() throws Exception {
+  public void append_range() {
     assertThat(RangeOffsetHelper.offsetToString(BatchReport.Range.newBuilder()
       .setStartLine(1).setEndLine(1)
       .setStartOffset(2).setEndOffset(3)
@@ -37,7 +37,7 @@ public class RangeOffsetHelperTest {
   }
 
   @Test
-  public void append_range_not_finishing_in_current_line() throws Exception {
+  public void append_range_not_finishing_in_current_line() {
     assertThat( RangeOffsetHelper.offsetToString(BatchReport.Range.newBuilder()
       .setStartLine(1).setEndLine(3)
       .setStartOffset(2).setEndOffset(3)
@@ -45,7 +45,7 @@ public class RangeOffsetHelperTest {
   }
 
   @Test
-  public void append_range_that_began_in_previous_line_and_finish_in_current_line() throws Exception {
+  public void append_range_that_began_in_previous_line_and_finish_in_current_line() {
     assertThat(RangeOffsetHelper.offsetToString(BatchReport.Range.newBuilder()
       .setStartLine(1).setEndLine(3)
       .setStartOffset(2).setEndOffset(3)
@@ -53,7 +53,7 @@ public class RangeOffsetHelperTest {
   }
 
   @Test
-  public void append_range_that_began_in_previous_line_and_not_finishing_in_current_line() throws Exception {
+  public void append_range_that_began_in_previous_line_and_not_finishing_in_current_line() {
     assertThat(RangeOffsetHelper.offsetToString(BatchReport.Range.newBuilder()
       .setStartLine(1).setEndLine(3)
       .setStartOffset(2).setEndOffset(3)
@@ -61,7 +61,7 @@ public class RangeOffsetHelperTest {
   }
 
   @Test
-  public void do_nothing_if_offset_is_empty() throws Exception {
+  public void do_nothing_if_offset_is_empty() {
     assertThat(RangeOffsetHelper.offsetToString(BatchReport.Range.newBuilder()
       .setStartLine(1).setEndLine(1)
       .setStartOffset(0).setEndOffset(0)
index 9a0a56983f3ec8b55cada5b823f0d10ec111ce95..3919d5fdbfd78cf548aaba18f56634ee879b491a 100644 (file)
@@ -59,20 +59,20 @@ public class ReportIteratorTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     if (sut != null) {
       sut.close();
     }
   }
 
   @Test
-  public void read_report() throws Exception {
+  public void read_report() {
     sut = new ReportIterator<>(file, BatchReport.Coverage.PARSER);
     assertThat(sut.next().getLine()).isEqualTo(1);
   }
 
   @Test
-  public void do_not_fail_when_calling_has_next_with_iterator_already_closed() throws Exception {
+  public void do_not_fail_when_calling_has_next_with_iterator_already_closed() {
     sut = new ReportIterator<>(file, BatchReport.Coverage.PARSER);
     assertThat(sut.next().getLine()).isEqualTo(1);
     assertThat(sut.hasNext()).isFalse();
index a8db073973ed34a9f4d116f3db150bbbd5073bb6..16bcd8861330b8edbe84fe212cbe6c4e19c67cb9 100644 (file)
@@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown;
 public class ScmLineReaderTest {
 
   @Test
-  public void set_scm() throws Exception {
+  public void set_scm() {
     BatchReport.Changesets scmReport = BatchReport.Changesets.newBuilder()
       .addChangeset(BatchReport.Changesets.Changeset.newBuilder()
         .setAuthor("john")
@@ -51,7 +51,7 @@ public class ScmLineReaderTest {
   }
 
   @Test
-  public void set_only_author() throws Exception {
+  public void set_only_author() {
     BatchReport.Changesets scmReport = BatchReport.Changesets.newBuilder()
       .addChangeset(BatchReport.Changesets.Changeset.newBuilder()
         .setAuthor("john")
@@ -70,7 +70,7 @@ public class ScmLineReaderTest {
   }
 
   @Test
-  public void set_only_date() throws Exception {
+  public void set_only_date() {
     BatchReport.Changesets scmReport = BatchReport.Changesets.newBuilder()
       .addChangeset(BatchReport.Changesets.Changeset.newBuilder()
         .setDate(123456789L)
@@ -89,7 +89,7 @@ public class ScmLineReaderTest {
   }
 
   @Test
-  public void set_only_revision() throws Exception {
+  public void set_only_revision() {
     BatchReport.Changesets scmReport = BatchReport.Changesets.newBuilder()
       .addChangeset(BatchReport.Changesets.Changeset.newBuilder()
         .setRevision("rev-1")
@@ -108,7 +108,7 @@ public class ScmLineReaderTest {
   }
 
   @Test
-  public void fail_when_changeset_is_empty() throws Exception {
+  public void fail_when_changeset_is_empty() {
     BatchReport.Changesets scmReport = BatchReport.Changesets.newBuilder()
       .addChangeset(BatchReport.Changesets.Changeset.newBuilder()
         .build())
index 74030b083faab609f98ee172bc5212201b0119aa..dac7d1347c3220fdcb6b4aca738250385bfc3cf4 100644 (file)
@@ -39,7 +39,7 @@ public class SymbolsLineReaderTest {
   FileSourceDb.Line.Builder line4 = sourceData.addLinesBuilder().setSource("line4").setLine(4);
 
   @Test
-  public void read_nothing() throws Exception {
+  public void read_nothing() {
     SymbolsLineReader symbolsLineReader = new SymbolsLineReader(Collections.<BatchReport.Symbols.Symbol>emptyList());
 
     symbolsLineReader.read(line1);
@@ -48,7 +48,7 @@ public class SymbolsLineReaderTest {
   }
 
   @Test
-  public void read_symbols() throws Exception {
+  public void read_symbols() {
     List<BatchReport.Symbols.Symbol> symbols = newArrayList(
       BatchReport.Symbols.Symbol.newBuilder()
         .setDeclaration(BatchReport.Range.newBuilder()
@@ -71,7 +71,7 @@ public class SymbolsLineReaderTest {
   }
 
   @Test
-  public void read_symbols_with_reference_on_same_line() throws Exception {
+  public void read_symbols_with_reference_on_same_line() {
     List<BatchReport.Symbols.Symbol> symbols = newArrayList(
       BatchReport.Symbols.Symbol.newBuilder()
         .setDeclaration(BatchReport.Range.newBuilder()
@@ -90,7 +90,7 @@ public class SymbolsLineReaderTest {
   }
 
   @Test
-  public void read_symbols_with_two_references() throws Exception {
+  public void read_symbols_with_two_references() {
     List<BatchReport.Symbols.Symbol> symbols = newArrayList(
       BatchReport.Symbols.Symbol.newBuilder()
         .setDeclaration(BatchReport.Range.newBuilder()
@@ -116,7 +116,7 @@ public class SymbolsLineReaderTest {
   }
 
   @Test
-  public void read_symbols_with_two_references_on_the_same_line() throws Exception {
+  public void read_symbols_with_two_references_on_the_same_line() {
     List<BatchReport.Symbols.Symbol> symbols = newArrayList(
       BatchReport.Symbols.Symbol.newBuilder()
         .setDeclaration(BatchReport.Range.newBuilder()
@@ -140,7 +140,7 @@ public class SymbolsLineReaderTest {
   }
 
   @Test
-  public void read_symbols_when_reference_line_is_before_declaration_line() throws Exception {
+  public void read_symbols_when_reference_line_is_before_declaration_line() {
     List<BatchReport.Symbols.Symbol> symbols = newArrayList(
       BatchReport.Symbols.Symbol.newBuilder()
         .setDeclaration(BatchReport.Range.newBuilder()
@@ -161,7 +161,7 @@ public class SymbolsLineReaderTest {
   }
 
   @Test
-  public void read_many_symbols_on_lines() throws Exception {
+  public void read_many_symbols_on_lines() {
     List<BatchReport.Symbols.Symbol> symbols = newArrayList(
       BatchReport.Symbols.Symbol.newBuilder()
         .setDeclaration(BatchReport.Range.newBuilder()
@@ -192,7 +192,7 @@ public class SymbolsLineReaderTest {
   }
 
   @Test
-  public void symbol_declaration_should_be_sorted_by_offset() throws Exception {
+  public void symbol_declaration_should_be_sorted_by_offset() {
     List<BatchReport.Symbols.Symbol> symbols = newArrayList(
       BatchReport.Symbols.Symbol.newBuilder()
         .setDeclaration(BatchReport.Range.newBuilder()
@@ -223,7 +223,7 @@ public class SymbolsLineReaderTest {
   }
 
   @Test
-  public void symbol_declaration_should_be_sorted_by_line() throws Exception {
+  public void symbol_declaration_should_be_sorted_by_line() {
     List<BatchReport.Symbols.Symbol> symbols = newArrayList(
       BatchReport.Symbols.Symbol.newBuilder()
         .setDeclaration(BatchReport.Range.newBuilder()
@@ -254,7 +254,7 @@ public class SymbolsLineReaderTest {
   }
 
   @Test
-  public void read_symbols_defined_on_many_lines() throws Exception {
+  public void read_symbols_defined_on_many_lines() {
     List<BatchReport.Symbols.Symbol> symbols = newArrayList(
       BatchReport.Symbols.Symbol.newBuilder()
         .setDeclaration(BatchReport.Range.newBuilder()
@@ -278,7 +278,7 @@ public class SymbolsLineReaderTest {
   }
 
   @Test
-  public void read_symbols_declared_on_a_whole_line() throws Exception {
+  public void read_symbols_declared_on_a_whole_line() {
     List<BatchReport.Symbols.Symbol> symbols = newArrayList(
       BatchReport.Symbols.Symbol.newBuilder()
         .setDeclaration(BatchReport.Range.newBuilder()
index 938a2d49d48237478bb22fd374a85ede34ef9ba6..09a793d56415d1417e9acc695b9235428018f40f 100644 (file)
@@ -32,7 +32,7 @@ public class ApplyPermissionsStepTest extends BaseStepTest {
   ApplyPermissionsStep step = new ApplyPermissionsStep(indexer);
 
   @Test
-  public void index_issue_permissions() throws Exception {
+  public void index_issue_permissions() {
     step.execute(mock(ComputationContext.class));
     verify(indexer).index();
   }
index fa355fc4ea36620d26e280daf51278f3f33dfab7..77dd05aab09198357328cf0adbf1de6287073d69 100644 (file)
@@ -31,10 +31,10 @@ import static org.assertj.core.api.Assertions.assertThat;
  */
 public abstract class BaseStepTest {
 
-  protected abstract ComputationStep step() throws IOException;
+  protected abstract ComputationStep step();
 
   @Test
-  public void test_metadata() throws Exception {
+  public void test_metadata() {
     assertThat(step().toString()).isNotEmpty();
     assertThat(step().getDescription()).isNotEmpty();
     assertThat(step().supportedProjectQualifiers().length).isGreaterThan(0);
index 23c124698a6e9d7f29204a9370b09424f7917d05..280b42f3722412c09f55cd3fa51e0131a8cdb8ef 100644 (file)
@@ -46,7 +46,7 @@ public class ComponentUuidsCacheTest {
   }
 
   @Test
-  public void get_uuid_from_ref() throws Exception {
+  public void get_uuid_from_ref() {
     BatchReportWriter writer = new BatchReportWriter(reportDir);
     writer.writeComponent(BatchReport.Component.newBuilder()
       .setRef(1)
index 5023190cd916298f9a1773bd51c5838ff06c48ab..493e4e153b1a16e8c45966513537f7167972f03a 100644 (file)
@@ -29,7 +29,7 @@ import static org.mockito.Mockito.mock;
 public class ComputationStepsTest {
 
   @Test
-  public void ordered_steps() throws Exception {
+  public void ordered_steps() {
     ComputationSteps registry = new ComputationSteps(
       // unordered
       mock(ApplyPermissionsStep.class),
@@ -60,7 +60,7 @@ public class ComputationStepsTest {
   }
 
   @Test
-  public void fail_if_a_step_is_not_registered_in_picocontainer() throws Exception {
+  public void fail_if_a_step_is_not_registered_in_picocontainer() {
     try {
       new ComputationSteps(mock(ParseReportStep.class));
       fail();
index ccb4223c2a5ad1c2f3f2fd557433319808e71a79..307b6c8e1ca80c1e343fed6896d9d199b6ce25d0 100644 (file)
@@ -36,7 +36,7 @@ public class IndexComponentsStepTest extends BaseStepTest {
   IndexComponentsStep sut = new IndexComponentsStep(resourceIndexerDao);
 
   @Test
-  public void call_indexProject_of_dao() throws IOException {
+  public void call_indexProject_of_dao() {
     ComponentDto project = mock(ComponentDto.class);
     when(project.getId()).thenReturn(123L);
     ComputationContext context = new ComputationContext(mock(BatchReportReader.class), project);
index a49f1fea66840fdab63a9afd2d31e294fd19c060..5388cd90eeadee4fd85b9f540bd2b4ca72ed30b9 100644 (file)
@@ -33,7 +33,7 @@ public class IndexIssuesStepTest {
   IndexIssuesStep sut;
 
   @Test
-  public void call_indexers() throws Exception {
+  public void call_indexers() {
     IssueAuthorizationIndexer authorizationIndexer = mock(IssueAuthorizationIndexer.class);
     IssueIndexer issueIndexer = mock(IssueIndexer.class);
     sut = new IndexIssuesStep(authorizationIndexer, issueIndexer);
index 1c7313091c04269e1a7984a47f0787afb9c67693..59bdc5466629577099e26d95d75e0a17ad539994 100644 (file)
@@ -56,19 +56,19 @@ public class IndexSourceLinesStepTest extends BaseStepTest {
   DbClient dbClient;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new FileSourceDao(null));
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     SourceLineIndexer sourceLineIndexer = new SourceLineIndexer(dbClient, esTester.client());
     sourceLineIndexer.setEnabled(true);
     return new IndexSourceLinesStep(sourceLineIndexer);
   }
 
   @Test
-  public void supported_project_qualifiers() throws Exception {
+  public void supported_project_qualifiers() {
     assertThat(step().supportedProjectQualifiers()).containsOnly(Qualifiers.PROJECT);
   }
 
index 28eb9aeaa177613f37d33306cc6f4dade1498e21..fc7479c8bdba573a8cf3db70e989ed6ca2e4ef06 100644 (file)
@@ -56,19 +56,19 @@ public class IndexTestsStepTest extends BaseStepTest {
   DbClient dbClient;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new FileSourceDao(null));
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     TestIndexer testIndexer = new TestIndexer(dbClient, esTester.client());
     testIndexer.setEnabled(true);
     return new IndexTestsStep(testIndexer);
   }
 
   @Test
-  public void supported_project_qualifiers() throws Exception {
+  public void supported_project_qualifiers() {
     assertThat(step().supportedProjectQualifiers()).containsOnly(Qualifiers.PROJECT);
   }
 
index fc1c913232a804cca59a8268567643c8c02a0f43..d2d8b2b4049f69ba6e49435243924a9bf3982877 100644 (file)
@@ -35,7 +35,7 @@ public class IndexViewsStepTest extends BaseStepTest {
   IndexViewsStep sut = new IndexViewsStep(indexer);
 
   @Test
-  public void index_views() throws Exception {
+  public void index_views() {
     when(context.getProject()).thenReturn(ComponentTesting.newProjectDto("ABCD").setQualifier(Qualifiers.VIEW));
 
     sut.execute(context);
index 3c7492581f21f1bce7246d2b665f05eca767ae04..344aba77dc18cf4fbea479a1d4b9b60d120698f6 100644 (file)
@@ -63,7 +63,7 @@ public class PersistComponentLinksStepTest extends BaseStepTest {
   PersistComponentLinksStep step;
 
   @Before
-  public void setup() throws Exception {
+  public void setup() {
     session = dbTester.myBatis().openSession(false);
     dao = new ComponentLinkDao();
     DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), dao);
@@ -79,17 +79,17 @@ public class PersistComponentLinksStepTest extends BaseStepTest {
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     return step;
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void execute_only_on_projects() throws Exception {
+  public void execute_only_on_projects() {
     assertThat(step.supportedProjectQualifiers()).containsOnly("TRK");
   }
 
index a482a0dd5324d4d4d82412b9718ff6b705f97abc..305ede4d72e227c4834877620dcfc95fe11e7247 100644 (file)
@@ -76,17 +76,17 @@ public class
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     return sut;
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void nothing_to_do_when_no_duplication() throws Exception {
+  public void nothing_to_do_when_no_duplication() {
     saveDuplicationMetric();
     initReportWithProjectAndFile();
 
@@ -96,7 +96,7 @@ public class
   }
 
   @Test
-  public void persist_duplications_on_same_file() throws Exception {
+  public void persist_duplications_on_same_file() {
     MetricDto duplicationMetric = saveDuplicationMetric();
 
     BatchReportWriter writer = initReportWithProjectAndFile();
@@ -182,7 +182,7 @@ public class
   }
 
   @Test
-  public void persist_duplications_on_same_file_linked_on_a_folder() throws Exception {
+  public void persist_duplications_on_same_file_linked_on_a_folder() {
     saveDuplicationMetric();
 
     BatchReportWriter writer = new BatchReportWriter(reportDir);
@@ -236,7 +236,7 @@ public class
   }
 
   @Test
-  public void persist_duplications_on_same_file_linked_on_sub_folder() throws Exception {
+  public void persist_duplications_on_same_file_linked_on_sub_folder() {
     saveDuplicationMetric();
 
     BatchReportWriter writer = new BatchReportWriter(reportDir);
@@ -346,7 +346,7 @@ public class
   }
 
   @Test
-  public void persist_duplications_on_different_files() throws Exception {
+  public void persist_duplications_on_different_files() {
     saveDuplicationMetric();
     BatchReportWriter writer = initReportWithProjectAndFile();
 
@@ -382,7 +382,7 @@ public class
   }
 
   @Test
-  public void persist_duplications_on_different_projects() throws Exception {
+  public void persist_duplications_on_different_projects() {
     saveDuplicationMetric();
     BatchReportWriter writer = initReportWithProjectAndFile();
 
@@ -410,7 +410,7 @@ public class
     assertThat(dto.get("textValue")).isEqualTo("<duplications><g><b s=\"1\" l=\"5\" r=\"PROJECT_KEY:file\"/><b s=\"6\" l=\"5\" r=\"PROJECT2_KEY:file2\"/></g></duplications>");
   }
 
-  private BatchReportWriter initReportWithProjectAndFile() throws IOException {
+  private BatchReportWriter initReportWithProjectAndFile() {
     BatchReportWriter writer = new BatchReportWriter(reportDir);
     writer.writeMetadata(BatchReport.Metadata.newBuilder()
       .setRootComponentRef(1)
index 9482e6557400a3955b23cab5718ab47bc68bcace..35b45d6fce36bf6232005ced32b3da1268db9ca7 100644 (file)
@@ -61,7 +61,7 @@ public class PersistEventsStepTest extends BaseStepTest {
   PersistEventsStep step;
 
   @Before
-  public void setup() throws Exception {
+  public void setup() {
     session = dbTester.myBatis().openSession(false);
     dao = new EventDao();
     DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), dao);
@@ -73,17 +73,17 @@ public class PersistEventsStepTest extends BaseStepTest {
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     return step;
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void execute_only_on_projects() throws Exception {
+  public void execute_only_on_projects() {
     assertThat(step.supportedProjectQualifiers()).containsOnly("TRK");
   }
 
index b22b133334ed0fb49546117d97d62f6d2264502b..0c1cedfbf1beae571c4ced85a10023cde49c6941 100644 (file)
@@ -94,22 +94,22 @@ public class PersistFileDependenciesStepTest extends BaseStepTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     return new PersistFileDependenciesStep(dbClient, system2);
   }
 
   @Test
-  public void supported_project_qualifiers() throws Exception {
+  public void supported_project_qualifiers() {
     assertThat(step().supportedProjectQualifiers()).containsOnly(Qualifiers.PROJECT);
   }
 
   @Test
-  public void persist_file_dependencies() throws Exception {
+  public void persist_file_dependencies() {
     writer.writeComponent(BatchReport.Component.newBuilder()
       .setRef(1)
       .setType(Constants.ComponentType.PROJECT)
@@ -164,7 +164,7 @@ public class PersistFileDependenciesStepTest extends BaseStepTest {
   }
 
   @Test
-  public void nothing_to_persist() throws Exception {
+  public void nothing_to_persist() {
     writer.writeComponent(BatchReport.Component.newBuilder()
       .setRef(1)
       .setType(Constants.ComponentType.PROJECT)
index f39c2511d5112da5a5016ed71d45a101babbd100..d66e24ad04021b97cad9c62f45a0c3a9e6103f2e 100644 (file)
@@ -96,12 +96,12 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     return sut;
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index 717f8a61eda4b3e2e8c11fb03dd874c0892e7bbd..e3b49033a05fe1bdc8ecf8d7ae09c16e30fd5d81 100644 (file)
@@ -63,7 +63,7 @@ public class PersistIssuesStepTest extends BaseStepTest {
   ComputationStep step;
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     return step;
   }
 
@@ -80,12 +80,12 @@ public class PersistIssuesStepTest extends BaseStepTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void insert_new_issue() throws Exception {
+  public void insert_new_issue() {
     dbTester.prepareDbUnit(getClass(), "insert_new_issue.xml");
 
     issueCache.newAppender().append(new DefaultIssue()
@@ -104,7 +104,7 @@ public class PersistIssuesStepTest extends BaseStepTest {
   }
 
   @Test
-  public void close_issue() throws Exception {
+  public void close_issue() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     issueCache.newAppender().append(new DefaultIssue()
@@ -125,7 +125,7 @@ public class PersistIssuesStepTest extends BaseStepTest {
   }
 
   @Test
-  public void add_comment() throws Exception {
+  public void add_comment() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     issueCache.newAppender().append(new DefaultIssue()
@@ -153,7 +153,7 @@ public class PersistIssuesStepTest extends BaseStepTest {
   }
 
   @Test
-  public void add_change() throws Exception {
+  public void add_change() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     issueCache.newAppender().append(new DefaultIssue()
index d51b38deb45b6a512e1394abe71fa7b1728192c4..24b307da440c63ac0a180a9cce79a05d6787ea50 100644 (file)
@@ -67,7 +67,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   private BatchReport.Component component;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbClient = mock(DbClient.class, Mockito.RETURNS_DEEP_STUBS);
     ruleCache = mock(RuleCache.class, Mockito.RETURNS_DEEP_STUBS);
     metricCache = mock(MetricCache.class, Mockito.RETURNS_DEEP_STUBS);
@@ -156,7 +156,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   }
 
   @Test
-  public void map_full_batch_measure() throws Exception {
+  public void map_full_batch_measure() {
     BatchReport.Measure batchMeasure = BatchReport.Measure.newBuilder()
       .setValueType(Constants.MeasureValueType.DOUBLE)
       .setDoubleValue(123.123d)
@@ -181,7 +181,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   }
 
   @Test
-  public void map_minimal_batch_measure() throws Exception {
+  public void map_minimal_batch_measure() {
     BatchReport.Measure batchMeasure = BatchReport.Measure.newBuilder()
       .setValueType(Constants.MeasureValueType.INT)
       .setMetricKey("metric-key")
@@ -193,7 +193,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   }
 
   @Test
-  public void map_boolean_batch_measure() throws Exception {
+  public void map_boolean_batch_measure() {
     BatchReport.Measure batchMeasure = BatchReport.Measure.newBuilder()
       .setValueType(Constants.MeasureValueType.BOOLEAN)
       .setBooleanValue(true)
@@ -225,7 +225,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   }
 
   @Test
-  public void map_double_batch_measure() throws Exception {
+  public void map_double_batch_measure() {
     BatchReport.Measure batchMeasure = BatchReport.Measure.newBuilder()
       .setValueType(Constants.MeasureValueType.DOUBLE)
       .setDoubleValue(3.2)
@@ -247,7 +247,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   }
 
   @Test
-  public void map_int_batch_measure() throws Exception {
+  public void map_int_batch_measure() {
     BatchReport.Measure batchMeasure = BatchReport.Measure.newBuilder()
       .setValueType(Constants.MeasureValueType.INT)
       .setIntValue(3)
@@ -269,7 +269,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   }
 
   @Test
-  public void map_long_batch_measure() throws Exception {
+  public void map_long_batch_measure() {
     BatchReport.Measure batchMeasure = BatchReport.Measure.newBuilder()
       .setValueType(Constants.MeasureValueType.LONG)
       .setLongValue(3L)
@@ -291,7 +291,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   }
 
   @Test(expected = IllegalStateException.class)
-  public void fail_when_no_metric_key() throws Exception {
+  public void fail_when_no_metric_key() {
     BatchReport.Measure measure = BatchReport.Measure.newBuilder()
       .setValueType(MeasureValueType.STRING)
       .setStringValue("string-value")
@@ -302,7 +302,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   }
 
   @Test(expected = IllegalStateException.class)
-  public void fail_when_no_value() throws Exception {
+  public void fail_when_no_value() {
     BatchReport.Measure measure = BatchReport.Measure.newBuilder()
       .setMetricKey("repo:metric-key")
       .build();
@@ -312,7 +312,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   }
 
   @Test(expected = IllegalStateException.class)
-  public void fail_when_forbid_metric() throws Exception {
+  public void fail_when_forbid_metric() {
     BatchReport.Measure measure = BatchReport.Measure.newBuilder()
       .setMetricKey("duplications_data")
       .build();
@@ -349,7 +349,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     return sut;
   }
 }
index b65582c80a9762212266dc4447cd323944f763f1..c28c22fbc8d3ef674becc04e8c21020ca80e62b3 100644 (file)
@@ -75,12 +75,12 @@ public class PersistNumberOfDaysSinceLastCommitStepTest extends BaseStepTest {
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     return sut;
   }
 
   @Test
-  public void persist_number_of_days_since_last_commit_from_report() throws Exception {
+  public void persist_number_of_days_since_last_commit_from_report() {
     long threeDaysAgo = DateUtils.addDays(new Date(), -3).getTime();
     BatchReportWriter reportWriter = initReportWithProjectAndFile();
     reportWriter.writeComponentChangesets(
@@ -100,7 +100,7 @@ public class PersistNumberOfDaysSinceLastCommitStepTest extends BaseStepTest {
   }
 
   @Test
-  public void persist_number_of_days_since_last_commit_from_index() throws Exception {
+  public void persist_number_of_days_since_last_commit_from_index() {
     Date sixDaysAgo = DateUtils.addDays(new Date(), -6);
     when(sourceLineIndex.lastCommitDateOnProject("project-uuid")).thenReturn(sixDaysAgo);
     initReportWithProjectAndFile();
@@ -112,7 +112,7 @@ public class PersistNumberOfDaysSinceLastCommitStepTest extends BaseStepTest {
   }
 
   @Test
-  public void no_scm_information_in_report_and_index() throws Exception {
+  public void no_scm_information_in_report_and_index() {
     initReportWithProjectAndFile();
     ComputationContext context = new ComputationContext(new BatchReportReader(dir), ComponentTesting.newProjectDto("project-uuid"));
 
@@ -121,7 +121,7 @@ public class PersistNumberOfDaysSinceLastCommitStepTest extends BaseStepTest {
     db.assertDbUnit(getClass(), "empty.xml");
   }
 
-  private BatchReportWriter initReportWithProjectAndFile() throws IOException {
+  private BatchReportWriter initReportWithProjectAndFile() {
     BatchReportWriter writer = new BatchReportWriter(dir);
     writer.writeMetadata(BatchReport.Metadata.newBuilder()
       .setRootComponentRef(1)
index 8884d6476ea7dc8951d19aa1a9fcb45e67b7704b..9b724a5236efe4bf133b9cf908c3fb457e93cad0 100644 (file)
@@ -100,18 +100,18 @@ public class PersistTestsStepTest extends BaseStepTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     MyBatis.closeQuietly(session);
 
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     return sut;
   }
 
   @Test
-  public void no_test_in_database_and_batch_report() throws Exception {
+  public void no_test_in_database_and_batch_report() {
     sut.execute(new ComputationContext(new BatchReportReader(reportDir), newProjectDto()));
 
     assertThat(dbClient.fileSourceDao().selectTest(TEST_FILE_UUID_1)).isNull();
@@ -119,7 +119,7 @@ public class PersistTestsStepTest extends BaseStepTest {
   }
 
   @Test
-  public void insert_several_tests_in_a_report() throws Exception {
+  public void insert_several_tests_in_a_report() {
     BatchReportWriter writer = new BatchReportWriter(reportDir);
     List<BatchReport.Test> batchTests = Arrays.asList(
       newTest(1), newTest(2)
@@ -147,7 +147,7 @@ public class PersistTestsStepTest extends BaseStepTest {
   }
 
   @Test
-  public void insert_all_data_of_a_test() throws Exception {
+  public void insert_all_data_of_a_test() {
     BatchReportWriter writer = new BatchReportWriter(reportDir);
     writer.writeTests(TEST_FILE_REF_1, Arrays.asList(newTest(1)));
     writer.writeCoverageDetails(TEST_FILE_REF_1, Arrays.asList(newCoverageDetail(1, MAIN_FILE_REF_1)));
@@ -174,7 +174,7 @@ public class PersistTestsStepTest extends BaseStepTest {
   }
 
   @Test
-  public void insert_tests_without_coverage_details() throws Exception {
+  public void insert_tests_without_coverage_details() {
     BatchReportWriter writer = new BatchReportWriter(reportDir);
     List<BatchReport.Test> batchTests = Arrays.asList(newTest(1));
     writer.writeTests(TEST_FILE_REF_1, batchTests);
@@ -190,7 +190,7 @@ public class PersistTestsStepTest extends BaseStepTest {
   }
 
   @Test
-  public void insert_coverage_details_not_taken_into_account() throws Exception {
+  public void insert_coverage_details_not_taken_into_account() {
     BatchReportWriter writer = new BatchReportWriter(reportDir);
     List<BatchReport.Test> batchTests = Arrays.asList(newTest(1));
     writer.writeTests(TEST_FILE_REF_1, batchTests);
@@ -209,7 +209,7 @@ public class PersistTestsStepTest extends BaseStepTest {
   }
 
   @Test
-  public void aggregate_coverage_details() throws Exception {
+  public void aggregate_coverage_details() {
     BatchReportWriter writer = new BatchReportWriter(reportDir);
     writer.writeTests(TEST_FILE_REF_1, Arrays.asList(newTest(1)));
     writer.writeCoverageDetails(TEST_FILE_REF_1, Arrays.asList(
@@ -224,7 +224,7 @@ public class PersistTestsStepTest extends BaseStepTest {
   }
 
   @Test
-  public void update_existing_test() throws Exception {
+  public void update_existing_test() {
     // ARRANGE
     dbClient.fileSourceDao().insert(session, new FileSourceDto()
       .setProjectUuid(PROJECT_UUID)
@@ -295,7 +295,7 @@ public class PersistTestsStepTest extends BaseStepTest {
       .build();
   }
 
-  private BatchReportWriter initBasicReport() throws IOException {
+  private BatchReportWriter initBasicReport() {
     BatchReportWriter writer = new BatchReportWriter(reportDir);
     writer.writeMetadata(BatchReport.Metadata.newBuilder()
       .setRootComponentRef(1)
index a2588058de4660738d4adb23ad79398b2de8410b..6130d31a06db72084d411a2cb31fc5a31fb3a3d4 100644 (file)
@@ -47,7 +47,7 @@ public class PurgeDatastoresStepTest extends BaseStepTest {
   public TemporaryFolder temp = new TemporaryFolder();
 
   @Test
-  public void call_purge_method_of_the_purge_task() throws IOException {
+  public void call_purge_method_of_the_purge_task() {
     ComponentDto project = mock(ComponentDto.class);
     when(project.getId()).thenReturn(123L);
     when(project.uuid()).thenReturn("UUID-1234");
index 86fce27ddb21959f084fe7ff2194f4ad085b9b9f..a8ebac72f819c217ca8dd5c5889385e156fe0d96 100644 (file)
@@ -90,7 +90,7 @@ public class PurgeRemovedViewsStepTest extends BaseStepTest {
   }
 
   @Test
-  public void only_support_views() throws Exception {
+  public void only_support_views() {
     assertThat(sut.supportedProjectQualifiers()).containsOnly(Qualifiers.VIEW);
   }
 
index 3742441d5b26a909cb4675ed95d16aa80fd41a62..f9bb05e8ec0bb13cc48e218861fb5eb95c4e3495 100644 (file)
@@ -61,7 +61,7 @@ public class SendIssueNotificationsStepTest extends BaseStepTest {
   }
 
   @Test
-  public void do_not_send_notifications_if_no_subscribers() throws Exception {
+  public void do_not_send_notifications_if_no_subscribers() {
     when(context.getProject().uuid()).thenReturn("PROJECT_UUID");
     when(notifService.hasProjectSubscribersForTypes("PROJECT_UUID", SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(false);
 
@@ -71,7 +71,7 @@ public class SendIssueNotificationsStepTest extends BaseStepTest {
   }
 
   @Test
-  public void send_notifications_if_subscribers() throws Exception {
+  public void send_notifications_if_subscribers() {
     issueCache.newAppender().append(new DefaultIssue()
         .setSeverity(Severity.BLOCKER)).close();
 
@@ -86,7 +86,7 @@ public class SendIssueNotificationsStepTest extends BaseStepTest {
   }
 
   @Override
-  protected ComputationStep step() throws IOException {
+  protected ComputationStep step() {
     return sut;
   }
 }
index cc4dfa9be6bb3a2abd61aac51a9f196bd6bae035..49b444e255dc34651038c48b1bd0af4c74ac090b 100644 (file)
@@ -55,7 +55,7 @@ public class SwitchSnapshotStepTest {
   }
 
   @Test
-  public void one_switch_with_a_snapshot_and_his_children() throws IOException {
+  public void one_switch_with_a_snapshot_and_his_children() {
     db.prepareDbUnit(getClass(), "snapshots.xml");
 
     BatchReport.Metadata metadata = BatchReport.Metadata.newBuilder()
index 02b436940f0d94cf3d1691c149328ea463ade0e1..309a3c1ddf3ab65216e5a9a7757ce0ab5f7bb8f1 100644 (file)
@@ -30,7 +30,7 @@ import static org.mockito.Mockito.mock;
 public class ComputationWebServiceTest {
 
   @Test
-  public void define() throws Exception {
+  public void define() {
     ComputationWebService ws = new ComputationWebService(new ComputationWsAction() {
       @Override
       public void define(WebService.NewController controller) {
index d04c2c21cf711e5099d7f6ecb221d98580774685..db73d970b688305968fffc5bcf5b946542384977 100644 (file)
@@ -46,7 +46,7 @@ public class HistoryWsActionMediumTest {
   ActivityService activityService;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     sut = tester.get(HistoryWsAction.class);
     activityService = tester.get(ActivityService.class);
index 2be42fa311150b824f5b3b66440c87546fd615c3..1fe9fcce85794d0b15d54db8081ae9d37c7ce78f 100644 (file)
@@ -43,7 +43,7 @@ public class IsQueueEmptyWebServiceTest {
   Response response;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     queue = mock(ReportQueue.class);
     sut = new IsQueueEmptyWebService.IsQueueEmptyWsAction(queue);
 
index ebf3bf043f4d7aafa6f471b559bcb2ccec91725d..4183ce8e5256936001cdee5d571f923902a995ac 100644 (file)
@@ -41,7 +41,7 @@ public class QueueWsActionTest {
   private ReportQueue queue;
 
   @Before
-  public void setup() throws Exception {
+  public void setup() {
     queue = mock(ReportQueue.class);
     tester = new WsTester(new ComputationWebService(new QueueWsAction(queue)));
   }
@@ -64,7 +64,7 @@ public class QueueWsActionTest {
   }
 
   @Test
-  public void define() throws Exception {
+  public void define() {
     assertThat(tester.controller(ComputationWebService.API_ENDPOINT).action("queue")).isNotNull();
   }
 }
index e88d651d59148b7fcf10ffbe03f1351c9b076d8c..fe16f557961c75ed960a1adbeafd47c5162da982 100644 (file)
@@ -50,7 +50,7 @@ public class SubmitReportWsActionTest {
   }
 
   @Test
-  public void define_metadata() throws Exception {
+  public void define_metadata() {
     WebService.Context context = new WebService.Context();
     WebService.NewController controller = context.createController("api/computation");
     sut.define(controller);
index 3cec6c83eb54d86adcc63a7a20b7163b90595d42..6a45d64d0369b80465127f0cb5120d255d8f391a 100644 (file)
@@ -31,7 +31,7 @@ public class PropertiesWsTest {
   WsTester tester = new WsTester(new PropertiesWs());
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WebService.Controller controller = tester.controller("api/properties");
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
index baea10daf8931510787530c730570c829fc5a5d0..65af6e084cb9d99389ce8dfe96a9e40d52d23a67 100644 (file)
@@ -45,7 +45,7 @@ public class WidgetDaoTest {
   private DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dao = new WidgetDao(dbTester.myBatis());
     session = dbTester.myBatis().openSession(false);
   }
@@ -56,7 +56,7 @@ public class WidgetDaoTest {
   }
 
   @Test
-  public void should_select_all() throws Exception {
+  public void should_select_all() {
     dbTester.prepareDbUnit(this.getClass(), "before.xml");
     session.commit();
 
index 2d825b1a42343c40fde16ed05e7de61ee06e637e..d2d4826b37d941343296ec3cf99f6e8f72e67175 100644 (file)
@@ -59,7 +59,7 @@ public class BaseDaoTest {
   }
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     this.session = db.myBatis().openSession(false);
     this.dao = new FakeDao(System2.INSTANCE);
   }
@@ -78,7 +78,7 @@ public class BaseDaoTest {
   }
 
   @Test
-  public void can_insert_and_select_by_key() throws Exception {
+  public void can_insert_and_select_by_key() {
     long t0 = System.currentTimeMillis() - 1000;
 
     String key = Uuids.create();
@@ -108,7 +108,7 @@ public class BaseDaoTest {
   }
 
   @Test
-  public void synchronize_to_es_after_date() throws Exception {
+  public void synchronize_to_es_after_date() {
     long t0 = System.currentTimeMillis() - 1000;
 
     String key = Uuids.create();
index 3ef5c7281fefac10863446cd85113a47be6e5b06..c2d769a524aae919bff5481f0f46a7bd36ae8698 100644 (file)
@@ -31,7 +31,7 @@ public class EmbeddedDatabaseFactoryTest {
   Settings settings = new Settings();
 
   @Test
-  public void should_start_and_stop_tcp_h2_database() throws Exception {
+  public void should_start_and_stop_tcp_h2_database() {
     settings.setProperty(DatabaseProperties.PROP_URL, "jdbc:h2:tcp:localhost");
 
     final EmbeddedDatabase embeddedDatabase = mock(EmbeddedDatabase.class);
@@ -50,7 +50,7 @@ public class EmbeddedDatabaseFactoryTest {
   }
 
   @Test
-  public void should_not_start_mem_h2_database() throws Exception {
+  public void should_not_start_mem_h2_database() {
     settings.setProperty(DatabaseProperties.PROP_URL, "jdbc:h2:mem");
 
     final EmbeddedDatabase embeddedDatabase = mock(EmbeddedDatabase.class);
index 954f480dadd2827449faa3b25a0dc49c670c19d3..7ae85ef8a392fc66fcaf735960086edbb615a627 100644 (file)
@@ -41,7 +41,7 @@ public class EmbeddedDatabaseTest {
   public ExpectedException throwable = ExpectedException.none();
 
   @Test(timeout = 5000)
-  public void should_start_and_stop() throws IOException {
+  public void should_start_and_stop() {
     int port = NetworkUtils.freePort();
 
     EmbeddedDatabase database = new EmbeddedDatabase(testSettings(port));
@@ -59,7 +59,7 @@ public class EmbeddedDatabaseTest {
   }
 
   @Test
-  public void should_return_embedded_data_directory() throws Exception {
+  public void should_return_embedded_data_directory() {
     Settings settings = testSettings(0);
     EmbeddedDatabase database = new EmbeddedDatabase(settings);
 
index df297adf618b0f387c9dda6b4ef8f675284c807b..e4380a7e28c9cb0bde7f5d479f3441a7cea1b83a 100644 (file)
@@ -51,7 +51,7 @@ public class ResultSetIteratorTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     DbUtils.closeQuietly(connection);
   }
 
index f5e2d4516fdd45fd5cdb95f8d9de6a89416a2de9..ba94a71598bddecd0cfc548776573bec684b2cb9 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown;
 public class AddColumnsBuilderTest {
 
   @Test
-  public void add_columns_on_h2() throws Exception {
+  public void add_columns_on_h2() {
     assertThat(new AddColumnsBuilder(new H2(), "issues")
       .addColumn(new AddColumnsBuilder.ColumnDef()
         .setName("date_in_ms")
@@ -43,7 +43,7 @@ public class AddColumnsBuilderTest {
   }
 
   @Test
-  public void add_columns_on_mysql() throws Exception {
+  public void add_columns_on_mysql() {
     assertThat(new AddColumnsBuilder(new MySql(), "issues")
       .addColumn(new AddColumnsBuilder.ColumnDef()
         .setName("date_in_ms")
@@ -58,7 +58,7 @@ public class AddColumnsBuilderTest {
   }
 
   @Test
-  public void add_columns_on_oracle() throws Exception {
+  public void add_columns_on_oracle() {
     assertThat(new AddColumnsBuilder(new Oracle(), "issues")
       .addColumn(new AddColumnsBuilder.ColumnDef()
         .setName("date_in_ms")
@@ -73,7 +73,7 @@ public class AddColumnsBuilderTest {
   }
 
   @Test
-  public void add_columns_on_postgresql() throws Exception {
+  public void add_columns_on_postgresql() {
     assertThat(new AddColumnsBuilder(new PostgreSql(), "issues")
       .addColumn(new AddColumnsBuilder.ColumnDef()
         .setName("date_in_ms")
@@ -88,7 +88,7 @@ public class AddColumnsBuilderTest {
   }
 
   @Test
-  public void add_columns_on_mssql() throws Exception {
+  public void add_columns_on_mssql() {
     assertThat(new AddColumnsBuilder(new MsSql(), "issues")
       .addColumn(new AddColumnsBuilder.ColumnDef()
         .setName("date_in_ms")
@@ -103,7 +103,7 @@ public class AddColumnsBuilderTest {
   }
 
   @Test
-  public void fail_when_column_name_is_in_upper_case() throws Exception {
+  public void fail_when_column_name_is_in_upper_case() {
     try {
       new AddColumnsBuilder.ColumnDef()
         .setName("DATE_IN_MS")
@@ -116,7 +116,7 @@ public class AddColumnsBuilderTest {
   }
 
   @Test
-  public void fail_when_column_name_contains_invalid_character() throws Exception {
+  public void fail_when_column_name_contains_invalid_character() {
     try {
       new AddColumnsBuilder.ColumnDef()
         .setName("date-in/ms")
index 1c975a4f7e5e1db89d48ec2c1263ff0a8a2ba3c8..339a8b6672d8f71abb67a04c751c8fc99daf5254 100644 (file)
@@ -50,7 +50,7 @@ public class BaseDataChangeTest extends AbstractDaoTestCase {
   public ExpectedException thrown = ExpectedException.none();
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table persons");
   }
 
index 20ca936aefc41836edd7d08c615ef701c419ccdc..877455432af56443209dbbf1ff79d3c0bbf56aa5 100644 (file)
@@ -52,12 +52,12 @@ public class DatabaseMigratorTest extends AbstractDaoTestCase {
   DatabaseMigrator migrator;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     migrator = new DatabaseMigrator(dbClient, migrations, serverUpgradeStatus, null);
   }
 
   @Test
-  public void should_support_only_creation_of_h2_database() throws Exception {
+  public void should_support_only_creation_of_h2_database() {
     when(dbClient.database().getDialect()).thenReturn(new MySql());
 
     assertThat(migrator.createDatabase()).isFalse();
@@ -65,7 +65,7 @@ public class DatabaseMigratorTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void fail_if_execute_unknown_migration() throws Exception {
+  public void fail_if_execute_unknown_migration() {
     thrown.expect(IllegalArgumentException.class);
     thrown.expectMessage("Database migration not found: org.xxx.UnknownMigration");
 
@@ -73,14 +73,14 @@ public class DatabaseMigratorTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void execute_migration() throws Exception {
+  public void execute_migration() {
     assertThat(FakeMigrationStep.executed).isFalse();
     migrator.executeMigration(FakeMigrationStep.class.getName());
     assertThat(FakeMigrationStep.executed).isTrue();
   }
 
   @Test
-  public void should_create_schema_on_h2() throws Exception {
+  public void should_create_schema_on_h2() {
     Dialect supportedDialect = new H2();
     when(dbClient.database().getDialect()).thenReturn(supportedDialect);
     Connection connection = mock(Connection.class);
index 316718d716cd3df9245e0adb1904c2634ef4b301..6c1e67945b8717c1a6c7bac3f018343b927d2ccd 100644 (file)
@@ -27,31 +27,31 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class DropColumnsBuilderTest {
 
   @Test
-  public void drop_columns_on_mysql() throws Exception {
+  public void drop_columns_on_mysql() {
     assertThat(new DropColumnsBuilder(new MySql(), "issues", "date_in_ms", "name")
       .build()).isEqualTo("ALTER TABLE issues DROP COLUMN date_in_ms, DROP COLUMN name");
   }
 
   @Test
-  public void drop_columns_on_oracle() throws Exception {
+  public void drop_columns_on_oracle() {
     assertThat(new DropColumnsBuilder(new Oracle(), "issues", "date_in_ms", "name")
       .build()).isEqualTo("ALTER TABLE issues DROP (date_in_ms, name)");
   }
 
   @Test
-  public void drop_columns_on_postgresql() throws Exception {
+  public void drop_columns_on_postgresql() {
     assertThat(new DropColumnsBuilder(new PostgreSql(), "issues", "date_in_ms", "name")
       .build()).isEqualTo("ALTER TABLE issues DROP COLUMN date_in_ms, DROP COLUMN name");
   }
 
   @Test
-  public void drop_columns_on_mssql() throws Exception {
+  public void drop_columns_on_mssql() {
     assertThat(new DropColumnsBuilder(new MsSql(), "issues", "date_in_ms", "name")
       .build()).isEqualTo("ALTER TABLE issues DROP COLUMN date_in_ms, name");
   }
 
   @Test(expected = IllegalStateException.class)
-  public void fail_to_drop_columns_on_h2() throws Exception {
+  public void fail_to_drop_columns_on_h2() {
     new DropColumnsBuilder(new H2(), "issues", "date_in_ms", "name")
       .build();
   }
index ca1955c43ea820d7347e6ea7836e13e5876d41b7..75ab0635c8fc5c39f9946aedaf5cdd4a56bf1696 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class MigrationStepsTest {
 
   @Test
-  public void check_number_of_migrations() throws Exception {
+  public void check_number_of_migrations() {
     assertThat(MigrationSteps.CLASSES).isNotEmpty();
   }
 }
index b4b9c767484c496e1888f4cd9809688d3f200e4b..4c1c0914dc01611a5ea8ab0599b6bf7dad033650 100644 (file)
@@ -78,7 +78,7 @@ public class PlatformDatabaseMigrationConcurrentAccessTest {
   private PlatformDatabaseMigration underTest = new PlatformDatabaseMigration(rubyBridge, executorService, platform);
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     pool.shutdownNow();
   }
 
index 2d98d836989172cae086939a9f689a3d107514f8..42a77b8ffc211a0fa36669122ef6735ff512a39c 100644 (file)
@@ -58,22 +58,22 @@ public class PlatformDatabaseMigrationTest {
   private PlatformDatabaseMigration underTest = new PlatformDatabaseMigration(rubyBridge, executorService, platform);
 
   @Test
-  public void status_is_NONE_when_component_is_created() throws Exception {
+  public void status_is_NONE_when_component_is_created() {
     assertThat(underTest.status()).isEqualTo(DatabaseMigration.Status.NONE);
   }
 
   @Test
-  public void startedAt_is_null_when_component_is_created() throws Exception {
+  public void startedAt_is_null_when_component_is_created() {
     assertThat(underTest.startedAt()).isNull();
   }
 
   @Test
-  public void failureError_is_null_when_component_is_created() throws Exception {
+  public void failureError_is_null_when_component_is_created() {
     assertThat(underTest.failureError()).isNull();
   }
 
   @Test
-  public void startit_calls_databasemigration_trigger_in_a_separate_thread() throws Exception {
+  public void startit_calls_databasemigration_trigger_in_a_separate_thread() {
     when(rubyBridge.databaseMigration()).thenReturn(rubyDatabaseMigration);
     when(rubyBridge.railsRoutes()).thenReturn(rubyRailsRoutes);
 
@@ -88,7 +88,7 @@ public class PlatformDatabaseMigrationTest {
   }
 
   @Test
-  public void status_is_SUCCEEDED_and_failure_is_null_when_trigger_runs_without_an_exception() throws Exception {
+  public void status_is_SUCCEEDED_and_failure_is_null_when_trigger_runs_without_an_exception() {
     when(rubyBridge.databaseMigration()).thenReturn(rubyDatabaseMigration);
     when(rubyBridge.railsRoutes()).thenReturn(rubyRailsRoutes);
 
@@ -100,7 +100,7 @@ public class PlatformDatabaseMigrationTest {
   }
 
   @Test
-  public void status_is_FAILED_and_failure_stores_the_exception_when_trigger_throws_an_exception() throws Exception {
+  public void status_is_FAILED_and_failure_stores_the_exception_when_trigger_throws_an_exception() {
     mockTriggerThrowsError();
 
     underTest.startIt();
@@ -111,7 +111,7 @@ public class PlatformDatabaseMigrationTest {
   }
 
   @Test
-  public void successive_calls_to_startIt_reset_status_startedAt_and_failureError() throws Exception {
+  public void successive_calls_to_startIt_reset_status_startedAt_and_failureError() {
     mockTriggerThrowsError();
 
     underTest.startIt();
index 4ce1d029507a2a1c1d56976cdf51210bcf67dc7e..4574dc06b22641a2f2011e7404df07d3358ba438 100644 (file)
@@ -28,7 +28,7 @@ import static org.mockito.Mockito.*;
 
 public class ProgressTest {
   @Test
-  public void log_progress() throws Exception {
+  public void log_progress() {
     Logger logger = mock(Logger.class);
     ArgumentCaptor<String> argument = ArgumentCaptor.forClass(String.class);
 
@@ -47,7 +47,7 @@ public class ProgressTest {
   }
 
   @Test
-  public void log_remaining_time() throws Exception {
+  public void log_remaining_time() {
     Logger logger = mock(Logger.class);
     ArgumentCaptor<String> argument = ArgumentCaptor.forClass(String.class);
 
index 99fa0dde46fa8c6a5b328533777d55e0e8f4a16c..5120255a1f477e9d041375bb678ed14bc52f2782 100644 (file)
@@ -36,19 +36,19 @@ import static org.mockito.Mockito.when;
 public class ViolationConvertersTest {
 
   @Test
-  public void default_number_of_threads() throws Exception {
+  public void default_number_of_threads() {
     assertThat(new ViolationConverters(new Settings()).numberOfThreads()).isEqualTo(ViolationConverters.DEFAULT_THREADS);
   }
 
   @Test
-  public void configure_number_of_threads() throws Exception {
+  public void configure_number_of_threads() {
     Settings settings = new Settings();
     settings.setProperty(ViolationConverters.THREADS_PROPERTY, 2);
     assertThat(new ViolationConverters(settings).numberOfThreads()).isEqualTo(2);
   }
 
   @Test
-  public void number_of_threads_should_not_be_negative() throws Exception {
+  public void number_of_threads_should_not_be_negative() {
     try {
       Settings settings = new Settings();
       settings.setProperty(ViolationConverters.THREADS_PROPERTY, -2);
index debda9a7f17ef51b5d68e6f2638a2d8098522f1c..869dff59537e44f4457dd3a1f7e149fd5b5134f9 100644 (file)
@@ -32,7 +32,7 @@ public class ViolationMigrationTest {
   public static DbTester db = new DbTester().schema(ViolationMigrationTest.class, "schema.sql");
 
   @Test
-  public void migrate_violations() throws Exception {
+  public void migrate_violations() {
     db.prepareDbUnit(getClass(), "migrate_violations.xml");
 
     new ViolationMigrationStep(db.database(), new Settings()).execute();
@@ -42,7 +42,7 @@ public class ViolationMigrationTest {
   }
 
   @Test
-  public void no_violations_to_migrate() throws Exception {
+  public void no_violations_to_migrate() {
     db.prepareDbUnit(getClass(), "no_violations_to_migrate.xml");
 
     new ViolationMigrationStep(db.database(), new Settings()).execute();
index 9ec7e533efca181cb6db7057f6d7d38b1129df41..fed7264f748c83d853246548a27a0e9966c4e458 100644 (file)
@@ -53,7 +53,7 @@ public class ConvertIssueDebtToMinutesMigrationStepTest {
   ConvertIssueDebtToMinutesMigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(system2.now()).thenReturn(DateUtils.parseDateTime("2014-02-19T19:10:03+0100").getTime());
     when(propertiesDao.selectGlobalProperty(WorkDurationConvertor.HOURS_IN_DAY_PROPERTY)).thenReturn(new PropertyDto().setValue("8"));
 
index f92e48eb2cf18035eac39aa8e2ce68fbcc92c1a5..60e7bb11af52c971897818fa0ae7abbab0d4c526 100644 (file)
@@ -44,7 +44,7 @@ public class DevelopmentCostMeasuresMigrationStepTest {
   DevelopmentCostMeasuresMigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(propertiesDao.selectGlobalProperty(WorkDurationConvertor.HOURS_IN_DAY_PROPERTY)).thenReturn(new PropertyDto().setValue("8"));
 
     migration = new DevelopmentCostMeasuresMigrationStep(db.database(), propertiesDao);
index 1f8e3e2b45184fc04721bbf22e9da4cf0f401307..de38b9eb7e58da6990beae5afe5255386d509cda 100644 (file)
@@ -50,7 +50,7 @@ public class IssueChangelogMigrationStepTest {
   IssueChangelogMigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(system2.now()).thenReturn(DateUtils.parseDateTime("2014-02-19T19:10:03+0100").getTime());
     when(propertiesDao.selectGlobalProperty(WorkDurationConvertor.HOURS_IN_DAY_PROPERTY)).thenReturn(new PropertyDto().setValue("8"));
 
@@ -69,7 +69,7 @@ public class IssueChangelogMigrationStepTest {
   }
 
   @Test
-  public void convert_data_containing_only_debt_change() throws Exception {
+  public void convert_data_containing_only_debt_change() {
     assertThat(migration.convertChangelog("technicalDebt=1|2")).isEqualTo("technicalDebt=1|2");
     assertThat(migration.convertChangelog("technicalDebt=100|200")).isEqualTo("technicalDebt=60|120");
     assertThat(migration.convertChangelog("technicalDebt=10000|20000")).isEqualTo("technicalDebt=480|960");
@@ -79,21 +79,21 @@ public class IssueChangelogMigrationStepTest {
   }
 
   @Test
-  public void convert_data_beginning_with_debt_change() throws Exception {
+  public void convert_data_beginning_with_debt_change() {
     assertThat(migration.convertChangelog("technicalDebt=100|200,status=RESOLVED|REOPENED")).isEqualTo("technicalDebt=60|120,status=RESOLVED|REOPENED");
     assertThat(migration.convertChangelog("technicalDebt=|200,status=RESOLVED|REOPENED")).isEqualTo("technicalDebt=|120,status=RESOLVED|REOPENED");
     assertThat(migration.convertChangelog("technicalDebt=100|,status=RESOLVED|REOPENED")).isEqualTo("technicalDebt=60|,status=RESOLVED|REOPENED");
   }
 
   @Test
-  public void convert_data_finishing_with_debt_change() throws Exception {
+  public void convert_data_finishing_with_debt_change() {
     assertThat(migration.convertChangelog("status=RESOLVED|REOPENED,technicalDebt=100|200")).isEqualTo("status=RESOLVED|REOPENED,technicalDebt=60|120");
     assertThat(migration.convertChangelog("status=RESOLVED|REOPENED,technicalDebt=|200")).isEqualTo("status=RESOLVED|REOPENED,technicalDebt=|120");
     assertThat(migration.convertChangelog("status=RESOLVED|REOPENED,technicalDebt=100|")).isEqualTo("status=RESOLVED|REOPENED,technicalDebt=60|");
   }
 
   @Test
-  public void convert_data_with_debt_change_in_the_middle() throws Exception {
+  public void convert_data_with_debt_change_in_the_middle() {
     assertThat(migration.convertChangelog("status=RESOLVED|REOPENED,technicalDebt=100|200,resolution=")).isEqualTo("status=RESOLVED|REOPENED,technicalDebt=60|120,resolution=");
     assertThat(migration.convertChangelog("status=RESOLVED|REOPENED,technicalDebt=|200,resolution=")).isEqualTo("status=RESOLVED|REOPENED,technicalDebt=|120,resolution=");
     assertThat(migration.convertChangelog("status=RESOLVED|REOPENED,technicalDebt=100|,resolution=")).isEqualTo("status=RESOLVED|REOPENED,technicalDebt=60|,resolution=");
index bc8b1f0f5f4c6bc3329499d38b27368eb01dd862..8a47e64b282ef9c707f5a778946620605f540efa 100644 (file)
@@ -44,7 +44,7 @@ public class NotResolvedIssuesOnRemovedComponentsMigrationStepTest {
   NotResolvedIssuesOnRemovedComponentsMigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(system2.now()).thenReturn(DateUtils.parseDate("2014-04-09").getTime());
 
     migration = new NotResolvedIssuesOnRemovedComponentsMigrationStep(db.database(), system2);
index 2ab4f606e943c5d9b91d395454848e6d8d7a0169..c1d7f9932af68a1a7813c5cfb5bb8041b93495c4 100644 (file)
@@ -33,7 +33,7 @@ public class RequirementMeasuresMigrationStepTest {
   RequirementMeasuresMigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     migration = new RequirementMeasuresMigrationStep(db.database());
   }
 
index bb83cac65f3cedccec46483ed643cb3fccf0ce33..1adb672c4a00eb1016d4ec2d2862e4bcdb170304 100644 (file)
@@ -44,7 +44,7 @@ public class TechnicalDebtMeasuresMigrationStepTest {
   TechnicalDebtMeasuresMigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(propertiesDao.selectGlobalProperty(WorkDurationConvertor.HOURS_IN_DAY_PROPERTY)).thenReturn(new PropertyDto().setValue("8"));
 
     migration = new TechnicalDebtMeasuresMigrationStep(db.database(), propertiesDao);
index d1dbd9a48f57039f37cfb92d963da42f3a4c9c3b..5dcb16bfdf4b0f1a01449b09d495600f1c976026 100644 (file)
@@ -41,7 +41,7 @@ public class WorkDurationConvertorTest {
   WorkDurationConvertor convertor = new WorkDurationConvertor(propertiesDao);
 
   @Test
-  public void convert_from_long() throws Exception {
+  public void convert_from_long() {
     convertor.init();
     when(propertiesDao.selectGlobalProperty(WorkDurationConvertor.HOURS_IN_DAY_PROPERTY)).thenReturn(new PropertyDto().setValue(Integer.toString(HOURS_IN_DAY)));
 
@@ -52,13 +52,13 @@ public class WorkDurationConvertorTest {
   }
 
   @Test
-  public void convert_from_long_use_default_value_for_hours_in_day_when_no_property() throws Exception {
+  public void convert_from_long_use_default_value_for_hours_in_day_when_no_property() {
     convertor.init();
     assertThat(convertor.createFromLong(1)).isEqualTo(ONE_MINUTE);
   }
 
   @Test
-  public void fail_convert_from_long_on_bad_hours_in_day_property() throws Exception {
+  public void fail_convert_from_long_on_bad_hours_in_day_property() {
     when(propertiesDao.selectGlobalProperty(WorkDurationConvertor.HOURS_IN_DAY_PROPERTY)).thenReturn(new PropertyDto().setValue("-2"));
     WorkDurationConvertor workDurationConvertor = new WorkDurationConvertor(propertiesDao);
     try {
@@ -70,7 +70,7 @@ public class WorkDurationConvertorTest {
   }
 
   @Test
-  public void convert_from_days() throws Exception {
+  public void convert_from_days() {
     convertor.init();
     when(propertiesDao.selectGlobalProperty(WorkDurationConvertor.HOURS_IN_DAY_PROPERTY)).thenReturn(new PropertyDto().setValue(Integer.toString(HOURS_IN_DAY)));
 
@@ -82,7 +82,7 @@ public class WorkDurationConvertorTest {
   }
 
   @Test
-  public void fail_it_init_has_not_been_called() throws Exception {
+  public void fail_it_init_has_not_been_called() {
     when(propertiesDao.selectGlobalProperty(WorkDurationConvertor.HOURS_IN_DAY_PROPERTY)).thenReturn(new PropertyDto().setValue(Integer.toString(HOURS_IN_DAY)));
 
     try {
index 94971c2b84dc845b5d20987ef122a05235c21e95..78730a3b0bea66a2ab824063e0864c2753c4e919 100644 (file)
@@ -46,7 +46,7 @@ public class ChangeLogMigrationTest {
   DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(system2.now()).thenReturn(DateUtils.parseDate("2014-03-13").getTime());
     dao = new ActivityDao(db.myBatis(), system2);
     dbClient = new DbClient(db.database(), db.myBatis(), dao);
@@ -60,7 +60,7 @@ public class ChangeLogMigrationTest {
   }
 
   @Test
-  public void migrate() throws Exception {
+  public void migrate() {
     db.prepareDbUnit(getClass(), "active_rules_changes.xml");
     migration.execute();
     assertThat(db.countRowsOfTable("activities")).isEqualTo(5);
@@ -70,7 +70,7 @@ public class ChangeLogMigrationTest {
   }
 
   @Test
-  public void migrate_when_no_changelog() throws Exception {
+  public void migrate_when_no_changelog() {
     db.prepareDbUnit(getClass(), "migrate_when_no_changelog.xml");
     migration.execute();
 
index 0510b0f191076806071b74ab95a301c46c636a1c..ee404bc07e8f91c78e78d0d2ada43b9ad4df2c63 100644 (file)
@@ -40,7 +40,7 @@ public class ConvertProfileMeasuresMigrationTest {
   ConvertProfileMeasuresMigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     DbClient dbClient = new DbClient(db.database(), db.myBatis());
     migration = new ConvertProfileMeasuresMigrationStep(dbClient);
   }
index 84aecc0e14db98b701282ee5cb05e76d86412fb3..2ff095da737baefda05bba69d72dabd0fd0cfcf6 100644 (file)
@@ -42,7 +42,7 @@ public class FeedQProfileDatesMigrationTest {
   FeedQProfileDatesMigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table active_rule_changes");
     db.executeUpdateSql("truncate table active_rule_param_changes");
     DbClient dbClient = new DbClient(db.database(), db.myBatis());
@@ -52,7 +52,7 @@ public class FeedQProfileDatesMigrationTest {
   }
 
   @Test
-  public void feed_created_at_and_updated_at() throws Exception {
+  public void feed_created_at_and_updated_at() {
     db.prepareDbUnit(getClass(), "feed_created_at_and_updated_at.xml");
 
     migration.execute();
@@ -63,7 +63,7 @@ public class FeedQProfileDatesMigrationTest {
   }
 
   @Test
-  public void use_default_dates_when_no_changes() throws Exception {
+  public void use_default_dates_when_no_changes() {
     db.prepareDbUnit(getClass(), "use_default_dates_when_no_changes.xml");
 
     migration.execute();
index 67331c222250313bd70707ccfa00f8f5c52d488f..92b817e8dc978ed7781bd47d917bfd0ac54ea4c3 100644 (file)
@@ -44,7 +44,7 @@ public class IssueActionPlanKeyMigrationTest {
   IssueActionPlanKeyMigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(system2.now()).thenReturn(DateUtils.parseDate("2014-04-28").getTime());
 
     migration = new IssueActionPlanKeyMigrationStep(db.database(), system2);
index 33f7683fbbb78d61753a55af643718e6354dc8b1..aa86b64d69dfbc697a576aae271f4312f7b3c3f5 100644 (file)
@@ -36,7 +36,7 @@ public class MeasureDataMigrationTest {
   MeasureDataMigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     migration = new MeasureDataMigrationStep(db.database());
   }
 
index 797b71f360dcbaea0eb465453b02712d1a17622a..d9af88e441eae608c171bd6d5e969bb0eb4d6961 100644 (file)
@@ -39,7 +39,7 @@ public class AddMissingRuleParameterDefaultValuesMigrationTest {
   System2 system = mock(System2.class);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table rules_parameters");
     db.executeUpdateSql("truncate table active_rules");
     db.executeUpdateSql("truncate table active_rule_parameters");
index ef1efb8ebffdb6c9b8c5e2a9c874c93411fa1c77..e0c22d4ddb2174c64596161f7e67868e3c339737 100644 (file)
@@ -41,7 +41,7 @@ public class DeleteMeasuresOnDeletedProfilesMigrationTest {
   MigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     DbClient dbClient = new DbClient(db.database(), db.myBatis());
     migration = new DeleteMeasuresOnDeletedProfilesMigrationStep(dbClient);
   }
index c55f58310c00dda86699a58790b3b1c1e0248606..6234aae32bd21fba33467e55fb7c13ac2734b510 100644 (file)
@@ -40,7 +40,7 @@ public class AddMissingCustomRuleParametersMigrationTest {
   System2 system = mock(System2.class);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table rules");
     db.executeUpdateSql("truncate table rules_parameters");
     DbClient dbClient = new DbClient(db.database(), db.myBatis());
index 510281bde6c6587c30db29bccf0c5199fb68978f..79d62c49ac684ac06b40425c821dbd662c5de6ad 100644 (file)
@@ -42,7 +42,7 @@ public class DeleteUnescapedActivitiesTest {
   }
 
   @Test
-  public void is_unescaped() throws Exception {
+  public void is_unescaped() {
     assertThat(DeleteUnescapedActivities.isUnescaped(
       "ruleKey=findbugs:PT_RELATIVE_PATH_TRAVERSAL;profileKey=java-findbugs-74105;severity=MAJOR;" +
         "key=java-findbugs-74105:findbugs:PT_RELATIVE_PATH_TRAVERSAL"))
index 1434e2c11cb413d02e8ebab24ab91d06185a24f5..d45cfc7a4ec045efa002a84b9b8e94e0736d82ed 100644 (file)
@@ -50,7 +50,7 @@ public class FeedFileSourcesTest {
   System2 system;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table metrics");
     db.executeUpdateSql("truncate table snapshots");
     db.executeUpdateSql("truncate table snapshot_sources");
index f10e6e93793230c320de91d9393d0ad5f1850649..23fdd41681f46383b421e1844a2d066899f196e5 100644 (file)
@@ -39,7 +39,7 @@ public class InsertProjectsAuthorizationUpdatedAtMigrationTest {
   System2 system = mock(System2.class);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table projects");
     migration = new InsertProjectsAuthorizationUpdatedAtMigrationStep(db.database(), system);
     when(system.now()).thenReturn(123456789L);
index 6337cda22c17972dcf96e2dc9306bf6748bf8206..7adde185508a654f3a810c2f452a9e2c3f3e4e14 100644 (file)
@@ -48,7 +48,7 @@ public class PopulateProjectsUuidColumnsMigrationTest {
   MigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table projects");
     db.executeUpdateSql("truncate table snapshots");
     dbClient = new DbClient(db.database(), db.myBatis());
@@ -58,7 +58,7 @@ public class PopulateProjectsUuidColumnsMigrationTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index 8c7cf3fac798352c035a46e14b305d7b9ab92afc..e71a69da294b7bda70f0b077ecbc170331779e11 100644 (file)
@@ -39,7 +39,7 @@ public class RemoveSortFieldFromIssueFiltersMigrationTest {
   System2 system = mock(System2.class);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table issue_filters");
     migration = new RemoveSortFieldFromIssueFiltersMigrationStep(db.database(), system);
     when(system.now()).thenReturn(DateUtils.parseDate("2014-10-29").getTime());
index 5f48b08215fd0eba3b9c3cac35e3df2aea0eb953..06494e4d46c59985e9e880c1183e9d9511dd64cf 100644 (file)
@@ -39,7 +39,7 @@ public class ReplaceIssueFiltersProjectKeyByUuidTest {
   System2 system = mock(System2.class);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table issue_filters");
     migration = new ReplaceIssueFiltersProjectKeyByUuid(db.database(), system);
     when(system.now()).thenReturn(DateUtils.parseDate("2014-10-29").getTime());
index e882b4a6fccb86c54ec517f5f90f57113ca03b38..784401f29cbfb818a48e3f1ae4d4736e5f087cb0 100644 (file)
@@ -35,7 +35,7 @@ public class AddIssuesColumnsTest {
   MigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     migration = new AddIssuesColumns(db.database());
   }
 
index 34fbbef067a0a7f674ff60d48a043b4dead31c5e..f5cc219ca1b8fea3958e741184f9a2a6a5c9fa72 100644 (file)
@@ -43,7 +43,7 @@ public class AddNewCharacteristicsTest {
   System2 system = mock(System2.class);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table characteristics");
 
     when(system.now()).thenReturn(DateUtils.parseDate("2015-02-15").getTime());
@@ -87,7 +87,7 @@ public class AddNewCharacteristicsTest {
   }
 
   @Test
-  public void fail_if_usability_exists_as_sub_characteristic() throws Exception {
+  public void fail_if_usability_exists_as_sub_characteristic() {
     db.prepareDbUnit(getClass(), "fail_if_usability_exists_as_sub_characteristic.xml");
 
     try {
@@ -101,7 +101,7 @@ public class AddNewCharacteristicsTest {
   }
 
   @Test
-  public void fail_if_compliance_already_exists_as_characteristic() throws Exception {
+  public void fail_if_compliance_already_exists_as_characteristic() {
     db.prepareDbUnit(getClass(), "fail_if_compliance_already_exists_as_characteristic.xml");
 
     try {
@@ -115,7 +115,7 @@ public class AddNewCharacteristicsTest {
   }
 
   @Test
-  public void fail_if_compliance_already_exists_under_wrong_characteristic() throws Exception {
+  public void fail_if_compliance_already_exists_under_wrong_characteristic() {
     db.prepareDbUnit(getClass(), "fail_if_compliance_already_exists_under_wrong_characteristic.xml");
 
     try {
index 9b690506ed13cb2074fd426aa9ec1d309c2e7458..225008d884f7343b4371efba5487177c39d2a59b 100644 (file)
@@ -43,7 +43,7 @@ public class CopyScmAccountsFromAuthorsToUsersTest {
   System2 system = mock(System2.class);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table authors");
     db.executeUpdateSql("truncate table users");
     migration = new CopyScmAccountsFromAuthorsToUsers(db.database(), system);
index 0280ffe0af663e358927e33a0b07d4dfc55ff966..a510574d1ee33eb0f831015d4866a8af2653c8ff 100644 (file)
@@ -35,13 +35,13 @@ public class DropIssuesColumnsTest {
   Database database;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     database = mock(Database.class);
     migration = new DropIssuesColumns(database);
   }
 
   @Test
-  public void generate_sql_on_postgresql() throws Exception {
+  public void generate_sql_on_postgresql() {
     when(database.getDialect()).thenReturn(new PostgreSql());
     assertThat(migration.generateSql()).isEqualTo(
       "ALTER TABLE issues DROP COLUMN issue_creation_date, DROP COLUMN issue_update_date, DROP COLUMN issue_close_date, DROP COLUMN component_id, DROP COLUMN root_component_id"
index c15cdfe64aa494bc72ee5be45ef81720671ae8da..6bfce09f823177e9f050e424f68ffab6bca1b114 100644 (file)
@@ -37,7 +37,7 @@ public class FeedEventsLongDatesTest {
   public static DbTester db = new DbTester().schema(FeedEventsLongDatesTest.class, "schema.sql");
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     db.prepareDbUnit(getClass(), "before.xml");
   }
 
index e4cb5219d2e105663337e8e318a136ac126af4c2..cdc3c049bb94ec693e7f9fe1d778e4cd84ce47fd 100644 (file)
@@ -32,7 +32,7 @@ public class FeedIssueComponentUuidsTest {
   FeedIssueComponentUuids sut;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.truncateTables();
 
     sut = new FeedIssueComponentUuids(db.database());
index d237432e09aded24de9b44673b16837b3a4d9c37..9eae280d32707eb4b957dcea69a2b83b9b560eee 100644 (file)
@@ -41,7 +41,7 @@ public class FeedIssueTagsTest {
   System2 system;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table rules");
     db.executeUpdateSql("truncate table issues");
 
index 1333710b31c9c1c33b48de5371720550c94375e4..0e29d0d78f4c02a5f772d833a8bb4950dc781eb7 100644 (file)
@@ -37,7 +37,7 @@ public class FeedManualMeasuresLongDatesTest {
   public static DbTester db = new DbTester().schema(FeedManualMeasuresLongDatesTest.class, "schema.sql");
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     db.prepareDbUnit(getClass(), "before.xml");
   }
 
index 010cca9be6670cde1d444b87fa504eb497288bc1..09edce288feeed96300d190ed8a36ff098486d62 100644 (file)
@@ -37,7 +37,7 @@ public class FeedSemaphoresLongDatesTest {
   public static DbTester db = new DbTester().schema(FeedSemaphoresLongDatesTest.class, "schema.sql");
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     db.prepareDbUnit(getClass(), "before.xml");
   }
 
index 0dff23a0fb51ce1de3a8995e5e4407fe993f0775..49b62c3a8e2916e50396051f5f6358f0b6c5b425 100644 (file)
@@ -33,7 +33,7 @@ public class RemovePermissionsOnModulesMigrationTest {
   MigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     migration = new RemovePermissionsOnModulesMigrationStep(db.database());
   }
 
index 86906e6ab5e373a0c8faff9e7a9424f91c44f593..ace0591da3b2a4748e82cecaabb40f05b8847720 100644 (file)
@@ -39,7 +39,7 @@ public class RenameComponentRelatedParamsInIssueFiltersMigrationTest {
   System2 system = mock(System2.class);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table issue_filters");
     migration = new RenameComponentRelatedParamsInIssueFilters(db.database(), system);
     when(system.now()).thenReturn(DateUtils.parseDate("2014-10-29").getTime());
index e1d680d84640595855e685db9c10492d876abbff..bb2d0567eebbf099746596924b09c156b686de43 100644 (file)
@@ -37,7 +37,7 @@ public class UpdateProjectsModuleUuidPathTest {
   System2 system;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table projects");
 
     migration = new UpdateProjectsModuleUuidPath(db.database());
index c95338db9fe0d3b5a8685d072cba13ac39b152a1..205e90838c75c1f57f20d54319d49ed4f9d01bf4 100644 (file)
@@ -35,7 +35,7 @@ public class AddDependenciesColumnsTest {
   AddDependenciesColumns migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     migration = new AddDependenciesColumns(db.database());
   }
 
index 99e041a75b1eaa604b1c76987cb505d624b446cf..a0b8ce006c076ff479f5de9edb273ba1404182f7 100644 (file)
@@ -35,7 +35,7 @@ public class AddDependenciesComponentUuidColumnsTest {
   AddDependenciesComponentUuidColumns migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     migration = new AddDependenciesComponentUuidColumns(db.database());
   }
 
index 3147195b99cd9cb496e2aeb78f9feca9298ca333..117771c293c383a7f3eec6b16733e75325c1a59a 100644 (file)
@@ -36,13 +36,13 @@ public class DropDependenciesComponentColumnsTest {
   Database database;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     database = mock(Database.class);
     migration = new DropDependenciesComponentColumns(database);
   }
 
   @Test
-  public void generate_sql_on_postgresql() throws Exception {
+  public void generate_sql_on_postgresql() {
     when(database.getDialect()).thenReturn(new PostgreSql());
     assertThat(migration.generateSql()).isEqualTo(
       "ALTER TABLE dependencies DROP COLUMN from_resource_id, DROP COLUMN to_resource_id"
index ab46ea1551e19a5a38abc0ee04fb12845bfe85c2..383d5515c7a9f58b5fe60b44e54ed2acf4ea23b2 100644 (file)
@@ -34,7 +34,7 @@ public class FeedDependenciesComponentUuidsTest {
   MigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table dependencies");
     db.executeUpdateSql("truncate table projects");
 
index 26412c877fc03dd2c403a7dd557915e87776c582..42d8fc3eaf8d6fea5f9a0678247d55b6d1a8168d 100644 (file)
@@ -34,7 +34,7 @@ public class FeedEventsComponentUuidTest {
   MigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table events");
     db.executeUpdateSql("truncate table projects");
 
index f770363e269b3b718f7fd2e903e1b616280cb846..b8f0cf1f6f4e90fb1e353c11006b6539a0c951a7 100644 (file)
@@ -34,7 +34,7 @@ public class FeedFileSourcesDataTypeTest {
   MigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table file_sources");
 
     migration = new FeedFileSourcesDataType(db.database());
index 76c888b19b3c8c719d5115a67d2bfd267bebf5e7..593d87f5c405ce007c36f0af3c52053f2d2a2a6f 100644 (file)
@@ -34,7 +34,7 @@ public class FeedProjectLinksComponentUuidTest {
   MigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table project_links");
 
     migration = new FeedProjectLinksComponentUuid(db.database());
index fdf30cacfe277270264ac5f72561dfdd91e2c666..5b2545ba8bb7a610e48de4186df4b5506ef27257 100644 (file)
@@ -34,7 +34,7 @@ public class MoveProjectProfileAssociationTest {
   MigrationStep migration;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.executeUpdateSql("truncate table projects");
     db.executeUpdateSql("truncate table project_qprofiles");
     db.executeUpdateSql("truncate table properties");
index d01b7299644c6abfabda127906450af62a4711d9..1fd391301e3ee65559c167e0640be6a37ae65cac 100644 (file)
@@ -38,13 +38,13 @@ public class DebtMediumTest {
   public static ServerTester serverTester = new ServerTester();
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     serverTester.clearDbAndIndexes();
     serverTester.get(Platform.class).executeStartupTasks();
   }
 
   @Test
-  public void find_default_characteristics() throws Exception {
+  public void find_default_characteristics() {
     DebtModelService debtModelService = serverTester.get(DebtModelService.class);
 
     // Only root characteristics
@@ -55,7 +55,7 @@ public class DebtMediumTest {
   }
 
   @Test
-  public void create_characteristic() throws Exception {
+  public void create_characteristic() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
 
     DebtModelService debtModelService = serverTester.get(DebtModelService.class);
@@ -72,7 +72,7 @@ public class DebtMediumTest {
   }
 
   @Test
-  public void create_sub_characteristic() throws Exception {
+  public void create_sub_characteristic() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
 
     DebtModelService debtModelService = serverTester.get(DebtModelService.class);
index 5988ce6db05e81df2268a4afe7de29b63abce77c..1e837e369dd0a9cb15169213c6d0a173b9cfd350 100644 (file)
@@ -121,7 +121,7 @@ public class DebtModelBackupTest {
   DebtModelBackup debtModelBackup;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
 
     when(system2.now()).thenReturn(now.getTime());
@@ -149,7 +149,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void backup() throws Exception {
+  public void backup() {
     when(dao.selectEnabledCharacteristics(session)).thenReturn(newArrayList(
       new CharacteristicDto().setId(1).setKey("PORTABILITY").setName("Portability updated").setOrder(2),
       new CharacteristicDto().setId(2).setKey("COMPILER").setName("Compiler updated").setParentId(1)
@@ -195,7 +195,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void backup_with_disabled_rules() throws Exception {
+  public void backup_with_disabled_rules() {
     when(dao.selectEnabledCharacteristics(session)).thenReturn(newArrayList(
       new CharacteristicDto().setId(1).setKey("PORTABILITY").setName("Portability updated").setOrder(2),
       new CharacteristicDto().setId(2).setKey("COMPILER").setName("Compiler updated").setParentId(1)
@@ -217,7 +217,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void backup_with_rule_having_default_linear_and_overridden_offset() throws Exception {
+  public void backup_with_rule_having_default_linear_and_overridden_offset() {
     when(dao.selectEnabledCharacteristics(session)).thenReturn(newArrayList(
       new CharacteristicDto().setId(1).setKey("PORTABILITY").setName("Portability updated").setOrder(2),
       new CharacteristicDto().setId(2).setKey("COMPILER").setName("Compiler updated").setParentId(1)
@@ -255,7 +255,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void backup_from_language() throws Exception {
+  public void backup_from_language() {
     when(dao.selectEnabledCharacteristics(session)).thenReturn(newArrayList(
       new CharacteristicDto().setId(1).setKey("PORTABILITY").setName("Portability updated").setOrder(2),
       new CharacteristicDto().setId(2).setKey("COMPILER").setName("Compiler updated").setParentId(1)
@@ -293,7 +293,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void create_characteristics_when_restoring_characteristics() throws Exception {
+  public void create_characteristics_when_restoring_characteristics() {
     when(dao.selectEnabledCharacteristics(session)).thenReturn(Collections.<CharacteristicDto>emptyList());
 
     debtModelBackup.restoreCharacteristics(
@@ -326,7 +326,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void update_characteristics_when_restoring_characteristics() throws Exception {
+  public void update_characteristics_when_restoring_characteristics() {
     when(dao.selectEnabledCharacteristics(session)).thenReturn(newArrayList(
       // Order and name have changed
       new CharacteristicDto().setId(1).setKey("PORTABILITY").setName("Portability updated").setOrder(2).setCreatedAt(oldDate).setUpdatedAt(oldDate),
@@ -363,7 +363,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void update_parent_when_restoring_characteristics() throws Exception {
+  public void update_parent_when_restoring_characteristics() {
     when(dao.selectEnabledCharacteristics(session)).thenReturn(newArrayList(
       // Parent has changed
       new CharacteristicDto().setId(1).setKey("PORTABILITY").setName("Portability updated").setParentId(1).setOrder(1).setCreatedAt(oldDate).setUpdatedAt(oldDate),
@@ -394,7 +394,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void disable_no_more_existing_characteristics_when_restoring_characteristics() throws Exception {
+  public void disable_no_more_existing_characteristics_when_restoring_characteristics() {
     CharacteristicDto dto1 = new CharacteristicDto().setId(1).setKey("PORTABILITY").setName("Portability").setOrder(1);
     CharacteristicDto dto2 = new CharacteristicDto().setId(2).setKey("COMPILER").setName("Compiler").setParentId(1);
 
@@ -407,7 +407,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void reset_model() throws Exception {
+  public void reset_model() {
     when(characteristicsXMLImporter.importXML(any(Reader.class))).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1))
       .addSubCharacteristic(new DefaultDebtCharacteristic().setKey("COMPILER").setName("Compiler"), "PORTABILITY"));
@@ -468,7 +468,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void reset_model_when_no_default_value() throws Exception {
+  public void reset_model_when_no_default_value() {
     when(characteristicsXMLImporter.importXML(any(Reader.class))).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1))
       .addSubCharacteristic(new DefaultDebtCharacteristic().setKey("COMPILER").setName("Compiler"), "PORTABILITY"));
@@ -520,7 +520,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void reset_model_on_custom_rules() throws Exception {
+  public void reset_model_on_custom_rules() {
     when(characteristicsXMLImporter.importXML(any(Reader.class))).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1))
       .addSubCharacteristic(new DefaultDebtCharacteristic().setKey("COMPILER").setName("Compiler"), "PORTABILITY"));
@@ -582,7 +582,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void reset_model_do_not_load_rule_definitions_if_no_rule() throws Exception {
+  public void reset_model_do_not_load_rule_definitions_if_no_rule() {
     when(characteristicsXMLImporter.importXML(any(Reader.class))).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1))
       .addSubCharacteristic(new DefaultDebtCharacteristic().setKey("COMPILER").setName("Compiler"), "PORTABILITY"));
@@ -608,7 +608,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void restore_from_xml() throws Exception {
+  public void restore_from_xml() {
     when(characteristicsXMLImporter.importXML(anyString())).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1))
       .addSubCharacteristic(new DefaultDebtCharacteristic().setKey("COMPILER").setName("Compiler"), "PORTABILITY"));
@@ -639,7 +639,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void restore_from_xml_disable_rule_debt_when_not_in_xml_and_rule_have_default_debt_values() throws Exception {
+  public void restore_from_xml_disable_rule_debt_when_not_in_xml_and_rule_have_default_debt_values() {
     when(characteristicsXMLImporter.importXML(anyString())).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1))
       .addSubCharacteristic(new DefaultDebtCharacteristic().setKey("COMPILER").setName("Compiler"), "PORTABILITY"));
@@ -663,7 +663,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void restore_from_xml_and_language() throws Exception {
+  public void restore_from_xml_and_language() {
     when(characteristicsXMLImporter.importXML(anyString())).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1))
       .addSubCharacteristic(new DefaultDebtCharacteristic().setKey("COMPILER").setName("Compiler"), "PORTABILITY"));
@@ -697,7 +697,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void restore_from_xml_and_language_disable_no_more_existing_characteristics() throws Exception {
+  public void restore_from_xml_and_language_disable_no_more_existing_characteristics() {
     when(characteristicsXMLImporter.importXML(anyString())).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1)));
 
@@ -713,7 +713,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void restore_from_xml_and_language_with_rule_not_in_xml() throws Exception {
+  public void restore_from_xml_and_language_with_rule_not_in_xml() {
     when(characteristicsXMLImporter.importXML(anyString())).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1))
       .addSubCharacteristic(new DefaultDebtCharacteristic().setKey("COMPILER").setName("Compiler"), "PORTABILITY"));
@@ -743,7 +743,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void restore_from_xml_add_warning_message_when_rule_from_xml_is_not_found() throws Exception {
+  public void restore_from_xml_add_warning_message_when_rule_from_xml_is_not_found() {
     when(characteristicsXMLImporter.importXML(anyString())).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1))
       .addSubCharacteristic(new DefaultDebtCharacteristic().setKey("COMPILER").setName("Compiler"), "PORTABILITY"));
@@ -766,7 +766,7 @@ public class DebtModelBackupTest {
   }
 
   @Test
-  public void restore_from_xml_add_error_message_when_illegal_argument_exception() throws Exception {
+  public void restore_from_xml_add_error_message_when_illegal_argument_exception() {
     when(characteristicsXMLImporter.importXML(anyString())).thenReturn(new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("PORTABILITY").setName("Portability").setOrder(1))
       .addSubCharacteristic(new DefaultDebtCharacteristic().setKey("COMPILER").setName("Compiler"), "PORTABILITY"));
index 202e3c7f2b3db06984e764bac083b340b6452698..9c3c3905720a5293c60ffd760c8b968673ee74af 100644 (file)
@@ -49,7 +49,7 @@ public class DebtModelLookupTest {
   DebtModelLookup service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     service = new DebtModelLookup(dao);
   }
 
index 9f580a290eeddce25b669d27217c98fa8b698ac3..e9c5cc9b571c98713a04eac8762376701d3bd275 100644 (file)
@@ -109,7 +109,7 @@ public class DebtModelOperationsTest {
   DebtModelOperations service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(system2.now()).thenReturn(now.getTime());
 
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
index f6d218250309da9ce48e7583632d6c23d711500e..51bf42d8ff847db26d18fc73efcf2c87fcf1079b 100644 (file)
@@ -78,7 +78,7 @@ public class DebtModelPluginRepositoryTest {
   }
 
   @Test
-  public void contributing_plugin_list() throws Exception {
+  public void contributing_plugin_list() {
     initModel();
     Collection<String> contributingPluginList = modelFinder.getContributingPluginList();
     assertThat(contributingPluginList.size()).isEqualTo(2);
@@ -86,7 +86,7 @@ public class DebtModelPluginRepositoryTest {
   }
 
   @Test
-  public void get_content_for_xml_file() throws Exception {
+  public void get_content_for_xml_file() {
     initModel();
     Reader xmlFileReader = null;
     try {
@@ -103,26 +103,26 @@ public class DebtModelPluginRepositoryTest {
   }
 
   @Test
-  public void return_xml_file_path_for_plugin() throws Exception {
+  public void return_xml_file_path_for_plugin() {
     initModel();
     assertThat(modelFinder.getXMLFilePath("foo")).isEqualTo(TEST_XML_PREFIX_PATH + "foo-model.xml");
   }
 
   @Test
-  public void contain_default_model() throws Exception {
+  public void contain_default_model() {
     modelFinder = new DebtModelPluginRepository(mock(PluginRepository.class));
     modelFinder.start();
     assertThat(modelFinder.getContributingPluginKeyToClassLoader().keySet()).containsOnly("technical-debt");
   }
 
-  private void initModel() throws MalformedURLException {
+  private void initModel() {
     Map<String, ClassLoader> contributingPluginKeyToClassLoader = Maps.newHashMap();
     contributingPluginKeyToClassLoader.put("csharp", newClassLoader());
     contributingPluginKeyToClassLoader.put("java", newClassLoader());
     modelFinder = new DebtModelPluginRepository(contributingPluginKeyToClassLoader, TEST_XML_PREFIX_PATH);
   }
 
-  private ClassLoader newClassLoader() throws MalformedURLException {
+  private ClassLoader newClassLoader() {
     ClassLoader loader = mock(ClassLoader.class);
     when(loader.getResourceAsStream(anyString())).thenAnswer(new Answer<InputStream>() {
       public InputStream answer(InvocationOnMock invocation) throws Throwable {
index e5309e9f8d8856f89ff49a4f3d752f53bb6eb4fa..9de5ffc380582359d0cadd2d67bca8fbcfb86512 100644 (file)
@@ -42,7 +42,7 @@ public class DebtModelServiceTest {
   DebtModelService service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     service = new DebtModelService(debtModelOperations, debtModelLookup, debtModelBackup);
   }
 
index 08e5e653345fd2601a1785204c50ba0430308c4d..071a390ded6d117a1086408f148101de4de21456 100644 (file)
@@ -78,7 +78,7 @@ public class DebtModelXMLExporterTest {
   }
 
   @Test
-  public void sort_root_characteristics_by_order_and_sub_characteristics_by_name() throws Exception {
+  public void sort_root_characteristics_by_order_and_sub_characteristics_by_name() {
     DebtModel debtModel = new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("EFFICIENCY").setName("Efficiency").setOrder(4))
       .addRootCharacteristic(new DefaultDebtCharacteristic().setKey("USABILITY").setName("Usability").setOrder(3))
@@ -100,7 +100,7 @@ public class DebtModelXMLExporterTest {
   }
 
   @Test
-  public void pretty_print_exported_xml() throws Exception {
+  public void pretty_print_exported_xml() {
     DebtModel debtModel = new DebtModel()
       .addRootCharacteristic(new DefaultDebtCharacteristic().setId(1).setKey("USABILITY").setName("Usability").setOrder(1))
       .addRootCharacteristic(new DefaultDebtCharacteristic().setId(2).setKey("EFFICIENCY").setName("Efficiency").setOrder(2))
index e9b515b0c0d02d9e134a9cd998a46684b5435797..da650e6962729b7129a2ecbe291989404408b225 100644 (file)
@@ -45,19 +45,19 @@ public class FileDependencyDaoTest {
   FileDependencyDao dao;
 
   @Before
-  public void setup() throws Exception {
+  public void setup() {
     dbTester.truncateTables();
     session = dbTester.myBatis().openSession(false);
     dao = new FileDependencyDao();
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void select_from_parents() throws Exception {
+  public void select_from_parents() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     List<FileDependencyDto> dtos = dao.selectFromParents(session, "MNOP", "QRST", 1L);
@@ -76,14 +76,14 @@ public class FileDependencyDaoTest {
   }
 
   @Test
-  public void select_all() throws Exception {
+  public void select_all() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     assertThat(dao.selectAll(session)).hasSize(3);
   }
 
   @Test
-  public void insert() throws Exception {
+  public void insert() {
     dao.insert(session, new FileDependencyDto()
       .setFromComponentUuid("ABCD")
       .setToComponentUuid("EFGH")
index 0549e70e4d831846c5b60b9b4e2dcedabf6a0306..32afbfee42a032e125999a17e23453005949d401 100644 (file)
@@ -34,13 +34,13 @@ public class DependenciesWsTest {
   WebService.Controller controller;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     WsTester tester = new WsTester(new DependenciesWs(new ShowAction(mock(DbClient.class))));
     controller = tester.controller("api/dependencies");
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNull();
     assertThat(controller.since()).isEqualTo("5.2");
@@ -48,7 +48,7 @@ public class DependenciesWsTest {
   }
 
   @Test
-  public void define_search_action() throws Exception {
+  public void define_search_action() {
     WebService.Action action = controller.action("show");
     assertThat(action).isNotNull();
     assertThat(action.isPost()).isFalse();
index b541b9940b7b541df60aff0928fa628a5a881a77..9f1837bde9f02baf4aef8d318a7cbf13e0b3e24b 100644 (file)
@@ -69,7 +69,7 @@ public class ShowActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new ComponentDao(), new SnapshotDao(System2.INSTANCE), new FileDependencyDao());
     session = dbClient.openSession(false);
index 18fd62b7fec4b5438b229f4b36d60c4a1ce798f4..e72e7b03a3e7d17a8ad26e9ae5e7274f01aad1c8 100644 (file)
@@ -55,7 +55,7 @@ public class DuplicationsJsonWriterTest {
   ComponentDto project;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     project = ComponentTesting.newProjectDto()
       .setId(1L)
       .setName("SonarQube")
@@ -66,7 +66,7 @@ public class DuplicationsJsonWriterTest {
   }
 
   @Test
-  public void write_duplications() throws Exception {
+  public void write_duplications() {
     String key1 = "org.codehaus.sonar:sonar-ws-client:src/main/java/org/sonar/wsclient/services/PropertyDeleteQuery.java";
     ComponentDto file1 = ComponentTesting.newFileDto(project).setId(10L).setKey(key1).setLongName("PropertyDeleteQuery").setParentProjectId(5L);
     String key2 = "org.codehaus.sonar:sonar-ws-client:src/main/java/org/sonar/wsclient/services/PropertyUpdateQuery.java";
@@ -125,7 +125,7 @@ public class DuplicationsJsonWriterTest {
   }
 
   @Test
-  public void write_duplications_without_sub_project() throws Exception {
+  public void write_duplications_without_sub_project() {
     String key1 = "org.codehaus.sonar:sonar-ws-client:src/main/java/org/sonar/wsclient/services/PropertyDeleteQuery.java";
     ComponentDto file1 = ComponentTesting.newFileDto(project).setId(10L).setKey(key1).setLongName("PropertyDeleteQuery");
     String key2 = "org.codehaus.sonar:sonar-ws-client:src/main/java/org/sonar/wsclient/services/PropertyUpdateQuery.java";
@@ -173,7 +173,7 @@ public class DuplicationsJsonWriterTest {
   }
 
   @Test
-  public void write_duplications_with_a_removed_component() throws Exception {
+  public void write_duplications_with_a_removed_component() {
     String key1 = "org.codehaus.sonar:sonar-ws-client:src/main/java/org/sonar/wsclient/services/PropertyDeleteQuery.java";
     ComponentDto file1 = ComponentTesting.newFileDto(project).setId(10L).setKey(key1).setLongName("PropertyDeleteQuery");
 
@@ -214,7 +214,7 @@ public class DuplicationsJsonWriterTest {
   }
 
   @Test
-  public void write_nothing_when_no_data() throws Exception {
+  public void write_nothing_when_no_data() {
     test(Collections.<DuplicationsParser.Block>emptyList(), "{\"duplications\": [], \"files\": {}}");
   }
 
index a51a04124050dc119484e5304b390e7bb9962f77..a4f439449291f34ab8984b163ac6fdc33a418d4c 100644 (file)
@@ -63,7 +63,7 @@ public class DuplicationsParserTest {
   ComponentDto project2;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     project1 = ComponentTesting.newProjectDto()
       .setId(1L)
       .setName("SonarQube")
@@ -91,7 +91,7 @@ public class DuplicationsParserTest {
   }
 
   @Test
-  public void empty_list_when_no_data() throws Exception {
+  public void empty_list_when_no_data() {
     assertThat(parser.parse(currentFile, null, session)).isEmpty();
   }
 
@@ -198,7 +198,7 @@ public class DuplicationsParserTest {
   }
 
   @Test
-  public void compare_duplications() throws Exception {
+  public void compare_duplications() {
     ComponentDto currentFile = ComponentTesting.newFileDto(project1).setId(11L);
     ComponentDto fileOnSameProject = ComponentTesting.newFileDto(project1).setId(12L);
     ComponentDto fileOnDifferentProject = ComponentTesting.newFileDto(project2).setId(13L);
index a2a0fa8983e4e5936ee0eeadee67d41fd89424cc..87652c229dcbbf615db46650092055f3d11ea44e 100644 (file)
@@ -36,7 +36,7 @@ public class DuplicationsWsTest {
     new ShowAction(mock(DbClient.class), mock(ComponentDao.class), mock(MeasureDao.class), mock(DuplicationsParser.class), mock(DuplicationsJsonWriter.class))));
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WebService.Controller controller = tester.controller("api/duplications");
     assertThat(controller).isNotNull();
     assertThat(controller.since()).isEqualTo("4.4");
index db137bb750e929af2cd125974fc0793079897ab2..eb19639dc105ce3ce8eab381ceaa0036a34ed026 100644 (file)
@@ -71,7 +71,7 @@ public class ShowActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(dbClient.openSession(false)).thenReturn(session);
     tester = new WsTester(new DuplicationsWs(new ShowAction(dbClient, componentDao, measureDao, parser, duplicationsJsonWriter)));
   }
index 93692d1657013c542748d3085a272bb4f114635f..94c4638c0843e41664720050497bd56c007b5048 100644 (file)
@@ -39,7 +39,7 @@ public class BulkIndexerTest {
   public EsTester esTester = new EsTester().addDefinitions(new FakeIndexDefinition().setReplicas(1));
 
   @Test
-  public void index_nothing() throws Exception {
+  public void index_nothing() {
     esTester.truncateIndices();
 
     BulkIndexer indexer = new BulkIndexer(esTester.client(), FakeIndexDefinition.INDEX);
@@ -50,7 +50,7 @@ public class BulkIndexerTest {
   }
 
   @Test
-  public void index_documents() throws Exception {
+  public void index_documents() {
     BulkIndexer indexer = new BulkIndexer(esTester.client(), FakeIndexDefinition.INDEX);
     indexer.start();
     indexer.add(newIndexRequest(42));
@@ -65,7 +65,7 @@ public class BulkIndexerTest {
   }
 
   @Test
-  public void large_indexing() throws Exception {
+  public void large_indexing() {
     // index has one replica
     assertThat(replicas()).isEqualTo(1);
 
@@ -110,7 +110,7 @@ public class BulkIndexerTest {
   }
 
   @Test
-  public void disable_refresh() throws Exception {
+  public void disable_refresh() {
     BulkIndexer indexer = new BulkIndexer(esTester.client(), FakeIndexDefinition.INDEX)
       .setDisableRefresh(true);
     indexer.start();
index 36e98501ff19a8a6cb7273560085b4f933ddfe3b..4d11b0fa1ddbee114f0425b114f3718d7a6eb4e9 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class DefaultIndexSettingsTest {
 
   @Test
-  public void defaults() throws Exception {
+  public void defaults() {
     ImmutableMap<String, String> map = DefaultIndexSettings.defaults().build().getAsMap();
     assertThat(map).isNotEmpty();
 
@@ -39,7 +39,7 @@ public class DefaultIndexSettingsTest {
   }
 
   @Test
-  public void only_statics() throws Exception {
+  public void only_statics() {
     TestUtils.hasOnlyPrivateConstructors(DefaultIndexSettings.class);
 
   }
index f65ab01b5b76d2cb1412eea8d242b4f53176bd9e..9d7e045d50f7be6ed3623b983535f3855731964a 100644 (file)
@@ -48,7 +48,7 @@ public class EsClientTest {
   public EsTester es = new EsTester();
 
   @Test
-  public void proxify_requests() throws Exception {
+  public void proxify_requests() {
     EsClient client = es.client();
     client.start();
     assertThat(client.nativeClient()).isNotNull();
index 4473a02a85e20621df4e65cb27b26a74fb63d6e5..1a8148b8cb64bf701f2c6575521a7a5a56a16d6b 100644 (file)
@@ -39,7 +39,7 @@ import static org.mockito.Mockito.when;
 public class EsUtilsTest {
 
   @Test
-  public void convertToDocs_empty() throws Exception {
+  public void convertToDocs_empty() {
     SearchHits hits = mock(SearchHits.class, Mockito.RETURNS_MOCKS);
     List<BaseDoc> docs = EsUtils.convertToDocs(hits, new Function<Map<String, Object>, BaseDoc>() {
       @Override
@@ -51,7 +51,7 @@ public class EsUtilsTest {
   }
 
   @Test
-  public void convertToDocs() throws Exception {
+  public void convertToDocs() {
     SearchHits hits = mock(SearchHits.class, Mockito.RETURNS_MOCKS);
     when(hits.getHits()).thenReturn(new SearchHit[]{mock(SearchHit.class)});
     List<BaseDoc> docs = EsUtils.convertToDocs(hits, new Function<Map<String, Object>, BaseDoc>() {
@@ -64,12 +64,12 @@ public class EsUtilsTest {
   }
 
   @Test
-  public void util_class() throws Exception {
+  public void util_class() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(EsUtils.class));
   }
 
   @Test
-  public void es_date_format() throws Exception {
+  public void es_date_format() {
     assertThat(EsUtils.formatDateTime(new Date(1_500_000_000_000L))).startsWith("2017-07-");
     assertThat(EsUtils.formatDateTime(null)).isNull();
 
index 2fe786325aecdc2d61de0bd2555e626622f07414..d8f050a261053d75a3b3d15720bcfc625a02bc0e 100644 (file)
@@ -27,7 +27,7 @@ import static org.junit.Assert.fail;
 public class IndexDefinitionContextTest {
 
   @Test
-  public void create_indices() throws Exception {
+  public void create_indices() {
     IndexDefinition.IndexDefinitionContext context = new IndexDefinition.IndexDefinitionContext();
 
     context.create("issues");
@@ -36,7 +36,7 @@ public class IndexDefinitionContextTest {
   }
 
   @Test
-  public void fail_to_create_twice_the_same_index() throws Exception {
+  public void fail_to_create_twice_the_same_index() {
     IndexDefinition.IndexDefinitionContext context = new IndexDefinition.IndexDefinitionContext();
 
     context.create("issues");
index 20cff8f8548191953b08ce5ce88fe6843eb29984..ab0a94e810b6bc6c480c0251b37bf11d5831055e 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class IndexDefinitionHashTest {
 
   @Test
-  public void of() throws Exception {
+  public void of() {
     IndexDefinitions.Index indexV1 = new IndexDefinitions.Index(createIndex());
     String hashV1 = new IndexDefinitionHash().of(indexV1);
     assertThat(hashV1).isNotEmpty();
index 28c7a00750a7b02a81822b678631325e6abcf4c5..7a3152ada9e7afcf42f665297b6402f6ea18c102 100644 (file)
@@ -31,7 +31,7 @@ import static org.junit.Assert.fail;
 public class NewIndexTest {
 
   @Test
-  public void most_basic_index() throws Exception {
+  public void most_basic_index() {
     NewIndex index = new NewIndex("issues");
     assertThat(index.getName()).isEqualTo("issues");
     assertThat(index.getTypes()).isEmpty();
@@ -41,7 +41,7 @@ public class NewIndexTest {
   }
 
   @Test
-  public void index_name_is_lower_case() throws Exception {
+  public void index_name_is_lower_case() {
     try {
       new NewIndex("Issues");
       fail();
@@ -51,7 +51,7 @@ public class NewIndexTest {
   }
 
   @Test
-  public void define_fields() throws Exception {
+  public void define_fields() {
     NewIndex index = new NewIndex("issues");
     NewIndex.NewIndexType mapping = index.createType("issue");
     mapping.setAttribute("dynamic", "true");
@@ -81,7 +81,7 @@ public class NewIndexTest {
   }
 
   @Test
-  public void define_string_field() throws Exception {
+  public void define_string_field() {
     NewIndex index = new NewIndex("issues");
     NewIndex.NewIndexType mapping = index.createType("issue");
     mapping.stringFieldBuilder("basic_field").build();
@@ -109,7 +109,7 @@ public class NewIndexTest {
   }
 
   @Test
-  public void string_doc_values() throws Exception {
+  public void string_doc_values() {
     NewIndex index = new NewIndex("issues");
     NewIndex.NewIndexType mapping = index.createType("issue");
     mapping.stringFieldBuilder("the_doc_value").docValues().build();
@@ -122,7 +122,7 @@ public class NewIndexTest {
   }
 
   @Test
-  public void analyzed_strings_must_not_be_doc_values() throws Exception {
+  public void analyzed_strings_must_not_be_doc_values() {
     NewIndex index = new NewIndex("issues");
     NewIndex.NewIndexType mapping = index.createType("issue");
     try {
@@ -134,7 +134,7 @@ public class NewIndexTest {
   }
 
   @Test
-  public void do_not_disable_search_on_searchable_fields() throws Exception {
+  public void do_not_disable_search_on_searchable_fields() {
     NewIndex index = new NewIndex("issues");
     NewIndex.NewIndexType mapping = index.createType("issue");
     try {
index 6c1db01f58233b1c4f8fe6ef85f98e70b6cb06d1..a1ce70fc6a0d887c64d33013f94341bce92bf412 100644 (file)
@@ -32,7 +32,7 @@ import static org.junit.Assert.fail;
 public class SearchOptionsTest {
 
   @Test
-  public void defaults() throws Exception {
+  public void defaults() {
     SearchOptions options = new SearchOptions();
 
     assertThat(options.getFacets()).isEmpty();
@@ -43,7 +43,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void page_shortcut_for_limit_and_offset() throws Exception {
+  public void page_shortcut_for_limit_and_offset() {
     SearchOptions options = new SearchOptions().setPage(3, 10);
 
     assertThat(options.getLimit()).isEqualTo(10);
@@ -51,7 +51,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void page_starts_at_one() throws Exception {
+  public void page_starts_at_one() {
     SearchOptions options = new SearchOptions().setPage(1, 10);
     assertThat(options.getLimit()).isEqualTo(10);
     assertThat(options.getOffset()).isEqualTo(0);
@@ -59,7 +59,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void with_zero_page_size() throws Exception {
+  public void with_zero_page_size() {
     SearchOptions options = new SearchOptions().setPage(1, 0);
     assertThat(options.getLimit()).isEqualTo(SearchOptions.MAX_LIMIT);
     assertThat(options.getOffset()).isEqualTo(0);
@@ -67,7 +67,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void page_must_be_strictly_positive() throws Exception {
+  public void page_must_be_strictly_positive() {
     try {
       new SearchOptions().setPage(0, 10);
       fail();
@@ -77,13 +77,13 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void use_max_limit_if_negative() throws Exception {
+  public void use_max_limit_if_negative() {
     SearchOptions options = new SearchOptions().setPage(2, -1);
     assertThat(options.getLimit()).isEqualTo(SearchOptions.MAX_LIMIT);
   }
 
   @Test
-  public void max_limit() throws Exception {
+  public void max_limit() {
     SearchOptions options = new SearchOptions().setLimit(42);
     assertThat(options.getLimit()).isEqualTo(42);
 
@@ -92,20 +92,20 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void disable_limit() throws Exception {
+  public void disable_limit() {
     SearchOptions options = new SearchOptions().disableLimit();
     assertThat(options.getLimit()).isEqualTo(999999);
   }
 
   @Test
-  public void max_page_size() throws Exception {
+  public void max_page_size() {
     SearchOptions options = new SearchOptions().setPage(3, QueryContext.MAX_LIMIT + 10);
     assertThat(options.getOffset()).isEqualTo(QueryContext.MAX_LIMIT * 2);
     assertThat(options.getLimit()).isEqualTo(QueryContext.MAX_LIMIT);
   }
 
   @Test
-  public void hasField() throws Exception {
+  public void hasField() {
     // parameter is missing -> all the fields are returned by default
     SearchOptions options = new SearchOptions();
     assertThat(options.hasField("repo")).isTrue();
@@ -122,7 +122,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void writeJson() throws Exception {
+  public void writeJson() {
     SearchOptions options = new SearchOptions().setPage(3, 10);
     StringWriter json = new StringWriter();
     JsonWriter jsonWriter = JsonWriter.of(json).beginObject();
@@ -133,7 +133,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void writeDeprecatedJson() throws Exception {
+  public void writeDeprecatedJson() {
     SearchOptions options = new SearchOptions().setPage(3, 10);
     StringWriter json = new StringWriter();
     JsonWriter jsonWriter = JsonWriter.of(json).beginObject();
@@ -144,7 +144,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void writeDeprecatedJson_exact_nb_of_pages() throws Exception {
+  public void writeDeprecatedJson_exact_nb_of_pages() {
     SearchOptions options = new SearchOptions().setPage(3, 10);
     StringWriter json = new StringWriter();
     JsonWriter jsonWriter = JsonWriter.of(json).beginObject();
index f0d0712857b8663e37f7ca477b55d6ea828282a5..0106db382a91a6248d09df04b76c1535bbac1cdb 100644 (file)
@@ -74,17 +74,17 @@ public class ProxyBulkRequestBuilderTest {
   }
 
   @Test(expected = UnsupportedOperationException.class)
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     esTester.client().prepareBulk().get("1");
   }
 
   @Test(expected = UnsupportedOperationException.class)
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     esTester.client().prepareBulk().get(TimeValue.timeValueMinutes(1));
   }
 
   @Test(expected = UnsupportedOperationException.class)
-  public void execute_is_not_yet_implemented() throws Exception {
+  public void execute_is_not_yet_implemented() {
     esTester.client().prepareBulk().execute();
   }
 
index abaf9cf7e010f0ecf24ca7fd5a4bac3b0fb99b3d..02d3082f445c8921a80a80f0e53142bb1be76b0a 100644 (file)
@@ -76,7 +76,7 @@ public class ProxyClearCacheRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareClearCache().get("1");
       fail();
@@ -86,7 +86,7 @@ public class ProxyClearCacheRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareClearCache().get(TimeValue.timeValueMinutes(1));
       fail();
@@ -96,7 +96,7 @@ public class ProxyClearCacheRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareClearCache().execute();
       fail();
index f784e6d092cf12c3a959fb0105751e008b7bc44d..a7f0a88414a3de692ea8e686b34a5f5f61c67c22 100644 (file)
@@ -67,7 +67,7 @@ public class ProxyClusterHealthRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareHealth().get("1");
       fail();
@@ -77,7 +77,7 @@ public class ProxyClusterHealthRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareHealth().get(TimeValue.timeValueMinutes(1));
       fail();
@@ -87,7 +87,7 @@ public class ProxyClusterHealthRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareHealth().execute();
       fail();
index ba11fd38f7bca98fe627e476caef392b4f93e0dc..ae01674efbdc72c962d330cab87a3e4c6bde684f 100644 (file)
@@ -63,7 +63,7 @@ public class ProxyClusterStateRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareState().get("1");
       fail();
@@ -73,7 +73,7 @@ public class ProxyClusterStateRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareState().get(TimeValue.timeValueMinutes(1));
       fail();
@@ -83,7 +83,7 @@ public class ProxyClusterStateRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareState().execute();
       fail();
index 6d8a293cd01478164c9dba45e451e023304d9899..742c9fcfdaf4d736b444d982dfcadc8c7f42aa12 100644 (file)
@@ -62,7 +62,7 @@ public class ProxyClusterStatsRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareClusterStats().get("1");
       fail();
@@ -72,7 +72,7 @@ public class ProxyClusterStatsRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareClusterStats().get(TimeValue.timeValueMinutes(1));
       fail();
@@ -82,7 +82,7 @@ public class ProxyClusterStatsRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareClusterStats().execute();
       fail();
index 88b26fa64838dad9f15978e627eaf388bffab9db..625902f724676b50f4a6d92029c5efef354f0ede 100644 (file)
@@ -61,7 +61,7 @@ public class ProxyCountRequestBuilderTest {
   }
 
   @Test
-  public void fail_to_count_bad_query() throws Exception {
+  public void fail_to_count_bad_query() {
     try {
       esTester.client().prepareCount("unknown_index1, unknown_index2").setTypes("unknown_type").get();
       fail();
@@ -72,7 +72,7 @@ public class ProxyCountRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareCount(FakeIndexDefinition.INDEX).get("1");
       fail();
@@ -82,7 +82,7 @@ public class ProxyCountRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareCount(FakeIndexDefinition.INDEX).get(TimeValue.timeValueMinutes(1));
       fail();
@@ -92,7 +92,7 @@ public class ProxyCountRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareCount(FakeIndexDefinition.INDEX).execute();
       fail();
index 4f57c0aba936e27349162d45f12b2a2b7439acf8..36255f8de54ca2044b8af4696d3bf0ba259a3f74 100644 (file)
@@ -63,7 +63,7 @@ public class ProxyCreateIndexRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareCreate(generateNewIndexName()).get("1");
       fail();
@@ -73,7 +73,7 @@ public class ProxyCreateIndexRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareCreate(generateNewIndexName()).get(TimeValue.timeValueMinutes(1));
       fail();
@@ -83,7 +83,7 @@ public class ProxyCreateIndexRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareCreate(generateNewIndexName()).execute();
       fail();
index 6cd0df505de104f8b400b2fd01dfc06e406265f4..3b387ddf91a6cfc1b5644b51f4d36d2524dd351a 100644 (file)
@@ -63,7 +63,7 @@ public class ProxyDeleteByQueryRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareDeleteByQuery().get("1");
       fail();
@@ -73,7 +73,7 @@ public class ProxyDeleteByQueryRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareDeleteByQuery().get(TimeValue.timeValueMinutes(1));
       fail();
@@ -83,7 +83,7 @@ public class ProxyDeleteByQueryRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareDeleteByQuery().execute();
       fail();
index f22d22a60c84c2060ae6e25e3f8c715eadfa0f9e..30e3f20eaf34f64cd258d07bdd072756ccf3ce16 100644 (file)
@@ -57,7 +57,7 @@ public class ProxyDeleteRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareDelete("fakes", "fake", "the_id").get("1");
       fail();
@@ -67,7 +67,7 @@ public class ProxyDeleteRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareDelete("fakes", "fake", "the_id").get(TimeValue.timeValueMinutes(1));
       fail();
@@ -77,7 +77,7 @@ public class ProxyDeleteRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareDelete("fakes", "fake", "the_id").execute();
       fail();
index 86b2960d80e35d5e5fa64bcdf7a7420e6100272f..c75961b7c4862f754452677cd7d09c195ea85996 100644 (file)
@@ -60,7 +60,7 @@ public class ProxyFlushRequestBuilderTest {
   }
 
   @Test
-  public void fail_to_refresh() throws Exception {
+  public void fail_to_refresh() {
     try {
       esTester.client().prepareFlush("unknown").get();
       fail();
@@ -71,7 +71,7 @@ public class ProxyFlushRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareFlush(FakeIndexDefinition.INDEX).get("1");
       fail();
@@ -81,7 +81,7 @@ public class ProxyFlushRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareFlush(FakeIndexDefinition.INDEX).get(TimeValue.timeValueMinutes(1));
       fail();
@@ -91,7 +91,7 @@ public class ProxyFlushRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareFlush(FakeIndexDefinition.INDEX).execute();
       fail();
index 8c1621ba6b4b99354367e386997f68a5a4b469c2..56dd883747bd959092945e611ed731b8475a0ddd 100644 (file)
@@ -63,7 +63,7 @@ public class ProxyGetRequestBuilderTest {
   }
 
   @Test
-  public void fail_to_get_bad_query() throws Exception {
+  public void fail_to_get_bad_query() {
     GetRequestBuilder requestBuilder = esTester.client().prepareGet()
       .setIndex("unknown")
       .setType("test")
@@ -78,7 +78,7 @@ public class ProxyGetRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareGet().get("1");
       fail();
@@ -88,7 +88,7 @@ public class ProxyGetRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareGet().get(TimeValue.timeValueMinutes(1));
       fail();
@@ -98,7 +98,7 @@ public class ProxyGetRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareGet().execute();
       fail();
index f445f8bbc271b4edb9199646b1a5b3b513be95a7..94e44f3e7dc0277e8d9709c1bf2a31392178e07f 100644 (file)
@@ -61,7 +61,7 @@ public class ProxyIndexRequestBuilderTest {
   }
 
   @Test
-  public void fail_if_bad_query() throws Exception {
+  public void fail_if_bad_query() {
     IndexRequestBuilder requestBuilder = esTester.client().prepareIndex("unknownIndex", "unknownType");
     try {
       requestBuilder.get();
@@ -73,7 +73,7 @@ public class ProxyIndexRequestBuilderTest {
   }
 
   @Test
-  public void fail_if_bad_query_with_basic_profiling() throws Exception {
+  public void fail_if_bad_query_with_basic_profiling() {
     IndexRequestBuilder requestBuilder = esTester.client().prepareIndex("unknownIndex", "unknownType");
     try {
       requestBuilder.get();
@@ -85,7 +85,7 @@ public class ProxyIndexRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareIndex(FakeIndexDefinition.INDEX, FakeIndexDefinition.TYPE).get("1");
       fail();
@@ -95,7 +95,7 @@ public class ProxyIndexRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareIndex(FakeIndexDefinition.INDEX, FakeIndexDefinition.TYPE).get(TimeValue.timeValueMinutes(1));
       fail();
@@ -105,7 +105,7 @@ public class ProxyIndexRequestBuilderTest {
   }
 
   @Test
-  public void do_not_support_execute_method() throws Exception {
+  public void do_not_support_execute_method() {
     try {
       esTester.client().prepareIndex(FakeIndexDefinition.INDEX, FakeIndexDefinition.TYPE).execute();
       fail();
index 56ffd57259999bdd3d076354e5bfc1e845433561..a45c31021473cd19ffd9ca9c04bd690a40706237 100644 (file)
@@ -56,7 +56,7 @@ public class ProxyIndicesExistsRequestBuilderTest {
   }
 
   @Test
-  public void fail_to_exists() throws Exception {
+  public void fail_to_exists() {
     try {
       esTester.client().prepareIndicesExist().get();
 
@@ -74,7 +74,7 @@ public class ProxyIndicesExistsRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareIndicesExist().get("1");
       fail();
@@ -84,7 +84,7 @@ public class ProxyIndicesExistsRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareIndicesExist().get(TimeValue.timeValueMinutes(1));
       fail();
@@ -94,7 +94,7 @@ public class ProxyIndicesExistsRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareIndicesExist().execute();
       fail();
index c9470f3fdaeb65d91e18688ed88adce79da61172..87ad6b8e18c5ea2f877923053116e4c0aed30c3e 100644 (file)
@@ -61,7 +61,7 @@ public class ProxyIndicesStatsRequestBuilderTest {
   }
 
   @Test
-  public void fail_to_stats() throws Exception {
+  public void fail_to_stats() {
     try {
       esTester.client().prepareStats("unknown").get();
       fail();
@@ -72,7 +72,7 @@ public class ProxyIndicesStatsRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareStats(FakeIndexDefinition.INDEX).get("1");
       fail();
@@ -82,7 +82,7 @@ public class ProxyIndicesStatsRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareStats(FakeIndexDefinition.INDEX).get(TimeValue.timeValueMinutes(1));
       fail();
@@ -92,7 +92,7 @@ public class ProxyIndicesStatsRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareStats(FakeIndexDefinition.INDEX).execute();
       fail();
index 482a197cfbd19b3bcbd0a7ff6247f5f74d2b3c5e..bf0ec8d9eeff7840508dc481bc6cd732cb815ddb 100644 (file)
@@ -74,7 +74,7 @@ public class ProxyMultiGetRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareMultiGet().get("1");
       fail();
@@ -84,7 +84,7 @@ public class ProxyMultiGetRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareMultiGet().get(TimeValue.timeValueMinutes(1));
       fail();
@@ -94,7 +94,7 @@ public class ProxyMultiGetRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareMultiGet().execute();
       fail();
index f94c744c2260007e8b9d4097bfbdf04fc3b3fd22..1035a9bc7434fbcb6e649b93633703095914d715 100644 (file)
@@ -61,7 +61,7 @@ public class ProxyNodesStatsRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareNodesStats(FakeIndexDefinition.INDEX).get("1");
       fail();
@@ -71,7 +71,7 @@ public class ProxyNodesStatsRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareNodesStats(FakeIndexDefinition.INDEX).get(TimeValue.timeValueMinutes(1));
       fail();
@@ -81,7 +81,7 @@ public class ProxyNodesStatsRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareNodesStats(FakeIndexDefinition.INDEX).execute();
       fail();
index 7a1aaaa62729485492e27220bf73001f1755c1f7..e9639abe0c0766c52ed683f91fb3043de3addff8 100644 (file)
@@ -76,7 +76,7 @@ public class ProxyPutMappingRequestBuilderTest {
   }
 
   @Test
-  public void fail_on_bad_query() throws Exception {
+  public void fail_on_bad_query() {
     try {
       esTester.client().preparePutMapping().get();
       fail();
@@ -87,7 +87,7 @@ public class ProxyPutMappingRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().preparePutMapping().get("1");
       fail();
@@ -97,7 +97,7 @@ public class ProxyPutMappingRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().preparePutMapping().get(TimeValue.timeValueMinutes(1));
       fail();
@@ -107,7 +107,7 @@ public class ProxyPutMappingRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().preparePutMapping().execute();
       fail();
index 089c7ebde8093ea47126dab1e517acced33cb00d..3f6e39b59e4acafc6d2f40501fd7367535923e29 100644 (file)
@@ -63,7 +63,7 @@ public class ProxyRefreshRequestBuilderTest {
   }
 
   @Test
-  public void fail_to_refresh() throws Exception {
+  public void fail_to_refresh() {
     try {
       esTester.client().prepareRefresh("unknown").get();
       fail();
@@ -74,7 +74,7 @@ public class ProxyRefreshRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareRefresh(FakeIndexDefinition.INDEX).get("1");
       fail();
@@ -84,7 +84,7 @@ public class ProxyRefreshRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareRefresh(FakeIndexDefinition.INDEX).get(TimeValue.timeValueMinutes(1));
       fail();
@@ -94,7 +94,7 @@ public class ProxyRefreshRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareRefresh(FakeIndexDefinition.INDEX).execute();
       fail();
index 8603d06183f9e14ab5f9ff20ff171bcc211d6f54..717c370b35e2dc5c7a26b72ecb48632fda5c4159 100644 (file)
@@ -62,7 +62,7 @@ public class ProxySearchRequestBuilderTest {
   }
 
   @Test
-  public void fail_to_search_bad_query() throws Exception {
+  public void fail_to_search_bad_query() {
     try {
       esTester.client().prepareSearch(FakeIndexDefinition.INDEX).setQuery("bad query").get();
       fail();
@@ -73,7 +73,7 @@ public class ProxySearchRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareSearch(FakeIndexDefinition.INDEX).get("1");
       fail();
@@ -83,7 +83,7 @@ public class ProxySearchRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareSearch(FakeIndexDefinition.INDEX).get(TimeValue.timeValueMinutes(1));
       fail();
@@ -93,7 +93,7 @@ public class ProxySearchRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareSearch(FakeIndexDefinition.INDEX).execute();
       fail();
index 2b984e53eb45c57b2731f416bda9f200e11ef04f..d3daefcd30c92c05eea26d702739551e3764cd82 100644 (file)
@@ -69,7 +69,7 @@ public class ProxySearchScrollRequestBuilderTest {
   }
 
   @Test
-  public void fail_to_search_bad_query() throws Exception {
+  public void fail_to_search_bad_query() {
     try {
       esTester.client().prepareSearchScroll("unknown").get();
       fail();
@@ -80,7 +80,7 @@ public class ProxySearchScrollRequestBuilderTest {
   }
 
   @Test
-  public void get_with_string_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_string_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareSearchScroll("scrollId").get("1");
       fail();
@@ -90,7 +90,7 @@ public class ProxySearchScrollRequestBuilderTest {
   }
 
   @Test
-  public void get_with_time_value_timeout_is_not_yet_implemented() throws Exception {
+  public void get_with_time_value_timeout_is_not_yet_implemented() {
     try {
       esTester.client().prepareSearchScroll("scrollId").get(TimeValue.timeValueMinutes(1));
       fail();
@@ -100,7 +100,7 @@ public class ProxySearchScrollRequestBuilderTest {
   }
 
   @Test
-  public void execute_should_throw_an_unsupported_operation_exception() throws Exception {
+  public void execute_should_throw_an_unsupported_operation_exception() {
     try {
       esTester.client().prepareSearchScroll("scrollId").execute();
       fail();
index 9068f1cce32397e2bfc3d845439ebee1a1ef05e4..7639a6260bc2ea53c1f98f8fddf045dfad0ae36e 100644 (file)
@@ -45,19 +45,19 @@ public class EventDaoTest {
   EventDao dao;
 
   @Before
-  public void setup() throws Exception {
+  public void setup() {
     dbTester.truncateTables();
     session = dbTester.myBatis().openSession(false);
     dao = new EventDao();
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void select_by_component_uuid() throws Exception {
+  public void select_by_component_uuid() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     List<EventDto> dtos = dao.selectByComponentUuid(session, "ABCD");
@@ -79,7 +79,7 @@ public class EventDaoTest {
   }
 
   @Test
-  public void return_different_categories() throws Exception {
+  public void return_different_categories() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     List<EventDto> dtos = dao.selectByComponentUuid(session, "ABCD");
@@ -87,7 +87,7 @@ public class EventDaoTest {
   }
 
   @Test
-  public void insert() throws Exception {
+  public void insert() {
     dbTester.prepareDbUnit(getClass(), "empty.xml");
 
     dao.insert(session, new EventDto()
@@ -106,7 +106,7 @@ public class EventDaoTest {
   }
 
   @Test
-  public void delete() throws Exception {
+  public void delete() {
     dbTester.prepareDbUnit(getClass(), "delete.xml");
 
     dao.delete(session, 1L);
index 3708610ccfdbe0881522d031eff3444f47d07158..8a9137903c994e813e527c68d2e3652f09b9a31f 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class BadRequestExceptionTest {
 
   @Test
-  public void text_error() throws Exception {
+  public void text_error() {
     BadRequestException exception = new BadRequestException("error");
     assertThat(exception.getMessage()).isEqualTo("error");
   }
index 4196a58ce29e5ed86179ab5c58146be6b8aae914..ea17a0554ce465bdc41532fec81e614718588bc8 100644 (file)
@@ -56,7 +56,7 @@ public class MessageTest {
   }
 
   @Test
-  public void to_string() throws Exception {
+  public void to_string() {
     assertThat(Message.of("key1", "param1").toString()).isEqualTo("Message{key=key1, params=[param1]}");
     assertThat(Message.of("key1").toString()).isEqualTo("Message{key=key1, params=[]}");
   }
index 7d5398d215c9f7761375a3ac868d37c87f8255b3..aa520c2e7c5bff112bb1ff2be21ea66a699258a5 100644 (file)
@@ -27,7 +27,7 @@ import static org.junit.Assert.fail;
 public class VerificationsTest {
 
   @Test
-  public void check() throws Exception {
+  public void check() {
     // no exception
     Verifications.check(true, "my.l10n.key", "foo", "bar");
 
index d92f272fc196bd18ea78ca39014c51e6424f3bc6..d525662371cb2109d13ded44165d3bc49d2adc7a 100644 (file)
@@ -73,7 +73,7 @@ public class AddTagsActionTest {
   }
 
   @Test
-  public void should_fail_if_tag_is_not_valid() throws Exception {
+  public void should_fail_if_tag_is_not_valid() {
     throwable.expect(IllegalArgumentException.class);
     throwable.expectMessage("Tag 'th ag' is invalid. Rule tags accept only the characters: a-z, 0-9, '+', '-', '#', '.'");
 
index 26ac975139af4080f17627d5fe2ffa27d8555496..559837dd7169795dd7236e053e063dcee9ddc9d0 100644 (file)
@@ -74,7 +74,7 @@ public class AssignActionTest {
   }
 
   @Test
-  public void should_fail_if_assignee_is_not_verified() throws Exception {
+  public void should_fail_if_assignee_is_not_verified() {
     throwable.expect(IllegalArgumentException.class);
     throwable.expectMessage("Assignee is missing from the execution parameters");
 
index 245e45234d68859835c717ad14aebdfef7917188..b8a0999686120e7bba67d39135363e48413ad237 100644 (file)
@@ -99,32 +99,32 @@ public class InternalRubyIssueServiceTest {
   }
 
   @Test
-  public void get_issue_by_key() throws Exception {
+  public void get_issue_by_key() {
     service.getIssueByKey("ABCD");
     verify(issueService).getByKey("ABCD");
   }
 
   @Test
-  public void list_transitions_by_issue_key() throws Exception {
+  public void list_transitions_by_issue_key() {
     service.listTransitions("ABCD");
     verify(issueService).listTransitions(eq("ABCD"));
   }
 
   @Test
-  public void list_transitions_by_issue() throws Exception {
+  public void list_transitions_by_issue() {
     Issue issue = new DefaultIssue().setKey("ABCD");
     service.listTransitions(issue);
     verify(issueService).listTransitions(eq(issue));
   }
 
   @Test
-  public void list_status() throws Exception {
+  public void list_status() {
     service.listStatus();
     verify(issueService).listStatus();
   }
 
   @Test
-  public void list_resolutions() throws Exception {
+  public void list_resolutions() {
     assertThat(service.listResolutions()).isEqualTo(Issue.RESOLUTIONS);
   }
 
@@ -151,7 +151,7 @@ public class InternalRubyIssueServiceTest {
   }
 
   @Test
-  public void do_transition() throws Exception {
+  public void do_transition() {
     service.doTransition("ABCD", Issue.STATUS_RESOLVED);
     verify(issueService).doTransition(eq("ABCD"), eq(Issue.STATUS_RESOLVED));
   }
@@ -695,14 +695,14 @@ public class InternalRubyIssueServiceTest {
   }
 
   @Test
-  public void list_tags() throws Exception {
+  public void list_tags() {
     List<String> tags = Arrays.asList("tag1", "tag2", "tag3");
     when(issueService.listTags(null, 0)).thenReturn(tags);
     assertThat(service.listTags()).isEqualTo(tags);
   }
 
   @Test
-  public void list_tags_for_component() throws Exception {
+  public void list_tags_for_component() {
     Map<String, Long> tags = ImmutableMap.of("tag1", 1L, "tag2", 2L, "tag3", 3L);
     int pageSize = 42;
     IssueQuery query = IssueQuery.builder().build();
index 65fe47c44cf24ba114f1eeb91d7eaf5fc550fc75..62340cd33f724b6eea6422d811fc400899cc466c 100644 (file)
@@ -74,7 +74,7 @@ public class IssueBulkChangeServiceMediumTest {
   UserSession userSession;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     session = db.openSession(false);
@@ -108,7 +108,7 @@ public class IssueBulkChangeServiceMediumTest {
   }
 
   @Test
-  public void bulk_change() throws Exception {
+  public void bulk_change() {
     UserDto user = new UserDto().setLogin("fred").setName("Fred");
     db.userDao().insert(session, user);
 
@@ -130,7 +130,7 @@ public class IssueBulkChangeServiceMediumTest {
   }
 
   @Test
-  public void bulk_change_on_500_issues() throws Exception {
+  public void bulk_change_on_500_issues() {
     List<String> issueKeys = newArrayList();
     for (int i = 0; i < 500; i++) {
       IssueDto issue = IssueTesting.newDto(rule, file, project).setStatus(Issue.STATUS_OPEN);
@@ -152,7 +152,7 @@ public class IssueBulkChangeServiceMediumTest {
   }
 
   @Test
-  public void fail_if_bulk_change_on_more_than_500_issues() throws Exception {
+  public void fail_if_bulk_change_on_more_than_500_issues() {
     List<String> issueKeys = newArrayList();
     for (int i = 0; i < 510; i++) {
       issueKeys.add("issue-" + i);
index 2c56df4a0703566991c1519ceb161ea11945b270..d4d333d171b2cfa056ce0a569b0b9ea4bbb76734 100644 (file)
@@ -57,12 +57,12 @@ public class IssueChangelogServiceTest {
   IssueChangelogService service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     service = new IssueChangelogService(changeDao, userFinder, issueService, formatter);
   }
 
   @Test
-  public void load_changelog_and_related_users() throws Exception {
+  public void load_changelog_and_related_users() {
     FieldDiffs userChange = new FieldDiffs().setUserLogin("arthur").setDiff("severity", "MAJOR", "BLOCKER");
     FieldDiffs scanChange = new FieldDiffs().setDiff("status", "RESOLVED", "CLOSED");
     when(changeDao.selectChangelogByIssue("ABCDE")).thenReturn(Arrays.asList(userChange, scanChange));
@@ -80,7 +80,7 @@ public class IssueChangelogServiceTest {
   }
 
   @Test
-  public void format_diffs() throws Exception {
+  public void format_diffs() {
     FieldDiffs diffs = new FieldDiffs().setUserLogin("arthur").setDiff("severity", "MAJOR", "BLOCKER");
     MockUserSession.set();
     service.formatDiffs(diffs);
index ccbd8422d61618b464aaae06f71fe6b6ad9fb034..f95030fe975a0350470232210040db14bd4c9dab 100644 (file)
@@ -70,7 +70,7 @@ public class IssueCommentServiceMediumTest {
   ComponentDto file;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     indexClient = tester.get(IndexClient.class);
@@ -105,7 +105,7 @@ public class IssueCommentServiceMediumTest {
   }
 
   @Test
-  public void add_comment() throws Exception {
+  public void add_comment() {
     IssueDto issue = IssueTesting.newDto(rule, file, project);
     tester.get(IssueDao.class).insert(session, issue);
     session.commit();
@@ -119,7 +119,7 @@ public class IssueCommentServiceMediumTest {
   }
 
   @Test
-  public void add_comment_on_removed_issue() throws Exception {
+  public void add_comment_on_removed_issue() {
     RuleDto removedRule = RuleTesting.newDto(RuleKey.of("removed", "rule")).setStatus(RuleStatus.REMOVED);
     tester.get(RuleDao.class).insert(session, removedRule);
 
index 90fcbff51b3fcd49216228cce8446534e453d950..39bb1d63e0df0305fe3b868880ead22119549765 100644 (file)
@@ -91,19 +91,19 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void find_comments() throws Exception {
+  public void find_comments() {
     issueCommentService.findComments("ABCD");
     verify(changeDao).selectCommentsByIssues(session, newArrayList("ABCD"));
   }
 
   @Test
-  public void should_find_comment() throws Exception {
+  public void should_find_comment() {
     issueCommentService.findComment("ABCD");
     verify(changeDao).selectCommentByKey("ABCD");
   }
 
   @Test
-  public void should_add_comment() throws Exception {
+  public void should_add_comment() {
     IssueDto issueDto = IssueTesting.newDto(RuleTesting.newXooX1().setId(500), ComponentTesting.newFileDto(ComponentTesting.newProjectDto()), ComponentTesting.newProjectDto());
     when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issueDto);
     when(issueCommentService.findComments(session, "ABCD")).thenReturn(newArrayList(new DefaultIssueComment()));
@@ -115,7 +115,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_be_logged_when_adding_comment() throws Exception {
+  public void should_be_logged_when_adding_comment() {
     throwable.expect(UnauthorizedException.class);
 
     MockUserSession.set().setLogin(null);
@@ -127,7 +127,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_prevent_adding_empty_comment() throws Exception {
+  public void should_prevent_adding_empty_comment() {
     throwable.expect(BadRequestException.class);
 
     issueCommentService.addComment("myIssue", " ", MockUserSession.get());
@@ -137,7 +137,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_prevent_adding_null_comment() throws Exception {
+  public void should_prevent_adding_null_comment() {
     throwable.expect(BadRequestException.class);
 
     issueCommentService.addComment("myIssue", null, MockUserSession.get());
@@ -147,7 +147,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void fail_if_comment_not_inserted_in_db() throws Exception {
+  public void fail_if_comment_not_inserted_in_db() {
     IssueDto issueDto = IssueTesting.newDto(RuleTesting.newXooX1().setId(500), ComponentTesting.newFileDto(ComponentTesting.newProjectDto()), ComponentTesting.newProjectDto());
     when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issueDto);
     // Comment has not be inserted in db
@@ -162,7 +162,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_delete_comment() throws Exception {
+  public void should_delete_comment() {
     when(changeDao.selectCommentByKey("ABCD")).thenReturn(new DefaultIssueComment().setUserLogin("admin").setIssueKey("EFGH"));
 
     issueCommentService.deleteComment("ABCD", MockUserSession.get());
@@ -172,7 +172,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_not_delete_not_found_comment() throws Exception {
+  public void should_not_delete_not_found_comment() {
     throwable.expect(NotFoundException.class);
 
     when(changeDao.selectCommentByKey("ABCD")).thenReturn(null);
@@ -183,7 +183,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_prevent_delete_others_comment() throws Exception {
+  public void should_prevent_delete_others_comment() {
     throwable.expect(ForbiddenException.class);
 
     when(changeDao.selectCommentByKey("ABCD")).thenReturn(new DefaultIssueComment().setUserLogin("julien"));
@@ -194,7 +194,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_update_comment() throws Exception {
+  public void should_update_comment() {
     when(changeDao.selectCommentByKey("ABCD")).thenReturn(new DefaultIssueComment().setIssueKey("EFGH").setUserLogin("admin"));
 
     issueCommentService.editComment("ABCD", "updated comment", MockUserSession.get());
@@ -204,7 +204,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_not_update_not_found_comment() throws Exception {
+  public void should_not_update_not_found_comment() {
     throwable.expect(NotFoundException.class);
 
     when(changeDao.selectCommentByKey("ABCD")).thenReturn(null);
@@ -215,7 +215,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_prevent_updating_empty_comment() throws Exception {
+  public void should_prevent_updating_empty_comment() {
     throwable.expect(BadRequestException.class);
 
     issueCommentService.editComment("ABCD", "", MockUserSession.get());
@@ -224,7 +224,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_prevent_updating_null_comment() throws Exception {
+  public void should_prevent_updating_null_comment() {
     throwable.expect(BadRequestException.class);
 
     issueCommentService.editComment("ABCD", null, MockUserSession.get());
@@ -233,7 +233,7 @@ public class IssueCommentServiceTest {
   }
 
   @Test
-  public void should_prevent_updating_others_comment() throws Exception {
+  public void should_prevent_updating_others_comment() {
     throwable.expect(ForbiddenException.class);
 
     when(changeDao.selectCommentByKey("ABCD")).thenReturn(new DefaultIssueComment().setUserLogin("julien"));
index 4e0db201be03c5a906281ee54e130066ad40ee87..4b1645ef987ce6577bca1b04c0a69bba148189a9 100644 (file)
@@ -82,7 +82,7 @@ public class IssueQueryServiceTest {
   IssueQueryService issueQueryService;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(dbClient.openSession(false)).thenReturn(session);
     when(dbClient.componentDao()).thenReturn(componentDao);
     when(dbClient.authorDao()).thenReturn(authorDao);
@@ -242,7 +242,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_in_tree_with_component_root_uuids_but_unknown_qualifiers() throws Exception {
+  public void should_search_in_tree_with_component_root_uuids_but_unknown_qualifiers() {
     Map<String, Object> map = newHashMap();
     map.put("componentRootUuids", newArrayList("ABCD"));
 
@@ -254,7 +254,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_in_tree_with_component_roots_but_different_qualifiers() throws Exception {
+  public void should_search_in_tree_with_component_roots_but_different_qualifiers() {
     Map<String, Object> map = newHashMap();
     map.put("componentRoots", newArrayList("org.apache.struts:struts", "org.codehaus.sonar:sonar-server"));
 
@@ -270,7 +270,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_in_tree_with_view() throws Exception {
+  public void should_search_in_tree_with_view() {
     String viewUuid = "ABCD";
     Map<String, Object> map = newHashMap();
     map.put("componentRootUuids", newArrayList(viewUuid));
@@ -285,7 +285,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_in_tree_with_subview_but_bad_permissions() throws Exception {
+  public void should_search_in_tree_with_subview_but_bad_permissions() {
     String subViewUuid = "ABCD";
     Map<String, Object> map = newHashMap();
     map.put("componentRootUuids", newArrayList(subViewUuid));
@@ -299,7 +299,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_in_tree_with_project_uuid() throws Exception {
+  public void should_search_in_tree_with_project_uuid() {
     String projectUuid = "ABCD";
     Map<String, Object> map = newHashMap();
     map.put("componentUuids", newArrayList(projectUuid));
@@ -312,7 +312,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_on_component_only_with_project_key() throws Exception {
+  public void should_search_on_component_only_with_project_key() {
     String projectKey = "org.apache.struts:struts";
     String projectUuid = "ABCD";
     Map<String, Object> map = newHashMap();
@@ -329,7 +329,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_on_developer() throws Exception {
+  public void should_search_on_developer() {
     String devUuid = "DEV:anakin.skywalker";
     String login1 = "anakin@skywalker.name";
     String login2 = "darth.vader";
@@ -344,7 +344,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_override_authors_when_searching_on_developer() throws Exception {
+  public void should_override_authors_when_searching_on_developer() {
     String devUuid = "DEV:anakin.skywalker";
     String login = "anakin@skywalker.name";
     Map<String, Object> map = newHashMap();
@@ -358,7 +358,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_on_developer_technical_project() throws Exception {
+  public void should_search_on_developer_technical_project() {
     String projectUuid = "sample1";
     String devUuid = "DEV:anakin.skywalker";
     String login1 = "anakin@skywalker.name";
@@ -383,7 +383,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_in_tree_with_module_uuid() throws Exception {
+  public void should_search_in_tree_with_module_uuid() {
     String moduleUuid = "ABCD";
     Map<String, Object> map = newHashMap();
     map.put("componentUuids", newArrayList(moduleUuid));
@@ -396,7 +396,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_in_tree_with_directory_uuid() throws Exception {
+  public void should_search_in_tree_with_directory_uuid() {
     String directoryUuid = "ABCD";
     String directoryPath = "/some/module/relative/path";
     String moduleUuid = "BCDE";
@@ -413,7 +413,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_on_source_file() throws Exception {
+  public void should_search_on_source_file() {
     String fileUuid = "ABCD";
     Map<String, Object> map = newHashMap();
     map.put("componentUuids", newArrayList(fileUuid));
@@ -425,7 +425,7 @@ public class IssueQueryServiceTest {
   }
 
   @Test
-  public void should_search_on_test_file() throws Exception {
+  public void should_search_on_test_file() {
     String fileUuid = "ABCD";
     Map<String, Object> map = newHashMap();
     map.put("componentUuids", newArrayList(fileUuid));
index 379dd6395b9553415967eb27a571d1d5f578161b..5af86be2654ab2d443454ea6d8c5b16b3820d687 100644 (file)
@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class IssueQueryTest {
 
   @Test
-  public void build_query() throws Exception {
+  public void build_query() {
     IssueQuery query = IssueQuery.builder()
       .issueKeys(newArrayList("ABCDE"))
       .severities(newArrayList(Severity.BLOCKER))
@@ -81,7 +81,7 @@ public class IssueQueryTest {
   }
 
   @Test
-  public void build_query_without_dates() throws Exception {
+  public void build_query_without_dates() {
     IssueQuery query = IssueQuery.builder()
       .issueKeys(newArrayList("ABCDE"))
       .createdAfter(null)
@@ -96,7 +96,7 @@ public class IssueQueryTest {
   }
 
   @Test
-  public void throw_exception_if_sort_is_not_valid() throws Exception {
+  public void throw_exception_if_sort_is_not_valid() {
     try {
       IssueQuery.builder()
         .sort("UNKNOWN")
@@ -107,7 +107,7 @@ public class IssueQueryTest {
   }
 
   @Test
-  public void collection_params_should_not_be_null_but_empty() throws Exception {
+  public void collection_params_should_not_be_null_but_empty() {
     IssueQuery query = IssueQuery.builder()
       .issueKeys(null)
       .componentUuids(null)
@@ -161,7 +161,7 @@ public class IssueQueryTest {
   }
 
   @Test
-  public void should_accept_null_sort() throws Exception {
+  public void should_accept_null_sort() {
     IssueQuery query = IssueQuery.builder().sort(null).build();
     assertThat(query.sort()).isNull();
   }
index a16bbdbe9177808a98d60dea309032d49c0520e7..7a12ce178c2384291025a289b99aa39c33a82079 100644 (file)
@@ -87,7 +87,7 @@ public class IssueServiceMediumTest {
   IssueService service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     IssueIndex = tester.get(IssueIndex.class);
@@ -105,7 +105,7 @@ public class IssueServiceMediumTest {
   }
 
   @Test
-  public void get_by_key() throws Exception {
+  public void get_by_key() {
     RuleDto rule = newRule();
     ComponentDto project = newProject();
     ComponentDto file = newFile(project);
@@ -115,7 +115,7 @@ public class IssueServiceMediumTest {
   }
 
   @Test
-  public void can_facet() throws Exception {
+  public void can_facet() {
     RuleDto rule = newRule();
     ComponentDto project = newProject();
     ComponentDto file = newFile(project);
index 53ee7d8d03ce3a498f1e7cbd59b4c7da2f7bdedd..ad8ca76dedde6625171d48e1312bc6cac8cfca0d 100644 (file)
@@ -73,7 +73,7 @@ public class PlanActionTest {
   }
 
   @Test
-  public void should_fail_on_unverified_action_plan() throws Exception {
+  public void should_fail_on_unverified_action_plan() {
     throwable.expect(IllegalArgumentException.class);
     throwable.expectMessage("Action plan is missing from the execution parameters");
 
@@ -124,7 +124,7 @@ public class PlanActionTest {
   }
 
   @Test
-  public void should_unplan_if_action_plan_is_empty() throws Exception {
+  public void should_unplan_if_action_plan_is_empty() {
     String planKey = "";
     Map<String, Object> properties = newHashMap();
     properties.put("plan", planKey);
index 24194997643fff4a8446d7c524bbda8a419ba0af..7280f972a34340df46d487a8fe6c43b72c53fa4a 100644 (file)
@@ -73,7 +73,7 @@ public class RemoveTagsActionTest {
   }
 
   @Test
-  public void should_fail_if_tag_is_not_valid() throws Exception {
+  public void should_fail_if_tag_is_not_valid() {
     throwable.expect(IllegalArgumentException.class);
     throwable.expectMessage("Tag 'th ag' is invalid. Rule tags accept only the characters: a-z, 0-9, '+', '-', '#', '.'");
 
index 9931c01354c3056d2f2644db46f5a153fcf67252..08e41c95fca5ac1e466b7df421ef7e829799651c 100644 (file)
@@ -30,13 +30,13 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class RulesAggregationTest {
 
   @Test
-  public void empty() throws Exception {
+  public void empty() {
     RulesAggregation rulesAggregation = new RulesAggregation();
     assertThat(rulesAggregation.rules()).isEmpty();
   }
 
   @Test
-  public void count_rules() throws Exception {
+  public void count_rules() {
     RulesAggregation rulesAggregation = new RulesAggregation();
     RuleKey ruleKey = RuleKey.of("xoo", "S001");
     RuleDto ruleDto = RuleTesting.newDto(ruleKey).setName("Rule name");
@@ -51,7 +51,7 @@ public class RulesAggregationTest {
   }
 
   @Test
-  public void count_rules_with_different_rules() throws Exception {
+  public void count_rules_with_different_rules() {
     RulesAggregation rulesAggregation = new RulesAggregation();
 
     RuleDto ruleDto = RuleTesting.newDto(RuleKey.of("xoo", "S001")).setName("Rule name 1");
index afca99bb5f4abf0382e1ec1a81d67e645dbdea70..d5bd46f28679a8c4ca4492eb06752bd40c4c4358 100644 (file)
@@ -69,12 +69,12 @@ public class ServerIssueStorageTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void load_component_id_from_db() throws Exception {
+  public void load_component_id_from_db() {
     setupData("load_component_id_from_db");
     session.commit();
 
@@ -84,7 +84,7 @@ public class ServerIssueStorageTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void load_project_id_from_db() throws Exception {
+  public void load_project_id_from_db() {
     setupData("load_project_id_from_db");
     session.commit();
 
@@ -94,7 +94,7 @@ public class ServerIssueStorageTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_insert_new_issues() throws Exception {
+  public void should_insert_new_issues() {
     setupData("should_insert_new_issues");
 
     DefaultIssueComment comment = DefaultIssueComment.create("ABCDE", "emmerik", "the comment");
@@ -128,7 +128,7 @@ public class ServerIssueStorageTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_update_issues() throws Exception {
+  public void should_update_issues() {
     setupData("should_update_issues");
 
     IssueChangeContext context = IssueChangeContext.createUser(new Date(), "emmerik");
index 433c78b1895e3904d9dc429a5acae60c0892d1a8..77249d2685a89d8ea9fe332589a229f5b2a47715 100644 (file)
@@ -32,7 +32,7 @@ public class ActionPlanWsTest {
   WsTester tester = new WsTester(new ActionPlanWs());
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     WebService.Controller controller = tester.controller("api/action_plans");
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
@@ -40,7 +40,7 @@ public class ActionPlanWsTest {
   }
 
   @Test
-  public void define_search_action() throws Exception {
+  public void define_search_action() {
     WebService.Controller controller = tester.controller("api/action_plans");
 
     WebService.Action action = controller.action("search");
@@ -51,7 +51,7 @@ public class ActionPlanWsTest {
   }
 
   @Test
-  public void define_create_action() throws Exception {
+  public void define_create_action() {
     WebService.Controller controller = tester.controller("api/action_plans");
 
     WebService.Action action = controller.action("create");
@@ -61,7 +61,7 @@ public class ActionPlanWsTest {
   }
 
   @Test
-  public void define_delete_action() throws Exception {
+  public void define_delete_action() {
     WebService.Controller controller = tester.controller("api/action_plans");
 
     WebService.Action action = controller.action("delete");
@@ -71,7 +71,7 @@ public class ActionPlanWsTest {
   }
 
   @Test
-  public void define_update_action() throws Exception {
+  public void define_update_action() {
     WebService.Controller controller = tester.controller("api/action_plans");
 
     WebService.Action action = controller.action("update");
@@ -81,7 +81,7 @@ public class ActionPlanWsTest {
   }
 
   @Test
-  public void define_open_action() throws Exception {
+  public void define_open_action() {
     WebService.Controller controller = tester.controller("api/action_plans");
 
     WebService.Action action = controller.action("open");
@@ -91,7 +91,7 @@ public class ActionPlanWsTest {
   }
 
   @Test
-  public void define_close_action() throws Exception {
+  public void define_close_action() {
     WebService.Controller controller = tester.controller("api/action_plans");
 
     WebService.Action action = controller.action("close");
index 7a6f9a6f0e271d13cce1aa782e515bee2fc49adf..4c89e886a8b95e30423ab8e15e11c459768073b6 100644 (file)
@@ -40,7 +40,7 @@ public class IssueDaoTest extends AbstractDaoTestCase {
   private DbSession session;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     this.session = getMyBatis().openSession(false);
     this.sut = new IssueDao(getMyBatis());
   }
@@ -130,7 +130,7 @@ public class IssueDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void insert() throws Exception {
+  public void insert() {
     IssueDto dto = new IssueDto();
     dto.setComponent(new ComponentDto().setKey("struts:Action").setId(123L).setUuid("component-uuid"));
     dto.setProject(new ComponentDto().setKey("struts").setId(100L).setUuid("project-uuid"));
index 68798c173b771ab63712b5ac7df75d7a5fd89b6f..b36e727f2d7f67ea27c1110319c384b9da3fb9f9 100644 (file)
@@ -47,7 +47,7 @@ public class AppActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     action = new AppAction(service, writer);
     tester = new WsTester(new IssueFilterWs(action, mock(ShowAction.class), mock(FavoritesAction.class)));
   }
index 35bce3508179c3ea18c7882cc8583abe8385314a..4d4b0816f14fa3dd4a32b8a053733aa6a824a2de 100644 (file)
@@ -48,7 +48,7 @@ public class FavoritesActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     action = new FavoritesAction(service);
     tester = new WsTester(new IssueFilterWs(mock(AppAction.class), mock(ShowAction.class), action));
   }
index 95041c468b10936a78d936afb8857cf694557448..5faa9e0163f44c2ed1e7c7972d4c3f8ae01d8a92 100644 (file)
@@ -391,7 +391,7 @@ public class IssueFilterServiceTest {
   }
 
   @Test
-  public void should_change_shared_filter_ownership_when_admin() throws Exception {
+  public void should_change_shared_filter_ownership_when_admin() {
     IssueFilterDto sharedFilter = new IssueFilterDto().setId(1L).setName("My filter").setUserLogin("former.owner").setShared(true);
     IssueFilterDto expectedDto = new IssueFilterDto().setName("My filter").setUserLogin("new.owner").setShared(true);
 
@@ -409,7 +409,7 @@ public class IssueFilterServiceTest {
   }
 
   @Test
-  public void should_deny_filter_ownership_change_when_not_admin() throws Exception {
+  public void should_deny_filter_ownership_change_when_not_admin() {
     String currentUser = "dave.loper";
     IssueFilterDto sharedFilter = new IssueFilterDto().setId(1L).setName("My filter").setUserLogin(currentUser).setShared(true);
 
@@ -675,7 +675,7 @@ public class IssueFilterServiceTest {
   }
 
   @Test
-  public void should_create_filter_provided_by_platform() throws Exception {
+  public void should_create_filter_provided_by_platform() {
 
     ArgumentCaptor<IssueFilterDto> filterCaptor = ArgumentCaptor.forClass(IssueFilterDto.class);
 
index a468eeb70ad50dbd6c966aa80cd5cc11188d1e76..a02a6c1fad08a4693d01e66de420172da9d00d40 100644 (file)
@@ -36,7 +36,7 @@ public class IssueFilterWriterTest {
   IssueFilterWriter writer = new IssueFilterWriter();
 
   @Test
-  public void write_filter() throws Exception {
+  public void write_filter() {
     UserSession userSession = MockUserSession.set();
     test(userSession,
       new IssueFilterDto()
@@ -58,7 +58,7 @@ public class IssueFilterWriterTest {
   }
 
   @Test
-  public void can_modify_if_logged_user_own_filter() throws Exception {
+  public void can_modify_if_logged_user_own_filter() {
     UserSession userSession = MockUserSession.set().setLogin("simon");
     test(userSession,
       new IssueFilterDto()
@@ -80,7 +80,7 @@ public class IssueFilterWriterTest {
   }
 
   @Test
-  public void can_modify_if_logged_user_has_permission() throws Exception {
+  public void can_modify_if_logged_user_has_permission() {
     UserSession userSession = MockUserSession.set().setLogin("simon").setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
     test(userSession,
       new IssueFilterDto()
index 6a6e902af5b358ade939b649e39cb227643f6bd7..f85e678d89f66e48d888a9039754babc7db8e6ac 100644 (file)
@@ -43,13 +43,13 @@ public class IssueFilterWsTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     ws = new IssueFilterWs(new AppAction(service, issueFilterWriter), new ShowAction(service, issueFilterWriter), new FavoritesAction(service));
     tester = new WsTester(ws);
   }
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WebService.Controller controller = tester.controller("api/issue_filters");
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
index b91822f36360f661e114db0d6bfc72878e65f4da..4d686c113d258a6416366df44a20dd533948ef82 100644 (file)
@@ -46,7 +46,7 @@ public class RegisterIssueFiltersTest {
   private System2 system;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     IssueFilterDao issueFilterDao = new IssueFilterDao(db.myBatis());
     LoadedTemplateDao loadedTemplateDao = new LoadedTemplateDao(db.myBatis());
     system = mock(System2.class);
@@ -54,7 +54,7 @@ public class RegisterIssueFiltersTest {
   }
 
   @Test
-  public void should_do_nothing_if_not_needed() throws Exception {
+  public void should_do_nothing_if_not_needed() {
     db.prepareDbUnit(getClass(), "do_nothing.xml");
     taskUnderTest.start();
     taskUnderTest.stop();
@@ -62,7 +62,7 @@ public class RegisterIssueFiltersTest {
   }
 
   @Test
-  public void should_register_issue_filters() throws Exception {
+  public void should_register_issue_filters() {
     Date now = DateUtils.parseDateTime("2011-04-25T01:15:00+0200");
     when(system.now()).thenReturn(now.getTime());
 
index 8c1d38b96e4eb43c8437090150bb0a0a1911804e..7642f62d48a2d0a9e3997f5d76e187349216df55 100644 (file)
@@ -48,7 +48,7 @@ public class ShowActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     action = new ShowAction(service, writer);
     tester = new WsTester(new IssueFilterWs(mock(AppAction.class), action, mock(FavoritesAction.class)));
   }
index 271802674c1d9bfeebef4e55cd92a1c0f1bba426..f4a3cfe9f8f5a31e8c043262ba6c544af6328390 100644 (file)
@@ -54,12 +54,12 @@ public class IssueAuthorizationDaoTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     DbUtils.closeQuietly(connection);
   }
 
   @Test
-  public void select_all() throws Exception {
+  public void select_all() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     Collection<IssueAuthorizationDao.Dto> dtos = dao.selectAfterDate(client, connection, 0L);
@@ -77,7 +77,7 @@ public class IssueAuthorizationDaoTest {
   }
 
   @Test
-  public void select_after_date() throws Exception {
+  public void select_after_date() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     Collection<IssueAuthorizationDao.Dto> dtos = dao.selectAfterDate(client, connection, 1500000000L);
@@ -91,7 +91,7 @@ public class IssueAuthorizationDaoTest {
   }
 
   @Test
-  public void no_authorization() throws Exception {
+  public void no_authorization() {
     dbTester.prepareDbUnit(getClass(), "no_authorization.xml");
 
     Collection<IssueAuthorizationDao.Dto> dtos = dao.selectAfterDate(client, connection, 0L);
index 6bfe8928e9bc10ad5aa54704394be9939fa4a036..9c125a65c2cdac878946644a00944241d0b064da 100644 (file)
@@ -46,13 +46,13 @@ public class IssueAuthorizationIndexerTest {
   public static EsTester esTester = new EsTester().addDefinitions(new IssueIndexDefinition(new Settings()));
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     esTester.truncateIndices();
   }
 
   @Test
-  public void index_nothing() throws Exception {
+  public void index_nothing() {
     IssueAuthorizationIndexer indexer = createIndexer();
     indexer.index();
 
@@ -60,7 +60,7 @@ public class IssueAuthorizationIndexerTest {
   }
 
   @Test
-  public void index() throws Exception {
+  public void index() {
     dbTester.prepareDbUnit(getClass(), "index.xml");
 
     IssueAuthorizationIndexer indexer = createIndexer();
@@ -80,14 +80,14 @@ public class IssueAuthorizationIndexerTest {
   }
 
   @Test
-  public void do_not_fail_when_deleting_unindexed_project() throws Exception {
+  public void do_not_fail_when_deleting_unindexed_project() {
     IssueAuthorizationIndexer indexer = createIndexer();
     indexer.deleteProject("UNKNOWN", true);
     assertThat(esTester.countDocuments("issues", "authorization")).isZero();
   }
 
   @Test
-  public void delete_permissions() throws Exception {
+  public void delete_permissions() {
     IssueAuthorizationIndexer indexer = createIndexer();
     IssueAuthorizationDao.Dto authorization = new IssueAuthorizationDao.Dto("ABC", System.currentTimeMillis());
     authorization.addUser("guy");
index 65b41afdedfa0ced0d885762c6b1487241476aad..869df3280d1bb945e2e4e1db79b8a711d115f799 100644 (file)
@@ -32,7 +32,7 @@ public class IssueIndexDefinitionTest {
   IndexDefinition.IndexDefinitionContext context = new IndexDefinition.IndexDefinitionContext();
 
   @Test
-  public void define() throws Exception {
+  public void define() {
     IssueIndexDefinition def = new IssueIndexDefinition(new Settings());
     def.define(context);
 
@@ -47,7 +47,7 @@ public class IssueIndexDefinitionTest {
   }
 
   @Test
-  public void enable_cluster() throws Exception {
+  public void enable_cluster() {
     Settings settings = new Settings();
     settings.setProperty(ProcessProperties.CLUSTER_ACTIVATE, true);
     IssueIndexDefinition def = new IssueIndexDefinition(settings);
index a1e7ed70107ed171def9fa4121e26a271c0bce33..30b6b500075e93ec4894b57c152600417eeb5aff 100644 (file)
@@ -71,7 +71,7 @@ public class IssueIndexTest {
   ViewIndexer viewIndexer;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.truncateIndices();
     issueIndexer = new IssueIndexer(null, tester.client());
     issueAuthorizationIndexer = new IssueAuthorizationIndexer(null, tester.client());
@@ -85,7 +85,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void get_by_key() throws Exception {
+  public void get_by_key() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
     IssueDoc issue = IssueTesting.newDoc("ISSUE1", file);
@@ -96,7 +96,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void get_by_key_with_attributes() throws Exception {
+  public void get_by_key_with_attributes() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
     IssueDoc issue = IssueTesting.newDoc("ISSUE1", file).setAttributes((KeyValueFormat.format(ImmutableMap.of("jira-issue-key", "SONAR-1234"))));
@@ -107,7 +107,7 @@ public class IssueIndexTest {
   }
 
   @Test(expected = IllegalStateException.class)
-  public void comments_field_is_not_available() throws Exception {
+  public void comments_field_is_not_available() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
     IssueDoc issue = IssueTesting.newDoc("ISSUE1", file);
@@ -118,7 +118,7 @@ public class IssueIndexTest {
   }
 
   @Test(expected = IllegalStateException.class)
-  public void is_new_field_is_not_available() throws Exception {
+  public void is_new_field_is_not_available() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
     IssueDoc issue = IssueTesting.newDoc("ISSUE1", file);
@@ -129,12 +129,12 @@ public class IssueIndexTest {
   }
 
   @Test(expected = NotFoundException.class)
-  public void fail_to_get_unknown_key() throws Exception {
+  public void fail_to_get_unknown_key() {
     index.getByKey("unknown");
   }
 
   @Test
-  public void filter_by_keys() throws Exception {
+  public void filter_by_keys() {
     ComponentDto project = ComponentTesting.newProjectDto();
 
     indexIssues(
@@ -147,7 +147,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_projects() throws Exception {
+  public void filter_by_projects() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto module = ComponentTesting.newModuleDto(project);
     ComponentDto subModule = ComponentTesting.newModuleDto(module);
@@ -165,7 +165,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_projects() throws Exception {
+  public void facets_on_projects() {
     ComponentDto project = ComponentTesting.newProjectDto("ABCD");
     ComponentDto project2 = ComponentTesting.newProjectDto("EFGH");
 
@@ -180,7 +180,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_modules() throws Exception {
+  public void filter_by_modules() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto module = ComponentTesting.newModuleDto(project);
     ComponentDto subModule = ComponentTesting.newModuleDto(module);
@@ -203,7 +203,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_components_on_contextualized_search() throws Exception {
+  public void filter_by_components_on_contextualized_search() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto module = ComponentTesting.newModuleDto(project);
     ComponentDto subModule = ComponentTesting.newModuleDto(module);
@@ -238,7 +238,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_components_on_non_contextualized_search() throws Exception {
+  public void filter_by_components_on_non_contextualized_search() {
     ComponentDto project = ComponentTesting.newProjectDto("project");
     ComponentDto file1 = ComponentTesting.newFileDto(project, "file1");
     ComponentDto module = ComponentTesting.newModuleDto(project).setUuid("module");
@@ -268,7 +268,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_components() throws Exception {
+  public void facets_on_components() {
     ComponentDto project = ComponentTesting.newProjectDto("A");
     ComponentDto file1 = ComponentTesting.newFileDto(project, "ABCD");
     ComponentDto file2 = ComponentTesting.newFileDto(project, "BCDE");
@@ -288,7 +288,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_directories() throws Exception {
+  public void filter_by_directories() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file1 = ComponentTesting.newFileDto(project).setPath("src/main/xoo/F1.xoo");
     ComponentDto file2 = ComponentTesting.newFileDto(project).setPath("F2.xoo");
@@ -303,7 +303,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_directories() throws Exception {
+  public void facets_on_directories() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file1 = ComponentTesting.newFileDto(project).setPath("src/main/xoo/F1.xoo");
     ComponentDto file2 = ComponentTesting.newFileDto(project).setPath("F2.xoo");
@@ -318,7 +318,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_views() throws Exception {
+  public void filter_by_views() {
     ComponentDto project1 = ComponentTesting.newProjectDto();
     ComponentDto file1 = ComponentTesting.newFileDto(project1);
     ComponentDto project2 = ComponentTesting.newProjectDto();
@@ -344,7 +344,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_severities() throws Exception {
+  public void filter_by_severities() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -358,7 +358,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_severities() throws Exception {
+  public void facets_on_severities() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -373,7 +373,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_statuses() throws Exception {
+  public void filter_by_statuses() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -387,7 +387,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_statuses() throws Exception {
+  public void facets_on_statuses() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -402,7 +402,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_resolutions() throws Exception {
+  public void filter_by_resolutions() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -417,7 +417,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_resolutions() throws Exception {
+  public void facets_on_resolutions() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -432,7 +432,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_resolved() throws Exception {
+  public void filter_by_resolved() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -447,7 +447,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_action_plans() throws Exception {
+  public void filter_by_action_plans() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -461,7 +461,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_action_plans() throws Exception {
+  public void facets_on_action_plans() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -475,7 +475,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_planned() throws Exception {
+  public void filter_by_planned() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -490,7 +490,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_rules() throws Exception {
+  public void filter_by_rules() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
     RuleKey ruleKey = RuleKey.of("repo", "X1");
@@ -502,7 +502,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_languages() throws Exception {
+  public void filter_by_languages() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
     RuleKey ruleKey = RuleKey.of("repo", "X1");
@@ -515,7 +515,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_languages() throws Exception {
+  public void facets_on_languages() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
     RuleKey ruleKey = RuleKey.of("repo", "X1");
@@ -528,7 +528,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_assignees() throws Exception {
+  public void filter_by_assignees() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -543,7 +543,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_assignees() throws Exception {
+  public void facets_on_assignees() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -559,7 +559,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_assignees_supports_dashes() throws Exception {
+  public void facets_on_assignees_supports_dashes() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -575,7 +575,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_assigned() throws Exception {
+  public void filter_by_assigned() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -590,7 +590,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_reporters() throws Exception {
+  public void filter_by_reporters() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -604,7 +604,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_authors() throws Exception {
+  public void filter_by_authors() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -619,7 +619,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facets_on_authors() throws Exception {
+  public void facets_on_authors() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -635,7 +635,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_created_after() throws Exception {
+  public void filter_by_created_after() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -651,7 +651,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_created_before() throws Exception {
+  public void filter_by_created_before() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -667,7 +667,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_created_after_and_before() throws Exception {
+  public void filter_by_created_after_and_before() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -712,7 +712,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_created_before_must_be_lower_than_after() throws Exception {
+  public void filter_by_created_before_must_be_lower_than_after() {
     try {
       index.search(IssueQuery.builder().createdAfter(DateUtils.parseDate("2014-09-20")).createdBefore(DateUtils.parseDate("2014-09-19")).build(), new SearchOptions());
       Fail.failBecauseExceptionWasNotThrown(IllegalArgumentException.class);
@@ -722,7 +722,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_created_after_must_not_be_in_future() throws Exception {
+  public void filter_by_created_after_must_not_be_in_future() {
     try {
       index.search(IssueQuery.builder().createdAfter(new Date(Long.MAX_VALUE)).build(), new SearchOptions());
       Fail.failBecauseExceptionWasNotThrown(IllegalArgumentException.class);
@@ -732,7 +732,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void filter_by_created_at() throws Exception {
+  public void filter_by_created_at() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -743,7 +743,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facet_on_created_at_with_less_than_20_days() throws Exception {
+  public void facet_on_created_at_with_less_than_20_days() {
 
     SearchOptions options = fixtureForCreatedAtFacet();
 
@@ -766,7 +766,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facet_on_created_at_with_less_than_20_weeks() throws Exception {
+  public void facet_on_created_at_with_less_than_20_weeks() {
 
     SearchOptions SearchOptions = fixtureForCreatedAtFacet();
 
@@ -782,7 +782,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facet_on_created_at_with_less_than_20_months() throws Exception {
+  public void facet_on_created_at_with_less_than_20_months() {
 
     SearchOptions SearchOptions = fixtureForCreatedAtFacet();
 
@@ -800,7 +800,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facet_on_created_at_with_more_than_20_months() throws Exception {
+  public void facet_on_created_at_with_more_than_20_months() {
     SearchOptions SearchOptions = fixtureForCreatedAtFacet();
 
     Map<String, Long> createdAt = index.search(IssueQuery.builder()
@@ -818,7 +818,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facet_on_created_at_with_bounds_outside_of_data() throws Exception {
+  public void facet_on_created_at_with_bounds_outside_of_data() {
     SearchOptions options = fixtureForCreatedAtFacet();
 
     Map<String, Long> createdAt = index.search(IssueQuery.builder()
@@ -837,7 +837,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facet_on_created_at_without_start_bound() throws Exception {
+  public void facet_on_created_at_without_start_bound() {
     SearchOptions SearchOptions = fixtureForCreatedAtFacet();
 
     Map<String, Long> createdAt = index.search(IssueQuery.builder()
@@ -852,7 +852,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void facet_on_created_at_without_issues() throws Exception {
+  public void facet_on_created_at_without_issues() {
     SearchOptions SearchOptions = new SearchOptions().addFacets("createdAt");
 
     Map<String, Long> createdAt = index.search(IssueQuery.builder().build(),
@@ -878,7 +878,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void paging() throws Exception {
+  public void paging() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
     for (int i = 0; i < 12; i++) {
@@ -901,7 +901,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void search_with_max_limit() throws Exception {
+  public void search_with_max_limit() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
     List<IssueDoc> issues = newArrayList();
@@ -917,7 +917,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void sort_by_status() throws Exception {
+  public void sort_by_status() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -940,7 +940,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void sort_by_severity() throws Exception {
+  public void sort_by_severity() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -969,7 +969,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void sort_by_assignee() throws Exception {
+  public void sort_by_assignee() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -991,7 +991,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void sort_by_creation_date() throws Exception {
+  public void sort_by_creation_date() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -1013,7 +1013,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void sort_by_update_date() throws Exception {
+  public void sort_by_update_date() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -1035,7 +1035,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void sort_by_close_date() throws Exception {
+  public void sort_by_close_date() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file = ComponentTesting.newFileDto(project);
 
@@ -1060,7 +1060,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void sort_by_file_and_line() throws Exception {
+  public void sort_by_file_and_line() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto file1 = ComponentTesting.newFileDto(project, "F1").setPath("src/main/xoo/org/sonar/samples/File.xoo");
     ComponentDto file2 = ComponentTesting.newFileDto(project, "F2").setPath("src/main/xoo/org/sonar/samples/File2.xoo");
@@ -1101,7 +1101,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void authorized_issues_on_groups() throws Exception {
+  public void authorized_issues_on_groups() {
     ComponentDto project1 = ComponentTesting.newProjectDto().setKey("project1");
     ComponentDto project2 = ComponentTesting.newProjectDto().setKey("project2");
     ComponentDto project3 = ComponentTesting.newProjectDto().setKey("project3");
@@ -1134,7 +1134,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void authorized_issues_on_user() throws Exception {
+  public void authorized_issues_on_user() {
     ComponentDto project1 = ComponentTesting.newProjectDto().setKey("project1");
     ComponentDto project2 = ComponentTesting.newProjectDto().setKey("project2");
     ComponentDto project3 = ComponentTesting.newProjectDto().setKey("project3");
@@ -1163,7 +1163,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void authorized_issues_on_user_and_group() throws Exception {
+  public void authorized_issues_on_user_and_group() {
     ComponentDto project1 = ComponentTesting.newProjectDto().setKey("project1");
     ComponentDto project2 = ComponentTesting.newProjectDto().setKey("project2");
 
@@ -1208,7 +1208,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void search_issues_for_batch_return_needed_fields() throws Exception {
+  public void search_issues_for_batch_return_needed_fields() {
     ComponentDto project = ComponentTesting.newProjectDto("PROJECT");
     ComponentDto file = ComponentTesting.newFileDto(project).setPath("src/File.xoo");
 
@@ -1244,7 +1244,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void search_issues_for_batch() throws Exception {
+  public void search_issues_for_batch() {
     ComponentDto project = ComponentTesting.newProjectDto();
     ComponentDto module = ComponentTesting.newModuleDto(project);
     ComponentDto subModule = ComponentTesting.newModuleDto(module);
@@ -1265,7 +1265,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void fail_to_search_issues_for_batch_on_not_allowed_scope() throws Exception {
+  public void fail_to_search_issues_for_batch_on_not_allowed_scope() {
     try {
       index.selectIssuesForBatch(new ComponentDto().setScope(Scopes.DIRECTORY));
       failBecauseExceptionWasNotThrown(IllegalStateException.class);
@@ -1275,7 +1275,7 @@ public class IssueIndexTest {
   }
 
   @Test
-  public void search_issues_for_batch_return_only_authorized_issues() throws Exception {
+  public void search_issues_for_batch_return_only_authorized_issues() {
     ComponentDto project1 = ComponentTesting.newProjectDto().setKey("project1");
     ComponentDto project2 = ComponentTesting.newProjectDto().setKey("project2");
 
index 03c7bbb8fc3bb7244e4c23bf16539d5dc6eb1e7a..13fb8233478c5474d6dc9241aff669e13486f52a 100644 (file)
@@ -45,20 +45,20 @@ public class IssueIndexerTest {
   public static EsTester esTester = new EsTester().addDefinitions(new IssueIndexDefinition(new Settings()));
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     esTester.truncateIndices();
   }
 
   @Test
-  public void index_nothing() throws Exception {
+  public void index_nothing() {
     IssueIndexer indexer = createIndexer();
     indexer.index(Iterators.<IssueDoc>emptyIterator());
     assertThat(esTester.countDocuments(IssueIndexDefinition.INDEX, IssueIndexDefinition.TYPE_ISSUE)).isEqualTo(0L);
   }
 
   @Test
-  public void index_nothing_if_disabled() throws Exception {
+  public void index_nothing_if_disabled() {
     dbTester.prepareDbUnit(getClass(), "index.xml");
 
     createIndexer().setEnabled(false).index();
@@ -67,7 +67,7 @@ public class IssueIndexerTest {
   }
 
   @Test
-  public void index() throws Exception {
+  public void index() {
     dbTester.prepareDbUnit(getClass(), "index.xml");
 
     IssueIndexer indexer = createIndexer();
index 43d0d292a36104a3ccff17249c5981efdae2bdce..5d4ce292bb45e3f13da47248cec3c6b93c3e4cb3 100644 (file)
@@ -54,12 +54,12 @@ public class IssueResultSetIteratorTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     DbUtils.closeQuietly(connection);
   }
 
   @Test
-  public void iterator_over_one_issue() throws Exception {
+  public void iterator_over_one_issue() {
     dbTester.prepareDbUnit(getClass(), "one_issue.xml");
     IssueResultSetIterator it = IssueResultSetIterator.create(client, connection, 0L);
     Map<String, IssueDoc> issuesByKey = issuesByKey(it);
@@ -93,7 +93,7 @@ public class IssueResultSetIteratorTest {
   }
 
   @Test
-  public void iterator_over_issues() throws Exception {
+  public void iterator_over_issues() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
     IssueResultSetIterator it = IssueResultSetIterator.create(client, connection, 0L);
     Map<String, IssueDoc> issuesByKey = issuesByKey(it);
@@ -151,7 +151,7 @@ public class IssueResultSetIteratorTest {
   }
 
   @Test
-  public void extract_directory_path() throws Exception {
+  public void extract_directory_path() {
     dbTester.prepareDbUnit(getClass(), "extract_directory_path.xml");
     IssueResultSetIterator it = IssueResultSetIterator.create(client, connection, 0L);
     Map<String, IssueDoc> issuesByKey = issuesByKey(it);
@@ -173,7 +173,7 @@ public class IssueResultSetIteratorTest {
   }
 
   @Test
-  public void extract_file_path() throws Exception {
+  public void extract_file_path() {
     dbTester.prepareDbUnit(getClass(), "extract_file_path.xml");
     IssueResultSetIterator it = IssueResultSetIterator.create(client, connection, 0L);
     Map<String, IssueDoc> issuesByKey = issuesByKey(it);
@@ -195,7 +195,7 @@ public class IssueResultSetIteratorTest {
   }
 
   @Test
-  public void select_after_date() throws Exception {
+  public void select_after_date() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
     IssueResultSetIterator it = IssueResultSetIterator.create(client, connection, 1420000000000L);
 
index 75a84e8c5df6f5f1e1a72d540bfdaf38e7921f56..e9dd60ee5b93a973aac9f41277c50b989985b479 100644 (file)
@@ -63,7 +63,7 @@ public class ChangesOnMyIssueNotificationDispatcherTest {
   }
 
   @Test
-  public void should_not_dispatch_if_other_notification_type() throws Exception {
+  public void should_not_dispatch_if_other_notification_type() {
     Notification notification = new Notification("other-notif");
     dispatcher.performDispatch(notification, context);
 
index 0bc96d60002a86b0755727ac60cff1368d1b5a4c..1046d6392056f77a85b2904acab6fc25b6ec7811 100644 (file)
@@ -49,7 +49,7 @@ public class DoNotFixNotificationDispatcherTest {
   }
 
   @Test
-  public void should_not_dispatch_if_other_notification_type() throws Exception {
+  public void should_not_dispatch_if_other_notification_type() {
     Notification notification = new Notification("other");
     sut.performDispatch(notification, context);
 
index 328e49456db0ed4c77be549c99337f54fe34836c..f31935d577b9d2e33dc857ee522c197f2f3bcbc6 100644 (file)
@@ -31,7 +31,7 @@ public class IssueChangeNotificationTest {
   IssueChangeNotification notification = new IssueChangeNotification();
 
   @Test
-  public void set_issue() throws Exception {
+  public void set_issue() {
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCD")
       .setReporter("arthur")
@@ -52,7 +52,7 @@ public class IssueChangeNotificationTest {
   }
 
   @Test
-  public void set_issue_with_current_change_having_no_old_value() throws Exception {
+  public void set_issue_with_current_change_having_no_old_value() {
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCD")
       .setReporter("arthur")
@@ -70,7 +70,7 @@ public class IssueChangeNotificationTest {
   }
 
   @Test
-  public void set_issue_with_current_change_having_no_new_value() throws Exception {
+  public void set_issue_with_current_change_having_no_new_value() {
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCD")
       .setReporter("arthur")
@@ -88,32 +88,32 @@ public class IssueChangeNotificationTest {
   }
 
   @Test
-  public void set_project() throws Exception {
+  public void set_project() {
     IssueChangeNotification result = notification.setProject(new ComponentDto().setKey("MyService").setLongName("My Service"));
     assertThat(result.getFieldValue("projectKey")).isEqualTo("MyService");
     assertThat(result.getFieldValue("projectName")).isEqualTo("My Service");
   }
 
   @Test
-  public void set_component() throws Exception {
+  public void set_component() {
     IssueChangeNotification result = notification.setComponent(new ComponentDto().setKey("MyService").setLongName("My Service"));
     assertThat(result.getFieldValue("componentName")).isEqualTo("My Service");
   }
 
   @Test
-  public void set_change_author_login() throws Exception {
+  public void set_change_author_login() {
     IssueChangeNotification result = notification.setChangeAuthorLogin("stephane");
     assertThat(result.getFieldValue("changeAuthor")).isEqualTo("stephane");
   }
 
   @Test
-  public void set_rule_name() throws Exception {
+  public void set_rule_name() {
     IssueChangeNotification result = notification.setRuleName("Xoo Rule");
     assertThat(result.getFieldValue("ruleName")).isEqualTo("Xoo Rule");
   }
 
   @Test
-  public void setComment() throws Exception {
+  public void setComment() {
     IssueChangeNotification result = notification.setComment("My comment");
     assertThat(result.getFieldValue("comment")).isEqualTo("My comment");
   }
index 8ab8fe5635469d705e506a18f8c8a16df8f5c1ef..8f5bcd612f062eed83ac0e1dad2ca73a8574fd78 100644 (file)
@@ -100,7 +100,7 @@ public class MyNewIssuesEmailTemplateTest {
   }
 
   @Test
-  public void message_id() throws Exception {
+  public void message_id() {
     Notification notification = newNotification();
 
     EmailMessage message = sut.format(notification);
@@ -109,7 +109,7 @@ public class MyNewIssuesEmailTemplateTest {
   }
 
   @Test
-  public void subject() throws Exception {
+  public void subject() {
     Notification notification = newNotification();
 
     EmailMessage message = sut.format(notification);
index ca9b627d5988128a52712556969a29b459db8d18..9aaedf1b9944fa5465f716ff8f9f284b366a65d9 100644 (file)
@@ -48,7 +48,7 @@ public class MyNewIssuesNotificationDispatcherTest {
   }
 
   @Test
-  public void do_not_dispatch_if_no_new_notification() throws Exception {
+  public void do_not_dispatch_if_no_new_notification() {
     Notification notification = new Notification("other-notif");
     sut.performDispatch(notification, context);
 
index 840179fa11d6de742704ad2b79a9ab2fe1cd66fc..8d31716e692d6e0920732364cb9791788a3b2581 100644 (file)
@@ -35,14 +35,14 @@ public class MyNewIssuesNotificationTest {
   MyNewIssuesNotification sut = new MyNewIssuesNotification(mock(UserIndex.class), mock(RuleIndex.class), mock(DbClient.class), mock(Durations.class));
 
   @Test
-  public void set_assignee() throws Exception {
+  public void set_assignee() {
     sut.setAssignee("myAssignee");
 
     assertThat(sut.getFieldValue(FIELD_ASSIGNEE)).isEqualTo("myAssignee");
   }
 
   @Test
-  public void set_with_a_specific_type() throws Exception {
+  public void set_with_a_specific_type() {
     assertThat(sut.getType()).isEqualTo(MyNewIssuesNotification.TYPE);
 
   }
index 723f9f5ddbb44cff7d7c68b9cc196710f08fb7a4..abd0556bc3c29b0f9eaaf269a142c72a4ed640cd 100644 (file)
@@ -76,7 +76,7 @@ public class NewIssuesEmailTemplateTest {
   }
 
   @Test
-  public void message_id() throws Exception {
+  public void message_id() {
     Notification notification = newNotification();
 
     EmailMessage message = template.format(notification);
@@ -85,7 +85,7 @@ public class NewIssuesEmailTemplateTest {
   }
 
   @Test
-  public void subject() throws Exception {
+  public void subject() {
     Notification notification = newNotification();
 
     EmailMessage message = template.format(notification);
index 5be50dc2393952cce1404cb378b22dce106687f0..7240dcc950bb761d556b5c019bd44027e9f3749f 100644 (file)
@@ -45,7 +45,7 @@ public class NewIssuesNotificationDispatcherTest {
   }
 
   @Test
-  public void shouldNotDispatchIfNotNewViolationsNotification() throws Exception {
+  public void shouldNotDispatchIfNotNewViolationsNotification() {
     Notification notification = new Notification("other-notif");
     dispatcher.performDispatch(notification, context);
 
index ef9bf673dfa22cd2edc680c90d35f7f3925861e1..eae48d534ba4259534c006fdc9a168f7833c121f 100644 (file)
@@ -65,7 +65,7 @@ public class NewIssuesNotificationTest {
   NewIssuesNotification sut = new NewIssuesNotification(userIndex, ruleIndex, dbClient, durations);
 
   @Test
-  public void set_project() throws Exception {
+  public void set_project() {
     ComponentDto component = ComponentTesting.newProjectDto()
       .setLongName("project-long-name")
       .setUuid("project-uuid")
@@ -79,7 +79,7 @@ public class NewIssuesNotificationTest {
   }
 
   @Test
-  public void set_date() throws Exception {
+  public void set_date() {
     Date date = new Date();
 
     sut.setAnalysisDate(date);
@@ -88,7 +88,7 @@ public class NewIssuesNotificationTest {
   }
 
   @Test
-  public void set_statistics() throws Exception {
+  public void set_statistics() {
     ComponentDto component = ComponentTesting.newProjectDto()
       .setLongName("project-long-name");
     addIssueNTimes(newIssue1(), 5);
@@ -122,7 +122,7 @@ public class NewIssuesNotificationTest {
   }
 
   @Test
-  public void set_debt() throws Exception {
+  public void set_debt() {
     when(durations.format(any(Locale.class), any(Duration.class))).thenReturn("55 min");
 
     sut.setDebt(Duration.create(55));
index 947e1741492bfb5c3505807367b288e17f91dd60..215297d17edb71a0dc49120edf4e16ccc980e4f8 100644 (file)
@@ -35,7 +35,7 @@ public class NewIssuesStatisticsTest {
   NewIssuesStatistics sut = new NewIssuesStatistics();
 
   @Test
-  public void add_issues_with_correct_global_statistics() throws Exception {
+  public void add_issues_with_correct_global_statistics() {
     DefaultIssue issue = defaultIssue();
 
     sut.add(issue);
@@ -61,7 +61,7 @@ public class NewIssuesStatisticsTest {
   }
 
   @Test
-  public void do_not_have_issues_when_no_issue_added() throws Exception {
+  public void do_not_have_issues_when_no_issue_added() {
     assertThat(sut.globalStatistics().hasIssues()).isFalse();
   }
 
index c10978bb6ee4362a690512be6b52d5b857986c7d..3bc7943370022a1425800061dd9cb98d62730602 100644 (file)
@@ -45,7 +45,7 @@ public class AuthorsActionTest {
   IssueService service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester = new WsTester(new IssuesWs(new AuthorsAction(service)));
     controller = tester.controller("api/issues");
   }
index 4dd53d9bf0f86b9571c46d1b2b4f3c30a3f9d212..43e8343e5704b137dbeefa8a77524ad1363136d0 100644 (file)
@@ -60,7 +60,7 @@ public class ComponentTagsActionTest {
   }
 
   @Test
-  public void should_define() throws Exception {
+  public void should_define() {
     Action action = tester.controller("api/issues").action("component_tags");
     assertThat(action.description()).isNotEmpty();
     assertThat(action.responseExampleAsString()).isNotEmpty();
index d4f10786a6aaf3e26d59f21c6dab6b5426330ce1..ef2f33b5ee09cee1355b5fb2bd61784fb904fa2f 100644 (file)
@@ -56,12 +56,12 @@ public class IssueActionsWriterTest {
   IssueActionsWriter writer;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     writer = new IssueActionsWriter(issueService, actionService);
   }
 
   @Test
-  public void write_all_standard_actions() throws Exception {
+  public void write_all_standard_actions() {
     Issue issue = new DefaultIssue()
       .setKey("ABCD")
       .setComponentUuid("BCDE")
@@ -80,7 +80,7 @@ public class IssueActionsWriterTest {
   }
 
   @Test
-  public void write_plugin_actions() throws Exception {
+  public void write_plugin_actions() {
     Issue issue = new DefaultIssue()
       .setKey("ABCD")
       .setComponentKey("sample:src/main/xoo/sample/Sample.xoo")
@@ -100,7 +100,7 @@ public class IssueActionsWriterTest {
   }
 
   @Test
-  public void write_only_comment_action() throws Exception {
+  public void write_only_comment_action() {
     Issue issue = new DefaultIssue()
       .setKey("ABCD")
       .setComponentKey("sample:src/main/xoo/sample/Sample.xoo")
@@ -118,7 +118,7 @@ public class IssueActionsWriterTest {
   }
 
   @Test
-  public void write_no_action_if_not_logged() throws Exception {
+  public void write_no_action_if_not_logged() {
     Issue issue = new DefaultIssue()
       .setKey("ABCD")
       .setComponentKey("sample:src/main/xoo/sample/Sample.xoo")
@@ -132,7 +132,7 @@ public class IssueActionsWriterTest {
   }
 
   @Test
-  public void write_actions_without_assign_to_me() throws Exception {
+  public void write_actions_without_assign_to_me() {
     Issue issue = new DefaultIssue()
       .setKey("ABCD")
       .setComponentKey("sample:src/main/xoo/sample/Sample.xoo")
@@ -150,7 +150,7 @@ public class IssueActionsWriterTest {
   }
 
   @Test
-  public void write_transitions() throws Exception {
+  public void write_transitions() {
     Issue issue = new DefaultIssue()
       .setKey("ABCD")
       .setComponentKey("sample:src/main/xoo/sample/Sample.xoo")
@@ -167,7 +167,7 @@ public class IssueActionsWriterTest {
   }
 
   @Test
-  public void write_no_transitions() throws Exception {
+  public void write_no_transitions() {
     Issue issue = new DefaultIssue()
       .setKey("ABCD")
       .setComponentKey("sample:src/main/xoo/sample/Sample.xoo")
index d730f222275e8fdfe088c3ce160e3164d7789624..86828306900929697382a79123c637d0988ea2fa 100644 (file)
@@ -125,7 +125,7 @@ public class IssueShowActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(dbClient.openSession(false)).thenReturn(session);
     when(dbClient.componentDao()).thenReturn(componentDao);
 
index 3bdf5a1c37b53f929452725fc65f2c6f211255eb..2df47f7d72c5776e14980edfd7e822f27db05c0d 100644 (file)
@@ -51,7 +51,7 @@ public class IssueTagsActionTest {
   }
 
   @Test
-  public void should_define() throws Exception {
+  public void should_define() {
     Action action = tester.controller("api/issues").action("tags");
     assertThat(action.description()).isNotEmpty();
     assertThat(action.responseExampleAsString()).isNotEmpty();
index e47f7fac89437da97b0ebd31e5986c7b507090c2..63971f68f684e898d5a093053340c95955e0c509 100644 (file)
@@ -30,7 +30,7 @@ import static org.mockito.Mockito.verify;
 public class IssuesWsTest {
 
   @Test
-  public void define_actions() throws Exception {
+  public void define_actions() {
     BaseIssuesWsAction action1 = mock(BaseIssuesWsAction.class);
     BaseIssuesWsAction action2 = mock(BaseIssuesWsAction.class);
     IssuesWs ws = new IssuesWs(action1, action2);
index 2dca1fa5b79fee55b9012821631b45c6b80d7bdf..80f52c213bc0e8152f61a862c8e618f832bfe8c6 100644 (file)
@@ -65,7 +65,7 @@ public class SearchActionComponentsMediumTest {
   WsTester wsTester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     wsTester = tester.get(WsTester.class);
index 0db8498e6828ccce81cf202d59dc16ff21a542e2..ac71b09d645b6bb14b9b7e0651e06952d71b9fbb 100644 (file)
@@ -65,7 +65,7 @@ public class SearchActionMediumTest {
   WsTester wsTester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     wsTester = tester.get(WsTester.class);
@@ -78,7 +78,7 @@ public class SearchActionMediumTest {
   }
 
   @Test
-  public void define_action() throws Exception {
+  public void define_action() {
     WebService.Controller controller = wsTester.controller("api/issues");
 
     WebService.Action show = controller.action("search");
index 7ccfb597930753da0d61964e9b3d9e6effe3b0e9..84b445175f3d9ac1c49495ce87c45adb60b01b85 100644 (file)
@@ -50,7 +50,7 @@ public class SetTagsActionTest {
   }
 
   @Test
-  public void should_define() throws Exception {
+  public void should_define() {
     Action action = tester.controller("api/issues").action("set_tags");
     assertThat(action.description()).isNotEmpty();
     assertThat(action.responseExampleAsString()).isNull();
index e2de7c20e7ea466f024df7e188ed311577261dc4..a7d1d3b28d51a4c52df231294a7dcde12167297d 100644 (file)
@@ -57,7 +57,7 @@ public class LanguageWsTest {
   }
 
   @Test
-  public void should_be_well_defined() throws Exception {
+  public void should_be_well_defined() {
     Controller controller = tester.controller(CONTROLLER_LANGUAGES);
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
index 0df8c2bf72e5fddc33ec6c032388eff58ffe9f6c..a068d320e107a7000b0ac6631bf9f5a1f7e8cb85 100644 (file)
@@ -57,7 +57,7 @@ public class MeasureFilterEngineTest {
   }
 
   @Test
-  public void keep_error_but_do_not_fail() throws Exception {
+  public void keep_error_but_do_not_fail() {
     Map<String, Object> filterMap = ImmutableMap.of("qualifiers", (Object) "TRK");
     MeasureFilterFactory factory = mock(MeasureFilterFactory.class);
     when(factory.create(filterMap)).thenThrow(new IllegalArgumentException());
index 497fbd3aeefa291a3d89e571dbcfd945002f95a6..d1efaeb3835fceddcd0f6f5ff0149fc70a6626ba 100644 (file)
@@ -53,12 +53,12 @@ public class MeasureDaoTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void get_value_by_key() throws Exception {
+  public void get_value_by_key() {
     db.prepareDbUnit(getClass(), "shared.xml");
 
     MeasureDto result = sut.findByComponentKeyAndMetricKey(session, "org.struts:struts-core:src/org/struts/RequestContext.java", "ncloc");
@@ -68,7 +68,7 @@ public class MeasureDaoTest {
 
   @Test
   // TODO the string must be longer than 4000 char to be persisted in the data field
-  public void get_data_by_key() throws Exception {
+  public void get_data_by_key() {
     db.prepareDbUnit(getClass(), "shared.xml");
 
     MeasureDto result = sut.findByComponentKeyAndMetricKey(session, "org.struts:struts-core:src/org/struts/RequestContext.java", "authors_by_line");
@@ -77,7 +77,7 @@ public class MeasureDaoTest {
   }
 
   @Test
-  public void get_text_value_by_key() throws Exception {
+  public void get_text_value_by_key() {
     db.prepareDbUnit(getClass(), "shared.xml");
 
     MeasureDto result = sut.findByComponentKeyAndMetricKey(session, "org.struts:struts-core:src/org/struts/RequestContext.java", "coverage_line_hits_data");
@@ -86,7 +86,7 @@ public class MeasureDaoTest {
   }
 
   @Test
-  public void find_by_component_key_and_metrics() throws Exception {
+  public void find_by_component_key_and_metrics() {
     db.prepareDbUnit(getClass(), "shared.xml");
 
     List<MeasureDto> results = sut.findByComponentKeyAndMetricKeys(session, "org.struts:struts-core:src/org/struts/RequestContext.java",
@@ -109,7 +109,7 @@ public class MeasureDaoTest {
   }
 
   @Test
-  public void find_by_component_key_and_metric() throws Exception {
+  public void find_by_component_key_and_metric() {
     db.prepareDbUnit(getClass(), "shared.xml");
 
     MeasureDto result = sut.findByComponentKeyAndMetricKey(session, "org.struts:struts-core:src/org/struts/RequestContext.java", "ncloc");
@@ -127,7 +127,7 @@ public class MeasureDaoTest {
   }
 
   @Test
-  public void exists_by_key() throws Exception {
+  public void exists_by_key() {
     db.prepareDbUnit(getClass(), "shared.xml");
 
     assertThat(sut.existsByKey(session, "org.struts:struts-core:src/org/struts/RequestContext.java", "ncloc")).isTrue();
@@ -135,7 +135,7 @@ public class MeasureDaoTest {
   }
 
   @Test
-  public void insert() throws Exception {
+  public void insert() {
     db.prepareDbUnit(getClass(), "empty.xml");
 
     sut.insert(session, new MeasureDto()
index bae1057067132d38d56789802b310c3bad24ac34..06039d91cdb58da15ccebae7b3f6bdcc01742880 100644 (file)
@@ -50,12 +50,12 @@ public class MetricDaoTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void get_by_key() throws Exception {
+  public void get_by_key() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     MetricDto result = dao.selectByKey(session, "coverage");
@@ -83,7 +83,7 @@ public class MetricDaoTest {
   }
 
   @Test
-  public void get_manual_metric() throws Exception {
+  public void get_manual_metric() {
     dbTester.prepareDbUnit(getClass(), "manual_metric.xml");
 
     MetricDto result = dao.selectByKey(session, "manual");
@@ -106,14 +106,14 @@ public class MetricDaoTest {
   }
 
   @Test
-  public void find_all_enabled() throws Exception {
+  public void find_all_enabled() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     assertThat(dao.selectEnabled(session)).hasSize(2);
   }
 
   @Test
-  public void insert() throws Exception {
+  public void insert() {
     dao.insert(session, new MetricDto()
       .setId(1)
       .setKey("coverage")
index abc4eda6937a3fa24c03060d75206fc112781de4..dae670cdde75ce73ad573d2ea9a25a6817ee9fc6 100644 (file)
@@ -31,7 +31,7 @@ public class ManualMeasuresWsTest {
   WsTester tester = new WsTester(new ManualMeasuresWs());
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WebService.Controller controller = tester.controller("api/manual_measures");
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
index 86dd7bfc47130adce0123e873b54d3bb9bcece35..030a28e021a7890a204407da2ba8644d8d42dfe8 100644 (file)
@@ -31,7 +31,7 @@ public class MetricsWsTest {
   WsTester tester = new WsTester(new MetricsWs());
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WebService.Controller controller = tester.controller("api/metrics");
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
index fd688197b40f14d487bcc5e1d80e592fc7dff9db..ec0addba29ff671214ce0e9919df23d602ff986a 100644 (file)
@@ -33,13 +33,13 @@ public class TimeMachineWsTest {
   WebService.Controller controller;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     WsTester tester = new WsTester(new TimeMachineWs());
     controller = tester.controller("api/timemachine");
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     assertThat(controller).isNotNull();
     assertThat(controller.since()).isEqualTo("2.10");
     assertThat(controller.description()).isNotEmpty();
@@ -47,7 +47,7 @@ public class TimeMachineWsTest {
   }
 
   @Test
-  public void define_index_action() throws Exception {
+  public void define_index_action() {
     WebService.Action action = controller.action("index");
     assertThat(action).isNotNull();
     assertThat(action.handler()).isInstanceOf(RailsHandler.class);
index 98f07a6048c2c6e6902acbf75f1efb679fb431c5..dcdc86e25f95a7e6d8503ac088f70f213ddc1269 100644 (file)
@@ -210,7 +210,7 @@ public class NotificationServiceTest {
   }
 
   @Test
-  public void shouldLogEvery10Minutes() throws InterruptedException {
+  public void shouldLogEvery10Minutes() {
     setUpMocks();
     // Emulate 2 notifications in DB
     when(manager.getFromQueue()).thenReturn(notification).thenReturn(notification).thenReturn(null);
index 8bb2bbfb571fca5d46af3972b778455039421521..817bd23cce3114da159ce9c73b64a336a257bb99 100644 (file)
@@ -38,7 +38,7 @@ public class ApplyPermissionTemplateQueryTest {
   public ExpectedException throwable = ExpectedException.none();
 
   @Test
-  public void should_populate_with_params() throws Exception {
+  public void should_populate_with_params() {
 
     Map<String, Object> params = Maps.newHashMap();
     params.put("template_key", "my_template_key");
@@ -51,7 +51,7 @@ public class ApplyPermissionTemplateQueryTest {
   }
 
   @Test
-  public void should_invalidate_query_with_empty_name() throws Exception {
+  public void should_invalidate_query_with_empty_name() {
 
     throwable.expect(BadRequestException.class);
     throwable.expectMessage("Permission template is mandatory");
@@ -65,7 +65,7 @@ public class ApplyPermissionTemplateQueryTest {
   }
 
   @Test
-  public void should_invalidate_query_with_no_components() throws Exception {
+  public void should_invalidate_query_with_no_components() {
 
     throwable.expect(BadRequestException.class);
     throwable.expectMessage("Please provide at least one entry to which the permission template should be applied");
index fcd9d1ecd9e65edaab0c6aa0d4a77cfe9b5f65f9..aba6615812e5dbc84a76d3a3d95862aeec294738 100644 (file)
@@ -62,7 +62,7 @@ public class InternalPermissionServiceMediumTest {
   ComponentDto project;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     session = db.openSession(false);
@@ -79,7 +79,7 @@ public class InternalPermissionServiceMediumTest {
   }
 
   @Test
-  public void add_project_permission_to_user() throws Exception {
+  public void add_project_permission_to_user() {
     // init
     MockUserSession.set().setLogin("admin").addProjectPermissions(UserRole.ADMIN, project.key());
     UserDto user = new UserDto().setLogin("john").setName("John");
@@ -100,7 +100,7 @@ public class InternalPermissionServiceMediumTest {
   }
 
   @Test
-  public void remove_project_permission_to_user() throws Exception {
+  public void remove_project_permission_to_user() {
     MockUserSession.set().setLogin("admin").addProjectPermissions(UserRole.ADMIN, project.key());
 
     UserDto user1 = new UserDto().setLogin("user1").setName("User1");
@@ -124,7 +124,7 @@ public class InternalPermissionServiceMediumTest {
   }
 
   @Test
-  public void remove_all_component_user_permissions() throws Exception {
+  public void remove_all_component_user_permissions() {
     MockUserSession.set().setLogin("admin").addProjectPermissions(UserRole.ADMIN, project.key());
 
     UserDto user = new UserDto().setLogin("user1").setName("User1");
@@ -151,7 +151,7 @@ public class InternalPermissionServiceMediumTest {
   }
 
   @Test
-  public void add_and_remove_permission_to_group() throws Exception {
+  public void add_and_remove_permission_to_group() {
     // init
     MockUserSession.set().setLogin("admin").addProjectPermissions(UserRole.ADMIN, project.key());
     GroupDto group = new GroupDto().setName("group1");
index 94bd72758c87e738a78ea7f3a8bb90e2d21211f4..d5938bb4aa638c13257ca89f02a5e5c83e799088 100644 (file)
@@ -85,7 +85,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void find_users_with_permission_template() throws Exception {
+  public void find_users_with_permission_template() {
     service.findUsersWithPermissionTemplate(ImmutableMap.<String, Object>of(
       "permission", "user",
       "template", "my_template",
@@ -94,7 +94,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void find_groups_with_permission_template() throws Exception {
+  public void find_groups_with_permission_template() {
     service.findGroupsWithPermissionTemplate(ImmutableMap.<String, Object>of(
       "permission", "user",
       "template", "my_template",
@@ -104,7 +104,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_create_permission_template() throws Exception {
+  public void should_create_permission_template() {
     when(permissionTemplateDao.createPermissionTemplate(DEFAULT_KEY, DEFAULT_DESC, DEFAULT_PATTERN)).thenReturn(DEFAULT_TEMPLATE);
 
     PermissionTemplate permissionTemplate = service.createPermissionTemplate(DEFAULT_KEY, DEFAULT_DESC, DEFAULT_PATTERN);
@@ -116,7 +116,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_enforce_unique_template_name() throws Exception {
+  public void should_enforce_unique_template_name() {
     expected.expect(BadRequestException.class);
     expected.expectMessage("A template with that name already exists");
 
@@ -126,7 +126,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_reject_empty_name_on_creation() throws Exception {
+  public void should_reject_empty_name_on_creation() {
     expected.expect(BadRequestException.class);
     expected.expectMessage("Name can't be blank");
 
@@ -134,7 +134,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_reject_invalid_key_pattern_on_creation() throws Exception {
+  public void should_reject_invalid_key_pattern_on_creation() {
     expected.expect(BadRequestException.class);
     expected.expectMessage("Invalid pattern: [azerty. Should be a valid Java regular expression.");
 
@@ -142,7 +142,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_delete_permission_template() throws Exception {
+  public void should_delete_permission_template() {
     when(permissionTemplateDao.selectTemplateByKey(DEFAULT_KEY)).thenReturn(DEFAULT_TEMPLATE);
 
     service.deletePermissionTemplate(1L);
@@ -151,7 +151,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_retrieve_permission_template() throws Exception {
+  public void should_retrieve_permission_template() {
 
     List<PermissionTemplateUserDto> usersPermissions = Lists.newArrayList(
       buildUserPermission("user_scan", GlobalPermissions.SCAN_EXECUTION),
@@ -186,7 +186,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_retrieve_all_permission_templates() throws Exception {
+  public void should_retrieve_all_permission_templates() {
     PermissionTemplateDto template1 =
       new PermissionTemplateDto().setId(1L).setName("template1").setDescription("template1");
     PermissionTemplateDto template2 =
@@ -202,7 +202,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_retrieve_all_permission_templates_from_project() throws Exception {
+  public void should_retrieve_all_permission_templates_from_project() {
     MockUserSession.set().setLogin("admin").addProjectPermissions(UserRole.ADMIN, "org.sample.Sample");
 
     PermissionTemplateDto template1 =
@@ -220,7 +220,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_update_permission_template() throws Exception {
+  public void should_update_permission_template() {
 
     service.updatePermissionTemplate(1L, "new_name", "new_description", null);
 
@@ -228,7 +228,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_validate_template_name_on_update_if_applicable() throws Exception {
+  public void should_validate_template_name_on_update_if_applicable() {
     expected.expect(BadRequestException.class);
     expected.expectMessage("A template with that name already exists");
 
@@ -242,7 +242,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_validate_template_key_pattern_on_update_if_applicable() throws Exception {
+  public void should_validate_template_key_pattern_on_update_if_applicable() {
     expected.expect(BadRequestException.class);
     expected.expectMessage("Invalid pattern: [azerty. Should be a valid Java regular expression.");
 
@@ -253,7 +253,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_skip_name_validation_where_not_applicable() throws Exception {
+  public void should_skip_name_validation_where_not_applicable() {
     PermissionTemplateDto template1 =
       new PermissionTemplateDto().setId(1L).setName("template1").setDescription("template1");
     PermissionTemplateDto template2 =
@@ -266,7 +266,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_add_user_permission() throws Exception {
+  public void should_add_user_permission() {
     UserDto userDto = new UserDto().setId(1L).setLogin("user").setName("user");
     when(userDao.selectActiveUserByLogin("user")).thenReturn(userDto);
     when(permissionTemplateDao.selectTemplateByKey(DEFAULT_KEY)).thenReturn(DEFAULT_TEMPLATE);
@@ -277,7 +277,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_validate_provided_user_login() throws Exception {
+  public void should_validate_provided_user_login() {
     expected.expect(BadRequestException.class);
     expected.expectMessage("Unknown user:");
 
@@ -288,7 +288,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_remove_user_permission() throws Exception {
+  public void should_remove_user_permission() {
     UserDto userDto = new UserDto().setId(1L).setLogin("user").setName("user");
     when(userDao.selectActiveUserByLogin("user")).thenReturn(userDto);
     when(permissionTemplateDao.selectTemplateByKey(DEFAULT_KEY)).thenReturn(DEFAULT_TEMPLATE);
@@ -299,7 +299,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_add_group_permission() throws Exception {
+  public void should_add_group_permission() {
     GroupDto groupDto = new GroupDto().setId(1L).setName("group");
     when(userDao.selectGroupByName("group")).thenReturn(groupDto);
     when(permissionTemplateDao.selectTemplateByKey(DEFAULT_KEY)).thenReturn(DEFAULT_TEMPLATE);
@@ -310,7 +310,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_validate_provided_group_name() throws Exception {
+  public void should_validate_provided_group_name() {
     expected.expect(BadRequestException.class);
     expected.expectMessage("Unknown group:");
 
@@ -321,7 +321,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_remove_group_permission() throws Exception {
+  public void should_remove_group_permission() {
     GroupDto groupDto = new GroupDto().setId(1L).setName("group");
     when(userDao.selectGroupByName("group")).thenReturn(groupDto);
     when(permissionTemplateDao.selectTemplateByKey(DEFAULT_KEY)).thenReturn(DEFAULT_TEMPLATE);
@@ -332,7 +332,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_add_permission_to_anyone_group() throws Exception {
+  public void should_add_permission_to_anyone_group() {
     when(permissionTemplateDao.selectTemplateByKey(DEFAULT_KEY)).thenReturn(DEFAULT_TEMPLATE);
 
     service.addGroupPermission(DEFAULT_KEY, DEFAULT_PERMISSION, "Anyone");
@@ -342,7 +342,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_remove_permission_from_anyone_group() throws Exception {
+  public void should_remove_permission_from_anyone_group() {
     when(permissionTemplateDao.selectTemplateByKey(DEFAULT_KEY)).thenReturn(DEFAULT_TEMPLATE);
 
     service.removeGroupPermission(DEFAULT_KEY, DEFAULT_PERMISSION, "Anyone");
@@ -352,7 +352,7 @@ public class InternalPermissionTemplateServiceTest {
   }
 
   @Test
-  public void should_remove_group_from_templates() throws Exception {
+  public void should_remove_group_from_templates() {
     GroupDto groupDto = new GroupDto().setId(1L).setName("group");
     when(userDao.selectGroupByName("group", session)).thenReturn(groupDto);
 
index 87c437fff3c45bda95a3669b6de336e87b2377e2..eae03e956d32008f3fbf583f2037fc9ff8a39903 100644 (file)
@@ -37,7 +37,7 @@ public class PermissionChangeTest {
   public ExpectedException thrown = ExpectedException.none();
 
   @Test
-  public void populate_from_params() throws Exception {
+  public void populate_from_params() {
     Map<String, Object> params = Maps.newHashMap();
     params.put("user", "my_login");
     params.put("group", "my_group");
@@ -53,7 +53,7 @@ public class PermissionChangeTest {
   }
 
   @Test
-  public void validate_user_query() throws Exception {
+  public void validate_user_query() {
     Map<String, Object> validUserParams = Maps.newHashMap();
     validUserParams.put("user", "my_login");
     validUserParams.put("permission", GlobalPermissions.SYSTEM_ADMIN);
@@ -63,7 +63,7 @@ public class PermissionChangeTest {
   }
 
   @Test
-  public void validate_group_query() throws Exception {
+  public void validate_group_query() {
     Map<String, Object> validGroupParams = Maps.newHashMap();
     validGroupParams.put("group", "my_group");
     validGroupParams.put("permission", GlobalPermissions.SYSTEM_ADMIN);
@@ -73,7 +73,7 @@ public class PermissionChangeTest {
   }
 
   @Test
-  public void reject_inconsistent_query() throws Exception {
+  public void reject_inconsistent_query() {
     Map<String, Object> inconsistentParams = Maps.newHashMap();
     inconsistentParams.put("user", "my_login");
     inconsistentParams.put("group", "my_group");
@@ -87,7 +87,7 @@ public class PermissionChangeTest {
   }
 
   @Test
-  public void detect_missing_user_or_group() throws Exception {
+  public void detect_missing_user_or_group() {
     Map<String, Object> inconsistentParams = Maps.newHashMap();
     inconsistentParams.put("permission", "admin");
 
@@ -99,7 +99,7 @@ public class PermissionChangeTest {
   }
 
   @Test
-  public void detect_missing_permission() throws Exception {
+  public void detect_missing_permission() {
     Map<String, Object> inconsistentParams = Maps.newHashMap();
     inconsistentParams.put("user", "my_login");
 
@@ -111,7 +111,7 @@ public class PermissionChangeTest {
   }
 
   @Test
-  public void validate_global_permission_reference() throws Exception {
+  public void validate_global_permission_reference() {
     Map<String, Object> inconsistentParams = Maps.newHashMap();
     inconsistentParams.put("user", "my_login");
     inconsistentParams.put("permission", "invalid");
@@ -124,7 +124,7 @@ public class PermissionChangeTest {
   }
 
   @Test
-  public void validate_component_permission_reference() throws Exception {
+  public void validate_component_permission_reference() {
     Map<String, Object> inconsistentParams = Maps.newHashMap();
     inconsistentParams.put("user", "my_login");
     inconsistentParams.put("component", "org.sample.Sample");
index 21e311749cfa4ea7c48eb27a7b90fb7653e957ad..ecd7e1235c875b9b93885b8f1fa2e626fbe6ca07 100644 (file)
@@ -55,13 +55,13 @@ public class PermissionFinderTest {
   PermissionFinder finder;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(resourceDao.getResource(any(ResourceQuery.class))).thenReturn(new ResourceDto().setId(100L).setName("org.sample.Sample"));
     finder = new PermissionFinder(permissionDao, resourceDao, permissionTemplateDao);
   }
 
   @Test
-  public void find_users() throws Exception {
+  public void find_users() {
     when(permissionDao.selectUsers(any(PermissionQuery.class), anyLong(), anyInt(), anyInt())).thenReturn(
       newArrayList(new UserWithPermissionDto().setName("user1").setPermission("user"))
     );
@@ -72,7 +72,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void fail_to_find_users_when_component_not_found() throws Exception {
+  public void fail_to_find_users_when_component_not_found() {
     when(resourceDao.getResource(any(ResourceQuery.class))).thenReturn(null);
 
     try {
@@ -84,7 +84,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_users_with_paging() throws Exception {
+  public void find_users_with_paging() {
     finder.findUsersWithPermission(PermissionQuery.builder().permission("user").pageIndex(3).pageSize(10).build());
 
     ArgumentCaptor<Integer> argumentOffset = ArgumentCaptor.forClass(Integer.class);
@@ -96,7 +96,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_users_with_paging_having_more_results() throws Exception {
+  public void find_users_with_paging_having_more_results() {
     when(permissionDao.selectUsers(any(PermissionQuery.class), anyLong(), anyInt(), anyInt())).thenReturn(newArrayList(
       new UserWithPermissionDto().setName("user1").setPermission("user"),
       new UserWithPermissionDto().setName("user2").setPermission("user"),
@@ -114,7 +114,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_users_with_paging_having_no_more_results() throws Exception {
+  public void find_users_with_paging_having_no_more_results() {
     when(permissionDao.selectUsers(any(PermissionQuery.class), anyLong(), anyInt(), anyInt())).thenReturn(newArrayList(
       new UserWithPermissionDto().setName("user1").setPermission("user"),
       new UserWithPermissionDto().setName("user2").setPermission("user"),
@@ -133,7 +133,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_groups() throws Exception {
+  public void find_groups() {
     when(permissionDao.selectGroups(any(PermissionQuery.class), anyLong())).thenReturn(
       newArrayList(new GroupWithPermissionDto().setName("users").setPermission("user"))
     );
@@ -145,7 +145,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_groups_should_be_paginated() throws Exception {
+  public void find_groups_should_be_paginated() {
     when(permissionDao.selectGroups(any(PermissionQuery.class), anyLong())).thenReturn(newArrayList(
       new GroupWithPermissionDto().setName("Anyone").setPermission("user"),
       new GroupWithPermissionDto().setName("Admin").setPermission("user"),
@@ -176,7 +176,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_groups_should_filter_membership() throws Exception {
+  public void find_groups_should_filter_membership() {
     when(permissionDao.selectGroups(any(PermissionQuery.class), anyLong())).thenReturn(newArrayList(
       new GroupWithPermissionDto().setName("Anyone").setPermission("user"),
       new GroupWithPermissionDto().setName("Admin").setPermission("user"),
@@ -194,7 +194,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_groups_with_added_anyone_group() throws Exception {
+  public void find_groups_with_added_anyone_group() {
     when(permissionDao.selectGroups(any(PermissionQuery.class), anyLong())).thenReturn(
       newArrayList(new GroupWithPermissionDto().setName("users").setPermission("user"))
     );
@@ -208,7 +208,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_groups_without_adding_anyone_group_when_search_text_do_not_matched() throws Exception {
+  public void find_groups_without_adding_anyone_group_when_search_text_do_not_matched() {
     when(permissionDao.selectGroups(any(PermissionQuery.class), anyLong())).thenReturn(
       newArrayList(new GroupWithPermissionDto().setName("users").setPermission("user"))
     );
@@ -220,7 +220,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_groups_with_added_anyone_group_when_search_text_matched() throws Exception {
+  public void find_groups_with_added_anyone_group_when_search_text_matched() {
     when(permissionDao.selectGroups(any(PermissionQuery.class), anyLong())).thenReturn(
       newArrayList(new GroupWithPermissionDto().setName("MyAnyGroup").setPermission("user"))
     );
@@ -231,7 +231,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_groups_without_adding_anyone_group_when_out_membership_selected() throws Exception {
+  public void find_groups_without_adding_anyone_group_when_out_membership_selected() {
     when(permissionDao.selectGroups(any(PermissionQuery.class), anyLong())).thenReturn(
       newArrayList(new GroupWithPermissionDto().setName("users").setPermission("user"))
     );
@@ -244,7 +244,7 @@ public class PermissionFinderTest {
 
 
   @Test
-  public void find_users_from_permission_template() throws Exception {
+  public void find_users_from_permission_template() {
     when(permissionTemplateDao.selectTemplateByKey(anyString())).thenReturn(new PermissionTemplateDto().setId(1L).setKee("my_template"));
 
     when(permissionTemplateDao.selectUsers(any(PermissionQuery.class), anyLong(), anyInt(), anyInt())).thenReturn(
@@ -257,7 +257,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void fail_to_find_users_from_permission_template_when_template_not_found() throws Exception {
+  public void fail_to_find_users_from_permission_template_when_template_not_found() {
     when(permissionTemplateDao.selectTemplateByKey(anyString())).thenReturn(null);
 
     try {
@@ -269,7 +269,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void find_groups_from_permission_template() throws Exception {
+  public void find_groups_from_permission_template() {
     when(permissionTemplateDao.selectTemplateByKey(anyString())).thenReturn(new PermissionTemplateDto().setId(1L).setKee("my_template"));
 
     when(permissionTemplateDao.selectGroups(any(PermissionQuery.class), anyLong())).thenReturn(
@@ -283,7 +283,7 @@ public class PermissionFinderTest {
   }
 
   @Test
-  public void fail_to_find_groups_from_permission_template_when_template_not_found() throws Exception {
+  public void fail_to_find_groups_from_permission_template_when_template_not_found() {
     when(permissionTemplateDao.selectTemplateByKey(anyString())).thenReturn(null);
 
     try {
index df43f956656e4d19fd86f1dbf46c22eb4290cb2c..40e9d03ab14dc98c909315b170f3598ca5db93d9 100644 (file)
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class PermissionQueryParserTest {
 
   @Test
-  public void to_query_with_all_params() throws Exception {
+  public void to_query_with_all_params() {
     Map<String, Object> params = newHashMap();
     params.put("permission", "admin");
     params.put("template", "my_template_key");
@@ -52,7 +52,7 @@ public class PermissionQueryParserTest {
   }
 
   @Test
-  public void to_query_with_include_membership_parameter() throws Exception {
+  public void to_query_with_include_membership_parameter() {
     Map<String, Object> params = newHashMap();
     params.put("permission", "admin");
     params.put("selected", "selected");
@@ -61,7 +61,7 @@ public class PermissionQueryParserTest {
   }
 
   @Test
-  public void to_query_with_exclude_membership_parameter() throws Exception {
+  public void to_query_with_exclude_membership_parameter() {
     Map<String, Object> params = newHashMap();
     params.put("permission", "admin");
     params.put("selected", "deselected");
@@ -70,7 +70,7 @@ public class PermissionQueryParserTest {
   }
 
   @Test
-  public void to_query_with_any_membership_parameter() throws Exception {
+  public void to_query_with_any_membership_parameter() {
     Map<String, Object> params = newHashMap();
     params.put("permission", "admin");
     params.put("selected", "all");
index f2a57a6c6111984bc884ef7c45c645e7fd40d5a8..21e61307e798995900c525bdf98a319bee2dea30 100644 (file)
@@ -29,7 +29,7 @@ import static org.junit.Assert.fail;
 public class PermissionQueryTest {
 
   @Test
-  public void fail_on_null_permission() throws Exception {
+  public void fail_on_null_permission() {
     PermissionQuery.Builder builder = PermissionQuery.builder();
     builder.permission(null);
 
@@ -42,7 +42,7 @@ public class PermissionQueryTest {
   }
 
   @Test
-  public void fail_on_invalid_membership() throws Exception {
+  public void fail_on_invalid_membership() {
     PermissionQuery.Builder builder = PermissionQuery.builder();
     builder.permission("admin");
     builder.membership("unknwown");
index 20a1e56bd6e94cdbc2382c222e67da227921a4e6..c851589dfa1c136747113ef316a205e17202fb8e 100644 (file)
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class PermissionTemplateTest {
 
   @Test
-  public void should_populate_template_with_permissions() throws Exception {
+  public void should_populate_template_with_permissions() {
 
     PermissionTemplateDto permissionTemplateDto = new PermissionTemplateDto()
       .setId(1L)
index ecbb0f091c5e53f6b1baa4396c33a3d8991b11af..409e59566f69ad0ccdf9b456e623a0b63debaa54 100644 (file)
@@ -57,7 +57,7 @@ public class PermissionTemplateUpdaterTest {
   }
 
   @Test
-  public void should_execute_on_valid_parameters() throws Exception {
+  public void should_execute_on_valid_parameters() {
 
     final PermissionTemplateDao permissionTemplateDao = mock(PermissionTemplateDao.class);
     when(permissionTemplateDao.selectTemplateByKey("my_template")).thenReturn(new PermissionTemplateDto().setId(1L));
@@ -75,7 +75,7 @@ public class PermissionTemplateUpdaterTest {
   }
 
   @Test
-  public void should_validate_template_reference() throws Exception {
+  public void should_validate_template_reference() {
     expected.expect(BadRequestException.class);
     expected.expectMessage("Unknown template:");
 
@@ -92,7 +92,7 @@ public class PermissionTemplateUpdaterTest {
   }
 
   @Test
-  public void should_validate_permission_reference() throws Exception {
+  public void should_validate_permission_reference() {
     expected.expect(BadRequestException.class);
     expected.expectMessage("Invalid permission:");
 
@@ -109,7 +109,7 @@ public class PermissionTemplateUpdaterTest {
   }
 
   @Test
-  public void should_check_that_user_is_logged_in() throws Exception {
+  public void should_check_that_user_is_logged_in() {
     expected.expect(UnauthorizedException.class);
     expected.expectMessage("Authentication is required");
 
@@ -124,7 +124,7 @@ public class PermissionTemplateUpdaterTest {
   }
 
   @Test
-  public void should_check_that_user_is_a_system_admin() throws Exception {
+  public void should_check_that_user_is_a_system_admin() {
     expected.expect(ForbiddenException.class);
     expected.expectMessage("Insufficient privileges");
 
index 0204f65a18b2e96f15e3fc26eb0a76a5b757f6f0..72bc14bd674badfb7d33cd26cd4bb317c37707b0 100644 (file)
@@ -33,12 +33,12 @@ public class PermissionsWsTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester = new WsTester(new PermissionsWs());
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     WebService.Controller controller = tester.controller("api/permissions");
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
@@ -47,7 +47,7 @@ public class PermissionsWsTest {
   }
 
   @Test
-  public void define_add_action() throws Exception {
+  public void define_add_action() {
     WebService.Controller controller = tester.controller("api/permissions");
 
     WebService.Action action = controller.action("add");
@@ -61,7 +61,7 @@ public class PermissionsWsTest {
   }
 
   @Test
-  public void define_remove_action() throws Exception {
+  public void define_remove_action() {
     WebService.Controller controller = tester.controller("api/permissions");
 
     WebService.Action action = controller.action("remove");
index ea25bf28e0d2378a7b07c2804d4af36b67dba920..766c8485e8c814ad4b0b83ae34985742549e4516 100644 (file)
@@ -54,12 +54,12 @@ public class BackendCleanupMediumTest {
   BackendCleanup backendCleanup;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     backendCleanup = new BackendCleanup(esTester.client(), dbTester.myBatis());
   }
 
   @Test
-  public void clear_db() throws Exception {
+  public void clear_db() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     backendCleanup.clearDb();
index b842311600621230254324d812ff8055a00c68c2..59a21b676b347c2280f0c7b9ac654cf377b058c9 100644 (file)
@@ -69,7 +69,7 @@ public class MasterServletFilterTest {
   }
 
   @Test
-  public void servlet_container_should_instantiate_only_a_single_master_instance() throws Exception {
+  public void servlet_container_should_instantiate_only_a_single_master_instance() {
     new MasterServletFilter();
 
     thrown.expect(IllegalStateException.class);
index a896f815fad135d7d22a1437961876339ad0342f..cf201343789a32851c550848c518a730a3d167b1 100644 (file)
@@ -43,7 +43,7 @@ public class PersistentSettingsTest {
   private ServerSettings settings;
 
   @Before
-  public void init() throws URISyntaxException {
+  public void init() {
     dao = mock(PropertiesDao.class);
 
     settings = new ServerSettings(
index be9c53e4d24387e05bb23d6785807b69993fe88a..a64486ca9d90d14de3467be56142e92a3906b2bd 100644 (file)
@@ -71,7 +71,7 @@ public class RailsAppsDeployerTest {
   }
 
   @Test
-  public void deployRubyRailsApps_no_apps() throws Exception {
+  public void deployRubyRailsApps_no_apps() {
     ServerFileSystem fileSystem = mock(ServerFileSystem.class);
     File tempDir = this.temp.getRoot();
     when(fileSystem.getTempDir()).thenReturn(tempDir);
index 68a3f260c517d801c389ed820e1e975207c2f838..0d0c323392fd430f01667011d5280a237bc05ba3 100644 (file)
@@ -47,7 +47,7 @@ public class ServerImplTest {
   ServerImpl server;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     settings = new Settings().setProperty(ProcessProperties.PATH_HOME, sonarHome.getRoot().getAbsolutePath());
     new File(sonarHome.getRoot(), "web/deploy").mkdirs();
 
index 6801327f647ad2469323bd9f1245a23c9f123d1a..1c97740c86b0a980fbaf70520013e977953ff73c 100644 (file)
@@ -36,7 +36,7 @@ public class ServerSettingsTest {
   ServerSettings settings;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     properties = new Properties();
     properties.put("hello", "world");
     properties.put("in_file", "true");
index 75aa97901f715ab7729f5f8e9fa2dd84bab2d28b..ca03a703e3433bc0f1ba9066ed572b4c3b1646c1 100644 (file)
@@ -38,7 +38,7 @@ public class DatabaseMonitorTest {
   DatabaseMonitor sut;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     DatabaseVersion dbVersion = new DatabaseVersion(dbTester.myBatis());
     DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis());
     sut = new DatabaseMonitor(dbVersion, dbClient);
index b633e5493d2568899465b9dca56e04b4e9861b66..d0aa16dc19c164fcccdfe46b3e95e0367b8911ca 100644 (file)
@@ -37,14 +37,14 @@ public class EsMonitorTest {
   public static EsTester esTester = new EsTester().addDefinitions(new IssueIndexDefinition(new Settings()));
 
   @Test
-  public void name() throws Exception {
+  public void name() {
     EsMonitor monitor = new EsMonitor(esTester.client());
     assertThat(monitor.name()).isEqualTo("ElasticSearch");
   }
 
 
   @Test
-  public void cluster_attributes() throws Exception {
+  public void cluster_attributes() {
     EsMonitor monitor = new EsMonitor(esTester.client());
     LinkedHashMap<String, Object> attributes = monitor.attributes();
     assertThat(monitor.getState()).isEqualTo(ClusterHealthStatus.GREEN.name());
@@ -53,7 +53,7 @@ public class EsMonitorTest {
   }
 
   @Test
-  public void node_attributes() throws Exception {
+  public void node_attributes() {
     EsMonitor monitor = new EsMonitor(esTester.client());
     LinkedHashMap<String, Object> attributes = monitor.attributes();
     Map nodesAttributes = (Map)attributes.get("Nodes");
@@ -66,7 +66,7 @@ public class EsMonitorTest {
   }
 
   @Test
-  public void index_attributes() throws Exception {
+  public void index_attributes() {
     EsMonitor monitor = new EsMonitor(esTester.client());
     LinkedHashMap<String, Object> attributes = monitor.attributes();
     Map indicesAttributes = (Map)attributes.get("Indices");
index 332b9b1fe6c89d61ff8d822c6e9f9fe6811fb725..28f3424f8388cc4dc6209b56b2f4b7c2ff31d05a 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class JvmPropertiesMonitorTest {
 
   @Test
-  public void attributes() throws Exception {
+  public void attributes() {
     JvmPropertiesMonitor sut = new JvmPropertiesMonitor();
     LinkedHashMap<String, Object> attributes = sut.attributes();
 
index 3f69c4faf576ab61f73353aa32789824367d714f..ef082c716b230bc76db28724bcdc778d19d91f3f 100644 (file)
@@ -39,12 +39,12 @@ public class PluginsMonitorTest {
   PluginsMonitor sut = new PluginsMonitor(new FakePluginRepository());;
 
   @Test
-  public void name() throws Exception {
+  public void name() {
     assertThat(sut.name()).isEqualTo("Plugins");
   }
 
   @Test
-  public void plugin_name_and_version() throws Exception {
+  public void plugin_name_and_version() {
     LinkedHashMap<String, Object> attributes = sut.attributes();
 
     assertThat(attributes).containsKeys("key-1", "key-2");
index 30ecd2207a725d7ccd75d9ba7d12b0db735e400e..e411ce656fade94a5286c1ad340a68c7c0d1cd9b 100644 (file)
@@ -44,7 +44,7 @@ public class SonarQubeMonitorTest {
   Server server = mock(Server.class);
 
   @Test
-  public void getServerId() throws Exception {
+  public void getServerId() {
     when(server.getStartedAt()).thenReturn(DateUtils.parseDate("2015-01-01"));
     SonarQubeMonitor monitor = new SonarQubeMonitor(settings, new SecurityRealmFactory(settings), server);
 
index ba7064ca217fb46ddda551640270a6d21800d90c..783e2cc1e10281e1a6c361aa5ad5a979eed73405 100644 (file)
@@ -30,12 +30,12 @@ public class SystemMonitorTest {
   SystemMonitor sut = new SystemMonitor();
 
   @Test
-  public void name() throws Exception {
+  public void name() {
     assertThat(sut.name()).isEqualTo("System");
   }
 
   @Test
-  public void system_properties() throws Exception {
+  public void system_properties() {
     LinkedHashMap<String, Object> attributes = sut.attributes();
 
     assertThat(attributes).containsKeys("System Date", "Processors");
index e009211abf86da39282536799c5933d8cb14151a..1090640f063664e4cc47f4e760f973b1dbe7af8b 100644 (file)
@@ -74,7 +74,7 @@ public class MigrateDbSystemWsActionTest {
   WsTester.TestResponse response = new WsTester.TestResponse();
 
   @Before
-  public void wireMocksTogether() throws Exception {
+  public void wireMocksTogether() {
     when(database.getDialect()).thenReturn(dialect);
   }
 
index 5e86ae4202427bf8789644f928104186bfa9fce9..f9ac6710946259b0ee9db06f1bb460e129a8039a 100644 (file)
@@ -32,7 +32,7 @@ public class ServerWsTest {
   WsTester tester = new WsTester(new ServerWs());
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     WebService.Controller controller = tester.controller("api/server");
     assertThat(controller).isNotNull();
     assertThat(controller.since()).isEqualTo("2.10");
@@ -41,7 +41,7 @@ public class ServerWsTest {
   }
 
   @Test
-  public void define_index_action() throws Exception {
+  public void define_index_action() {
     WebService.Controller controller = tester.controller("api/server");
 
     WebService.Action action = controller.action("index");
@@ -52,7 +52,7 @@ public class ServerWsTest {
   }
 
   @Test
-  public void define_setup_action() throws Exception {
+  public void define_setup_action() {
     WebService.Controller controller = tester.controller("api/server");
 
     WebService.Action action = controller.action("setup");
index eeaeaa8dc389f27f9891ad19c730eae4b9922302..ec567be0b1d8288321e09cabe2ba0db62e30d1ee 100644 (file)
@@ -43,7 +43,7 @@ public class SystemInfoWsActionTest {
   SystemInfoWsAction sut = new SystemInfoWsAction(monitor1, monitor2);
 
   @Test(expected = ForbiddenException.class)
-  public void should_fail_when_does_not_have_admin_right() throws Exception {
+  public void should_fail_when_does_not_have_admin_right() {
     MockUserSession.set()
       .setLogin("login")
       .setName("name")
@@ -53,7 +53,7 @@ public class SystemInfoWsActionTest {
   }
 
   @Test
-  public void write_json() throws Exception {
+  public void write_json() {
     MockUserSession.set()
       .setLogin("login")
       .setName("name")
index 1c535200e662f5e477ef15855281fef1ab2245a6..96c2879b88eb0c10702387e0080259acbf973b50 100644 (file)
@@ -30,7 +30,7 @@ import static org.mockito.Mockito.mock;
 public class SystemWsTest {
 
   @Test
-  public void define() throws Exception {
+  public void define() {
     SystemRestartWsAction action1 = new SystemRestartWsAction(mock(Settings.class), mock(Platform.class));
     SystemInfoWsAction action2 = new SystemInfoWsAction();
     SystemWs ws = new SystemWs(action1, action2);
index f073f03d56d2bbdd395e74cb7c986c8376cfe327..24557f8b0359245353a474bce25f6ab803b86747 100644 (file)
@@ -56,13 +56,13 @@ public class UpgradesSystemWsActionTest {
   private WsTester.TestResponse response = new WsTester.TestResponse();
 
   @Before
-  public void wireMocks() throws Exception {
+  public void wireMocks() {
     when(updateCenterFactory.getUpdateCenter(anyBoolean())).thenReturn(updateCenter);
     when(updateCenter.getDate()).thenReturn(DateUtils.parseDateTime("2015-04-24T16:08:36+0200"));
   }
 
   @Test
-  public void action_updates_is_defined() throws Exception {
+  public void action_updates_is_defined() {
     WsTester wsTester = new WsTester();
     WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
 
index b5e92448752dcf4378e4c81406a780f32e7c4613..bf460fffd2b1b27b39475b36e075f081770aa0e2 100644 (file)
@@ -110,7 +110,7 @@ public class PluginDownloaderTest {
   }
 
   @Test
-  public void download_from_url() throws Exception {
+  public void download_from_url() {
     Plugin test = new Plugin("test");
     Release test10 = new Release(test, "1.0").setDownloadUrl("http://server/test-1.0.jar");
     test.addRelease(test10);
@@ -131,7 +131,7 @@ public class PluginDownloaderTest {
    * SONAR-4685
    */
   @Test
-  public void download_from_redirect_url() throws Exception {
+  public void download_from_redirect_url() {
     Plugin test = new Plugin("plugin-test");
     Release test10 = new Release(test, "1.0").setDownloadUrl("http://server/redirect?r=release&g=test&a=test&v=1.0&e=jar");
     test.addRelease(test10);
@@ -181,7 +181,7 @@ public class PluginDownloaderTest {
   }
 
   @Test
-  public void throw_exception_if_could_not_download() throws Exception {
+  public void throw_exception_if_could_not_download() {
     Plugin test = new Plugin("test");
     Release test10 = new Release(test, "1.0").setDownloadUrl("file://not_found");
     test.addRelease(test10);
@@ -198,7 +198,7 @@ public class PluginDownloaderTest {
   }
 
   @Test
-  public void throw_exception_if_download_fail() throws Exception {
+  public void throw_exception_if_download_fail() {
     Plugin test = new Plugin("test");
     Release test10 = new Release(test, "1.0").setDownloadUrl("http://server/test-1.0.jar");
     test.addRelease(test10);
@@ -266,7 +266,7 @@ public class PluginDownloaderTest {
 
   // SONAR-5011
   @Test
-  public void download_common_transitive_dependency() throws Exception {
+  public void download_common_transitive_dependency() {
     Plugin test1 = new Plugin("test1");
     Release test1R = new Release(test1, "1.0").setDownloadUrl("http://server/test1-1.0.jar");
     test1.addRelease(test1R);
index 05e4a0855ed0f0d30a30d12b7a1ebc95ab391844..a5c8fe0f84147337c208e8f214ea0eaf669706ff 100644 (file)
@@ -36,7 +36,7 @@ public class StaticResourcesServletTest {
   private HttpServletRequest request;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     servlet = new StaticResourcesServlet();
     request = mock(HttpServletRequest.class);
   }
index fd4ab2ffb9c8bc7d0982024d66b06c68be755ded..92c7fbab55a23f8772f0ab49036c472968e9771a 100644 (file)
@@ -72,7 +72,7 @@ public class AbstractUpdateCenterBasedPluginsWsActionTest {
   }
 
   @Before
-  public void wireMocksTogether() throws Exception {
+  public void wireMocksTogether() {
     when(updateCenterFactory.getUpdateCenter(anyBoolean())).thenReturn(updateCenter);
     when(updateCenter.getDate()).thenReturn(DateUtils.parseDateTime("2015-04-24T16:08:36+0200"));
   }
index ac70bc874cd5172d638a1f7a1bb2ac6b6081bd57..220975fbfd534508bb4f67010589109c04abf8a4 100644 (file)
@@ -55,7 +55,7 @@ public class AvailablePluginsWsActionTest extends AbstractUpdateCenterBasedPlugi
   private AvailablePluginsWsAction underTest = new AvailablePluginsWsAction(updateCenterFactory, new PluginWSCommons());
 
   @Test
-  public void action_available_is_defined() throws Exception {
+  public void action_available_is_defined() {
     WsTester wsTester = new WsTester();
     WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
 
@@ -130,7 +130,7 @@ public class AvailablePluginsWsActionTest extends AbstractUpdateCenterBasedPlugi
   }
 
   @Test
-  public void plugins_are_sorted_by_name_then_key_and_made_unique() throws Exception {
+  public void plugins_are_sorted_by_name_then_key_and_made_unique() {
     when(updateCenter.findAvailablePlugins()).thenReturn(of(
       pluginUpdate("key2", "name2"),
       pluginUpdate("key1", "name2"),
index 808590cc2aac311becfda15bb3106cf2155d6cba..4ff9f43f3404b222411c3716a507101c28b2338d 100644 (file)
@@ -51,12 +51,12 @@ public class CancelAllPluginsWsActionTest {
   public ExpectedException expectedException = ExpectedException.none();
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
   }
 
   @Test
-  public void action_cancel_all_is_defined() throws Exception {
+  public void action_cancel_all_is_defined() {
     WsTester wsTester = new WsTester();
     WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
 
index 5eaa8440e1a97f65abad1922b60ad139dc6496d3..dae2573c115705a4d4860760f398544145bd8822 100644 (file)
@@ -64,7 +64,7 @@ public class InstallPluginsWsActionTest {
   public ExpectedException expectedException = ExpectedException.none();
 
   @Before
-  public void wireMocks() throws Exception {
+  public void wireMocks() {
     when(updateCenterFactory.getUpdateCenter(anyBoolean())).thenReturn(updateCenter);
 
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
@@ -82,7 +82,7 @@ public class InstallPluginsWsActionTest {
   }
 
   @Test
-  public void action_install_is_defined() throws Exception {
+  public void action_install_is_defined() {
     WsTester wsTester = new WsTester();
     WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
 
index c6470051181f58f375776f1357a107200f53d617..3780d88af0063890dfe12cf3929c0414d8e1f8b2 100644 (file)
@@ -50,7 +50,7 @@ public class InstalledPluginsWsActionTest {
   private PluginMetadata corePlugin = corePlugin("core1", 10);
 
   @Test
-  public void action_installed_is_defined() throws Exception {
+  public void action_installed_is_defined() {
     WsTester wsTester = new WsTester();
     WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
 
index 26e8bfb4cd9fd14dbe64b892fbee27c0e4691823..558ed57839a4e562159619d3e34ec5a202d6968a 100644 (file)
@@ -61,7 +61,7 @@ public class PendingPluginsWsActionTest {
   private WsTester.TestResponse response = new WsTester.TestResponse();
 
   @Test
-  public void action_pending_is_defined() throws Exception {
+  public void action_pending_is_defined() {
     WsTester wsTester = new WsTester();
     WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
 
index 09c5ee87c3c8ee05db116b5653aad2c18e4af2de..f2e3ba637dc63a6c223c242edfb83694b864f375 100644 (file)
@@ -34,19 +34,19 @@ public class PluginUpdateAggregateBuilderTest {
   private static final PluginUpdate.Status SOME_STATUS = PluginUpdate.Status.COMPATIBLE;
 
   @Test(expected = NullPointerException.class)
-  public void plugin_can_not_be_null_and_builderFor_enforces_it_with_NPE() throws Exception {
+  public void plugin_can_not_be_null_and_builderFor_enforces_it_with_NPE() {
     PluginUpdateAggregateBuilder.builderFor(null);
   }
 
   @Test(expected = IllegalArgumentException.class)
-  public void add_throws_IAE_when_plugin_is_not_equal_to_the_one_of_the_builder() throws Exception {
+  public void add_throws_IAE_when_plugin_is_not_equal_to_the_one_of_the_builder() {
     PluginUpdateAggregateBuilder builder = PluginUpdateAggregateBuilder.builderFor(PLUGIN_1);
 
     builder.add(createPluginUpdate(PLUGIN_2));
   }
 
   @Test
-  public void add_uses_equals_which_takes_only_key_into_account() throws Exception {
+  public void add_uses_equals_which_takes_only_key_into_account() {
     PluginUpdateAggregateBuilder builder = PluginUpdateAggregateBuilder.builderFor(PLUGIN_1);
 
     builder.add(createPluginUpdate(new Plugin(PLUGIN_1.getKey())));
index b7e6140a562fbfd9ac2cf2f4e2016ca5d86ea118..2ec301c2ad47e8b5cc297237fdca7360b619a66e 100644 (file)
@@ -38,17 +38,17 @@ public class PluginUpdateAggregatorTest {
   private PluginUpdateAggregator underTest = new PluginUpdateAggregator();
 
   @Test
-  public void aggregates_returns_an_empty_collection_when_plugin_collection_is_null() throws Exception {
+  public void aggregates_returns_an_empty_collection_when_plugin_collection_is_null() {
     assertThat(underTest.aggregate(null)).isEmpty();
   }
 
   @Test
-  public void aggregates_returns_an_empty_collection_when_plugin_collection_is_empty() throws Exception {
+  public void aggregates_returns_an_empty_collection_when_plugin_collection_is_empty() {
     assertThat(underTest.aggregate(Collections.<PluginUpdate>emptyList())).isEmpty();
   }
 
   @Test
-  public void aggregates_groups_pluginUpdate_per_plugin_key() throws Exception {
+  public void aggregates_groups_pluginUpdate_per_plugin_key() {
     Collection<PluginUpdateAggregator.PluginUpdateAggregate> aggregates = underTest.aggregate(ImmutableList.of(
       createPluginUpdate("key1"),
       createPluginUpdate("key1"),
@@ -62,7 +62,7 @@ public class PluginUpdateAggregatorTest {
   }
 
   @Test
-  public void aggregate_put_pluginUpdates_with_same_plugin_in_the_same_PluginUpdateAggregate() throws Exception {
+  public void aggregate_put_pluginUpdates_with_same_plugin_in_the_same_PluginUpdateAggregate() {
     PluginUpdate pluginUpdate1 = createPluginUpdate("key1");
     PluginUpdate pluginUpdate2 = createPluginUpdate("key1");
     PluginUpdate pluginUpdate3 = createPluginUpdate("key1");
index 9c220bb129080b071681f6046b86ccf7ad6a531b..291e58e2d629b86df84363d7a8f6b6ea3c0f4ba0 100644 (file)
@@ -31,7 +31,7 @@ public class PluginsWsTest {
   private WsTester tester = new WsTester(new PluginsWs(new DummyPluginsWsAction()));
 
   @Test
-  public void defines_controller_and_binds_PluginsWsActions() throws Exception {
+  public void defines_controller_and_binds_PluginsWsActions() {
     WebService.Controller controller = tester.controller("api/plugins");
 
     assertThat(controller).isNotNull();
index ecc71e4d71950667039b8441f374e2f37e877fe8..fa8adaa0f98e7ad544aabd6820c3ccab7f04c9b9 100644 (file)
@@ -60,7 +60,7 @@ public class UninstallPluginsWsActionTest {
   public ExpectedException expectedException = ExpectedException.none();
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
   }
 
@@ -76,7 +76,7 @@ public class UninstallPluginsWsActionTest {
   }
 
   @Test
-  public void action_uninstall_is_defined() throws Exception {
+  public void action_uninstall_is_defined() {
     WsTester wsTester = new WsTester();
     WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
 
index 021cacb08c6b12b6c2cb5f22f897a55658698629..82a1f39c29d371b68952aff2772dc01f1d86a282 100644 (file)
@@ -66,7 +66,7 @@ public class UpdatePluginsWsActionTest {
   public ExpectedException expectedException = ExpectedException.none();
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(updateCenterFactory.getUpdateCenter(anyBoolean())).thenReturn(updateCenter);
 
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
@@ -84,7 +84,7 @@ public class UpdatePluginsWsActionTest {
   }
 
   @Test
-  public void action_update_is_defined() throws Exception {
+  public void action_update_is_defined() {
     WsTester wsTester = new WsTester();
     WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
 
index de7722b5f81076f65841c98761b46be20ce5ff6c..4784b7cedae32c68d3fb840459863f0cf096fce9 100644 (file)
@@ -75,7 +75,7 @@ public class UpdatesPluginsWsActionTest extends AbstractUpdateCenterBasedPlugins
     );
 
   @Test
-  public void action_updatable_is_defined() throws Exception {
+  public void action_updatable_is_defined() {
     WsTester wsTester = new WsTester();
     WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
 
index 1ca4a8cc6d6c6b3fae30d5369ca34057353d2ef7..367d92d895b31312befd97368e77c5b80514ad8a 100644 (file)
@@ -48,21 +48,21 @@ public class ProjectSettingsFactoryTest {
   }
 
   @Test
-  public void newProjectSettings_returns_a_ProjectSettings() throws Exception {
+  public void newProjectSettings_returns_a_ProjectSettings() {
     Settings projectSettings = sut.newProjectSettings(1L);
 
     assertThat(projectSettings).isInstanceOf(ProjectSettings.class);
   }
 
   @Test
-  public void transform_empty_list_into_empty_map() throws Exception {
+  public void transform_empty_list_into_empty_map() {
     Map<String, String> propertyMap = sut.getPropertyMap(Lists.<PropertyDto>newArrayList());
 
     assertThat(propertyMap).isEmpty();
   }
 
   @Test
-  public void transform_list_of_properties_in_map_key_value() throws Exception {
+  public void transform_list_of_properties_in_map_key_value() {
     PropertyDto property1 = new PropertyDto().setKey("1").setValue("val1");
     PropertyDto property2 = new PropertyDto().setKey("2").setValue("val2");
     PropertyDto property3 = new PropertyDto().setKey("3").setValue("val3");
index b8f99fcc2a27173b86065a784faff8e00bfa3fd2..5ecc59179598d54a3fcc2286f228b8c49b9c5e4d 100644 (file)
@@ -38,12 +38,12 @@ public class ProjectSettingsTest {
   private Settings settings;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     this.settings = mock(Settings.class);
   }
 
   @Test
-  public void call_global_settings_method_when_no_project_specific_settings() throws Exception {
+  public void call_global_settings_method_when_no_project_specific_settings() {
     this.sut = new ProjectSettings(settings, Maps.<String, String>newHashMap());
 
     sut.getInt("anyKey");
@@ -56,7 +56,7 @@ public class ProjectSettingsTest {
   }
 
   @Test(expected = NumberFormatException.class)
-  public void getInt_property_throws_exception_when_value_is_not_formatted_correctly() throws Exception {
+  public void getInt_property_throws_exception_when_value_is_not_formatted_correctly() {
     HashMap<String, String> properties = Maps.newHashMap();
     properties.put("intKey", "wrongIntValue");
     this.sut = new ProjectSettings(settings, properties);
@@ -65,7 +65,7 @@ public class ProjectSettingsTest {
   }
 
   @Test
-  public void getInt_property_return_0_when_empty_property() throws Exception {
+  public void getInt_property_return_0_when_empty_property() {
     HashMap<String, String> properties = Maps.newHashMap();
     properties.put("intKey", "");
     this.sut = new ProjectSettings(settings, properties);
@@ -76,7 +76,7 @@ public class ProjectSettingsTest {
   }
 
   @Test
-  public void getInt_property_return_the_int_value() throws Exception {
+  public void getInt_property_return_the_int_value() {
     HashMap<String, String> properties = Maps.newHashMap();
     properties.put("intKey", "123");
     this.sut = new ProjectSettings(settings, properties);
@@ -87,7 +87,7 @@ public class ProjectSettingsTest {
   }
 
   @Test
-  public void getString_returns_String_property() throws Exception {
+  public void getString_returns_String_property() {
     HashMap<String, String> properties = Maps.newHashMap();
     properties.put("stringKey", "stringValue");
     this.sut = new ProjectSettings(settings, properties);
@@ -98,7 +98,7 @@ public class ProjectSettingsTest {
   }
 
   @Test
-  public void getBoolean_returns_exception_when_value_is_not_formatted_correctly() throws Exception {
+  public void getBoolean_returns_exception_when_value_is_not_formatted_correctly() {
     HashMap<String, String> properties = Maps.newHashMap();
     properties.put("boolKey", "wronglyFormattedBoolean");
     this.sut = new ProjectSettings(settings, properties);
@@ -109,7 +109,7 @@ public class ProjectSettingsTest {
   }
 
   @Test
-  public void getBoolean_returns_false_when_value_is_empty() throws Exception {
+  public void getBoolean_returns_false_when_value_is_empty() {
     HashMap<String, String> properties = Maps.newHashMap();
     properties.put("boolKey", "");
     this.sut = new ProjectSettings(settings, properties);
@@ -120,7 +120,7 @@ public class ProjectSettingsTest {
   }
 
   @Test
-  public void getBoolean_returns_true_when_value_is_true_ignoring_case() throws Exception {
+  public void getBoolean_returns_true_when_value_is_true_ignoring_case() {
     HashMap<String, String> properties = Maps.newHashMap();
     properties.put("boolKey1", "true");
     properties.put("boolKey2", "True");
index 0e7c397ceb4b4670b71158888e01b9c40f53aa83..aa1432ea3ad78b68cf5308d476845db570c57adf 100644 (file)
@@ -107,14 +107,14 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_list_qgates() throws Exception {
+  public void should_list_qgates() {
     List<QualityGateDto> allQgates = Lists.newArrayList(new QualityGateDto().setName("Gate One"), new QualityGateDto().setName("Gate Two"));
     when(dao.selectAll()).thenReturn(allQgates);
     assertThat(qGates.list()).isEqualTo(allQgates);
   }
 
   @Test
-  public void should_create_qgate() throws Exception {
+  public void should_create_qgate() {
     String name = "SG-1";
     QualityGateDto sg1 = qGates.create(name);
     assertThat(sg1.getName()).isEqualTo(name);
@@ -124,32 +124,32 @@ public class QualityGatesTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void should_fail_create_on_anonymous() throws Exception {
+  public void should_fail_create_on_anonymous() {
     UserSessionTestUtils.setUserSession(unauthenticatedUserSession);
     assertThat(qGates.currentUserHasWritePermission()).isFalse();
     qGates.create("polop");
   }
 
   @Test(expected = ForbiddenException.class)
-  public void should_fail_create_on_missing_permission() throws Exception {
+  public void should_fail_create_on_missing_permission() {
     UserSessionTestUtils.setUserSession(unauthorizedUserSession);
     qGates.create("polop");
   }
 
   @Test(expected = BadRequestException.class)
-  public void should_fail_create_on_empty_name() throws Exception {
+  public void should_fail_create_on_empty_name() {
     qGates.create("");
   }
 
   @Test(expected = BadRequestException.class)
-  public void should_fail_create_on_duplicate_name() throws Exception {
+  public void should_fail_create_on_duplicate_name() {
     String name = "SG-1";
     when(dao.selectByName(name)).thenReturn(new QualityGateDto().setName(name).setId(42L));
     qGates.create(name);
   }
 
   @Test
-  public void should_get_qgate_by_id() throws Exception {
+  public void should_get_qgate_by_id() {
     long id = 42L;
     final String name = "Golden";
     QualityGateDto existing = new QualityGateDto().setId(id).setName(name);
@@ -159,7 +159,7 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_get_qgate_by_name() throws Exception {
+  public void should_get_qgate_by_name() {
     long id = 42L;
     final String name = "Golden";
     QualityGateDto existing = new QualityGateDto().setId(id).setName(name);
@@ -169,12 +169,12 @@ public class QualityGatesTest {
   }
 
   @Test(expected = NotFoundException.class)
-  public void should_fail_to_find_qgate_by_name() throws Exception {
+  public void should_fail_to_find_qgate_by_name() {
     qGates.get("Does not exist");
   }
 
   @Test
-  public void should_rename_qgate() throws Exception {
+  public void should_rename_qgate() {
     long id = 42L;
     String name = "SG-1";
     QualityGateDto existing = new QualityGateDto().setId(id).setName("Golden");
@@ -187,7 +187,7 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_allow_rename_with_same_name() throws Exception {
+  public void should_allow_rename_with_same_name() {
     long id = 42L;
     String name = "SG-1";
     QualityGateDto existing = new QualityGateDto().setId(id).setName(name);
@@ -200,12 +200,12 @@ public class QualityGatesTest {
   }
 
   @Test(expected = NotFoundException.class)
-  public void should_fail_rename_on_inexistent_qgate() throws Exception {
+  public void should_fail_rename_on_inexistent_qgate() {
     qGates.rename(42L, "Unknown");
   }
 
   @Test(expected = BadRequestException.class)
-  public void should_fail_rename_on_duplicate_name() throws Exception {
+  public void should_fail_rename_on_duplicate_name() {
     long id = 42L;
     String name = "SG-1";
     QualityGateDto existing = new QualityGateDto().setId(id).setName("Golden");
@@ -215,7 +215,7 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_select_default_qgate() throws Exception {
+  public void should_select_default_qgate() {
     long defaultId = 42L;
     String defaultName = "Default Name";
     when(dao.selectById(defaultId)).thenReturn(new QualityGateDto().setId(defaultId).setName(defaultName));
@@ -228,13 +228,13 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_unset_default_qgate() throws Exception {
+  public void should_unset_default_qgate() {
     qGates.setDefault(null);
     verify(propertiesDao).deleteGlobalProperty("sonar.qualitygate");
   }
 
   @Test
-  public void should_delete_qgate() throws Exception {
+  public void should_delete_qgate() {
     long idToDelete = 42L;
     String name = "To Delete";
     QualityGateDto toDelete = new QualityGateDto().setId(idToDelete).setName(name);
@@ -248,7 +248,7 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_delete_qgate_if_non_default() throws Exception {
+  public void should_delete_qgate_if_non_default() {
     long idToDelete = 42L;
     String name = "To Delete";
     QualityGateDto toDelete = new QualityGateDto().setId(idToDelete).setName(name);
@@ -263,7 +263,7 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_delete_qgate_even_if_default() throws Exception {
+  public void should_delete_qgate_even_if_default() {
     long idToDelete = 42L;
     String name = "To Delete";
     QualityGateDto toDelete = new QualityGateDto().setId(idToDelete).setName(name);
@@ -279,7 +279,7 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_return_default_qgate_if_set() throws Exception {
+  public void should_return_default_qgate_if_set() {
     String defaultName = "Sonar way";
     long defaultId = 42L;
     when(propertiesDao.selectGlobalProperty("sonar.qualitygate")).thenReturn(new PropertyDto().setValue(Long.toString(defaultId)));
@@ -289,7 +289,7 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_return_null_default_qgate_if_unset() throws Exception {
+  public void should_return_null_default_qgate_if_unset() {
     when(propertiesDao.selectGlobalProperty("sonar.qualitygate")).thenReturn(new PropertyDto().setValue(""));
     assertThat(qGates.getDefault()).isNull();
   }
@@ -455,7 +455,7 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_list_conditions() throws Exception {
+  public void should_list_conditions() {
     long qGateId = 42L;
     long metric1Id = 1L;
     String metric1Key = "polop";
@@ -478,7 +478,7 @@ public class QualityGatesTest {
   }
 
   @Test(expected = IllegalStateException.class)
-  public void should_do_a_sanity_check_when_listing_conditions() throws Exception {
+  public void should_do_a_sanity_check_when_listing_conditions() {
     long qGateId = 42L;
     long metric1Id = 1L;
     String metric1Key = "polop";
@@ -494,7 +494,7 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_delete_condition() throws Exception {
+  public void should_delete_condition() {
     long idToDelete = 42L;
     QualityGateConditionDto toDelete = new QualityGateConditionDto().setId(idToDelete);
     when(conditionDao.selectById(idToDelete)).thenReturn(toDelete);
@@ -504,7 +504,7 @@ public class QualityGatesTest {
   }
 
   @Test(expected = NotFoundException.class)
-  public void should_fail_delete_condition() throws Exception {
+  public void should_fail_delete_condition() {
     qGates.deleteCondition(42L);
   }
 
@@ -563,7 +563,7 @@ public class QualityGatesTest {
   }
 
   @Test
-  public void should_copy_qgate() throws Exception {
+  public void should_copy_qgate() {
     String name = "Atlantis";
     long sourceId = 42L;
     final long destId = 43L;
index 6e531cac71c04561910a7fc848e0b4a90092ab13..0eea3c11b57718d047ef3aa0eb547fa133a86fb8 100644 (file)
@@ -75,7 +75,7 @@ public class QGatesWsTest {
   }
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     Controller controller = tester.controller("api/qualitygates");
     assertThat(controller).isNotNull();
     assertThat(controller.path()).isEqualTo("api/qualitygates");
index 4abb34861d66c31919aa820c01984c49694a0eda..e9278558413c17dd409cb6f29bc309e98b97af8b 100644 (file)
@@ -82,7 +82,7 @@ public class ActiveRuleBackendMediumTest {
   }
 
   @Test
-  public void synchronize_index() throws Exception {
+  public void synchronize_index() {
 
     Date beginning = new Date();
 
@@ -147,7 +147,7 @@ public class ActiveRuleBackendMediumTest {
   }
 
   @Test
-  public void insert_and_index_active_rule_param() throws InterruptedException {
+  public void insert_and_index_active_rule_param() {
     // insert and index
     QualityProfileDto profileDto = QProfileTesting.newXooP1();
     db.qualityProfileDao().insert(dbSession, profileDto);
@@ -195,7 +195,7 @@ public class ActiveRuleBackendMediumTest {
   }
 
   @Test
-  public void find_active_rules() throws Exception {
+  public void find_active_rules() {
     QualityProfileDto profile1 = QProfileTesting.newXooP1();
     QualityProfileDto profile2 = QProfileTesting.newXooP2();
     db.qualityProfileDao().insert(dbSession, profile1, profile2);
index b0769b244e580d1e6a2f2a7fe1715ddddc8e53d9..ff387a6e10b8744471e4cd1029b3a359b20b0eab 100644 (file)
@@ -31,12 +31,12 @@ public class BuiltInProfilesTest {
   BuiltInProfiles cache;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     cache = new BuiltInProfiles();
   }
 
   @Test
-  public void add_profiles() throws Exception {
+  public void add_profiles() {
     cache.put("java", "Default");
     cache.put("java", "Sonar Way");
     cache.put("js", "Default");
@@ -46,7 +46,7 @@ public class BuiltInProfilesTest {
   }
 
   @Test
-  public void not_add_same_profile_name() throws Exception {
+  public void not_add_same_profile_name() {
     cache.put("java", "Default");
     cache.put("java", "Default");
 
index 173d7a60ccfc3c6a26731acad763f3d15698ceb1..454835e56f33fccbe6e8efabfb8c126eea7283a5 100644 (file)
@@ -73,7 +73,7 @@ public class QProfileBackuperMediumTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
@@ -110,7 +110,7 @@ public class QProfileBackuperMediumTest {
   }
 
   @Test
-  public void fail_to_backup_unknown_profile() throws Exception {
+  public void fail_to_backup_unknown_profile() {
     try {
       tester.get(QProfileBackuper.class).backup("unknown", new StringWriter());
       fail();
index 12ba968260e7cb0bf0cf2fef8487f6b93a1e75ab..9652b9b7ef1b281fb8b9822b628e7281f0bc98e1 100644 (file)
@@ -80,12 +80,12 @@ public class QProfileComparisonMediumTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
   @Test
-  public void compare_empty_profiles() throws Exception {
+  public void compare_empty_profiles() {
     QProfileComparisonResult result = comparison.compare(left.getKey(), right.getKey());
     assertThat(result.left().getKey()).isEqualTo(left.getKey());
     assertThat(result.right().getKey()).isEqualTo(right.getKey());
@@ -97,7 +97,7 @@ public class QProfileComparisonMediumTest {
   }
 
   @Test
-  public void compare_same() throws Exception {
+  public void compare_same() {
     RuleActivation commonActivation = new RuleActivation(xooRule1.getKey())
       .setSeverity(Severity.CRITICAL)
       .setParameter("min", "7")
@@ -117,7 +117,7 @@ public class QProfileComparisonMediumTest {
   }
 
   @Test
-  public void compare_only_left() throws Exception {
+  public void compare_only_left() {
     ruleActivator.activate(dbSession, new RuleActivation(xooRule1.getKey()), left);
     dbSession.commit();
 
@@ -132,7 +132,7 @@ public class QProfileComparisonMediumTest {
   }
 
   @Test
-  public void compare_only_right() throws Exception {
+  public void compare_only_right() {
     ruleActivator.activate(dbSession, new RuleActivation(xooRule1.getKey()), right);
     dbSession.commit();
 
@@ -147,7 +147,7 @@ public class QProfileComparisonMediumTest {
   }
 
   @Test
-  public void compare_disjoint() throws Exception {
+  public void compare_disjoint() {
     ruleActivator.activate(dbSession, new RuleActivation(xooRule1.getKey()), left);
     ruleActivator.activate(dbSession, new RuleActivation(xooRule2.getKey()), right);
     dbSession.commit();
@@ -163,7 +163,7 @@ public class QProfileComparisonMediumTest {
   }
 
   @Test
-  public void compare_modified_severity() throws Exception {
+  public void compare_modified_severity() {
     ruleActivator.activate(dbSession, new RuleActivation(xooRule1.getKey()).setSeverity(Severity.CRITICAL), left);
     ruleActivator.activate(dbSession, new RuleActivation(xooRule1.getKey()).setSeverity(Severity.BLOCKER), right);
     dbSession.commit();
@@ -184,7 +184,7 @@ public class QProfileComparisonMediumTest {
   }
 
   @Test
-  public void compare_modified_param() throws Exception {
+  public void compare_modified_param() {
     ruleActivator.activate(dbSession, new RuleActivation(xooRule1.getKey()).setParameter("max", "20"), left);
     ruleActivator.activate(dbSession, new RuleActivation(xooRule1.getKey()).setParameter("max", "30"), right);
     dbSession.commit();
@@ -208,7 +208,7 @@ public class QProfileComparisonMediumTest {
   }
 
   @Test
-  public void compare_different_params() throws Exception {
+  public void compare_different_params() {
     ruleActivator.activate(dbSession, new RuleActivation(xooRule1.getKey()).setParameter("max", "20"), left);
     ruleActivator.activate(dbSession, new RuleActivation(xooRule1.getKey()).setParameter("min", "5"), right);
     dbSession.commit();
@@ -231,12 +231,12 @@ public class QProfileComparisonMediumTest {
   }
 
   @Test(expected = IllegalArgumentException.class)
-  public void fail_on_unknown_left() throws Exception {
+  public void fail_on_unknown_left() {
     comparison.compare("polop", right.getKey());
   }
 
   @Test(expected = IllegalArgumentException.class)
-  public void fail_on_unknown_right() throws Exception {
+  public void fail_on_unknown_right() {
     comparison.compare(left.getKey(), "polop");
   }
 }
index 3f5575b3f481a42752ee327d559972b03e4f2a52..87a3dc9f4ec24c666ce0969c3433d7eaa8b967a7 100644 (file)
@@ -79,12 +79,12 @@ public class QProfileCopierMediumTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
   @Test
-  public void create_target_profile() throws Exception {
+  public void create_target_profile() {
     // source
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setSeverity(Severity.BLOCKER);
@@ -100,7 +100,7 @@ public class QProfileCopierMediumTest {
   }
 
   @Test
-  public void update_target_profile() throws Exception {
+  public void update_target_profile() {
     // source with x1 activated
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setSeverity(Severity.BLOCKER);
@@ -128,7 +128,7 @@ public class QProfileCopierMediumTest {
   }
 
   @Test
-  public void create_target_profile_with_same_parent_than_source() throws Exception {
+  public void create_target_profile_with_same_parent_than_source() {
     // two profiles : parent and its child
     db.qualityProfileDao().insert(dbSession, QProfileTesting.newXooP2().setParentKee(QProfileTesting.XOO_P1_KEY));
 
@@ -149,7 +149,7 @@ public class QProfileCopierMediumTest {
   }
 
   @Test
-  public void fail_to_copy_on_self() throws Exception {
+  public void fail_to_copy_on_self() {
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setSeverity(Severity.BLOCKER);
     activation.setParameter("max", "7");
index dbb5983b2b1dd02caf7c6d73d8821d28e58d0851..cb0271b1bfb10cad5c953d7a3dc58820192a9a6e 100644 (file)
@@ -72,19 +72,19 @@ public class QProfileExportersTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
   @Test
-  public void exportersForLanguage() throws Exception {
+  public void exportersForLanguage() {
     assertThat(exporters.exportersForLanguage("xoo")).hasSize(2);
     assertThat(exporters.exportersForLanguage("java")).hasSize(1);
     assertThat(exporters.exportersForLanguage("java").get(0)).isInstanceOf(StandardExporter.class);
   }
 
   @Test
-  public void mimeType() throws Exception {
+  public void mimeType() {
     assertThat(exporters.mimeType("xootool")).isEqualTo("plain/custom");
 
     // default mime type
@@ -120,12 +120,12 @@ public class QProfileExportersTest {
   }
 
   @Test
-  public void profile_importers_for_language() throws Exception {
+  public void profile_importers_for_language() {
     assertThat(exporters.findProfileImportersForLanguage("xoo")).hasSize(3);
   }
 
   @Test
-  public void import_xml() throws Exception {
+  public void import_xml() {
     QualityProfileDto profileDto = QProfileTesting.newDto(QProfileName.createFor("xoo", "import_xml"), "import_xml");
     db.qualityProfileDao().insert(dbSession, profileDto);
     dbSession.commit();
@@ -143,7 +143,7 @@ public class QProfileExportersTest {
   }
 
   @Test
-  public void import_xml_return_messages() throws Exception {
+  public void import_xml_return_messages() {
     QProfileResult result = exporters.importXml(QProfileTesting.newXooP1(), "XooProfileImporterWithMessages", "<xml/>", dbSession);
     dbSession.commit();
 
@@ -152,7 +152,7 @@ public class QProfileExportersTest {
   }
 
   @Test
-  public void fail_to_import_xml_when_error_in_importer() throws Exception {
+  public void fail_to_import_xml_when_error_in_importer() {
     try {
       exporters.importXml(QProfileTesting.newXooP1(), "XooProfileImporterWithError", "<xml/>", dbSession);
       fail();
@@ -162,7 +162,7 @@ public class QProfileExportersTest {
   }
 
   @Test
-  public void fail_to_import_xml_on_unknown_importer() throws Exception {
+  public void fail_to_import_xml_on_unknown_importer() {
     try {
       exporters.importXml(QProfileTesting.newXooP1(), "Unknown", "<xml/>", dbSession);
       fail();
index d9e2c1af4d5f6135fd4ccfaeae5f255919973729..db41edd60b6d4c6c3df15b8b01952b700590e9f4 100644 (file)
@@ -64,7 +64,7 @@ public class QProfileFactoryMediumTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
index d978d3dbac316789a06735909bb578eb83d46976..b855fc9b878275621496a1e67ffd5458c5ceed11 100644 (file)
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class QProfileNameTest {
 
   @Test
-  public void equals_and_hashcode() throws Exception {
+  public void equals_and_hashcode() {
     QProfileName xooP1 = new QProfileName("xoo", "p1");
     assertThat(xooP1).isEqualTo(xooP1);
     assertThat(xooP1).isNotEqualTo(new QProfileName("xoo", "p2"));
@@ -40,7 +40,7 @@ public class QProfileNameTest {
   }
 
   @Test
-  public void to_string() throws Exception {
+  public void to_string() {
     assertThat(new QProfileName("xoo", "p1").toString()).isEqualTo("{lang=xoo, name=p1}");
   }
 }
index 161d2757defd1c7e1e04f02247467c09aa18af6b..2710183163e59e5e5f71a396d5d3b524aa2aed1d 100644 (file)
@@ -80,26 +80,26 @@ public class QProfileProjectOperationsMediumTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
   @Test
-  public void add_project() throws Exception {
+  public void add_project() {
     projectOperations.addProject(profile.getKey(), project.uuid(), authorizedProfileAdminUserSession);
 
     assertThat(factory.getByProjectAndLanguage(PROJECT_KEY, profile.getLanguage())).isNotNull();
   }
 
   @Test
-  public void add_project_with_only_project_admin_permission() throws Exception {
+  public void add_project_with_only_project_admin_permission() {
     projectOperations.addProject(profile.getKey(), project.uuid(), authorizedProjectAdminUserSession);
 
     assertThat(factory.getByProjectAndLanguage(PROJECT_KEY, profile.getLanguage())).isNotNull();
   }
 
   @Test
-  public void remove_project_from_project_id() throws Exception {
+  public void remove_project_from_project_id() {
     projectOperations.addProject(profile.getKey(), project.uuid(), authorizedProfileAdminUserSession);
     assertThat(factory.getByProjectAndLanguage(PROJECT_KEY, profile.getLanguage())).isNotNull();
 
@@ -108,7 +108,7 @@ public class QProfileProjectOperationsMediumTest {
   }
 
   @Test
-  public void remove_project_from_language() throws Exception {
+  public void remove_project_from_language() {
     projectOperations.addProject(profile.getKey(), project.uuid(), authorizedProfileAdminUserSession);
     assertThat(factory.getByProjectAndLanguage(PROJECT_KEY, profile.getLanguage())).isNotNull();
 
@@ -117,7 +117,7 @@ public class QProfileProjectOperationsMediumTest {
   }
 
   @Test
-  public void remove_all_projects() throws Exception {
+  public void remove_all_projects() {
     ComponentDto project1 = new ComponentDto()
       .setUuid("BCDE")
       .setKey("project1")
index dd5ae63ef58e80a56ad63ebb0cbf953dd11e7898..b3d89740951d96c322aac26f796e3bdd830d8cb7 100644 (file)
@@ -69,7 +69,7 @@ public class QProfileResetMediumTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
@@ -89,7 +89,7 @@ public class QProfileResetMediumTest {
   }
 
   @Test
-  public void reset_language_profile() throws Exception {
+  public void reset_language_profile() {
     RulesProfile defProfile = RulesProfile.create("Basic", ServerTester.Xoo.KEY);
     defProfile.activateRule(
       org.sonar.api.rules.Rule.create("xoo", "x1").setParams(newArrayList(new RuleParam().setKey("acceptWhitespace"))),
@@ -137,7 +137,7 @@ public class QProfileResetMediumTest {
   }
 
   @Test
-  public void reset_language_profile_param_when_rule_definition_has_changed() throws Exception {
+  public void reset_language_profile_param_when_rule_definition_has_changed() {
     RulesProfile defProfile = RulesProfile.create("Basic", ServerTester.Xoo.KEY);
     defProfile.activateRule(org.sonar.api.rules.Rule.create("xoo", "x1"), null);
 
index 034bb052ef97fe1a7975af796abf5823dbadd780..8ed0fea39b52c724ef48a62e2be885353e03f4e5 100644 (file)
@@ -93,12 +93,12 @@ public class QProfileServiceMediumTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
   @Test
-  public void create_profile() throws Exception {
+  public void create_profile() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN).setLogin("me");
 
     QualityProfileDto profile = service.create(QProfileName.createFor("xoo", "New Profile"), null).profile();
@@ -109,7 +109,7 @@ public class QProfileServiceMediumTest {
   }
 
   @Test
-  public void create_profile_with_xml() throws Exception {
+  public void create_profile_with_xml() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN).setLogin("me");
 
     db.ruleDao().insert(dbSession, RuleTesting.newDto(RuleKey.of("xoo", "R1")).setLanguage("xoo").setSeverity("MINOR"));
@@ -127,7 +127,7 @@ public class QProfileServiceMediumTest {
   }
 
   @Test
-  public void count_by_all_profiles() throws Exception {
+  public void count_by_all_profiles() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN).setLogin("me");
 
     service.activate(XOO_P1_KEY, new RuleActivation(RuleTesting.XOO_X1).setSeverity("BLOCKER"));
@@ -159,7 +159,7 @@ public class QProfileServiceMediumTest {
   }
 
   @Test
-  public void count_by_deprecated() throws Exception {
+  public void count_by_deprecated() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN).setLogin("me");
 
     // create deprecated rule
@@ -177,7 +177,7 @@ public class QProfileServiceMediumTest {
   }
 
   @Test
-  public void search_qprofile_activity() throws InterruptedException {
+  public void search_qprofile_activity() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN).setLogin("david");
 
     UserDto user = new UserDto().setLogin("david").setName("David").setEmail("dav@id.com").setCreatedAt(System.currentTimeMillis()).setUpdatedAt(System.currentTimeMillis());
@@ -210,7 +210,7 @@ public class QProfileServiceMediumTest {
   }
 
   @Test
-  public void search_qprofile_activity_without_severity() throws InterruptedException {
+  public void search_qprofile_activity_without_severity() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN).setLogin("me");
 
     RuleKey ruleKey = RuleKey.of("xoo", "deleted_rule");
@@ -229,7 +229,7 @@ public class QProfileServiceMediumTest {
   }
 
   @Test
-  public void search_qprofile_activity_with_user_not_found() throws InterruptedException {
+  public void search_qprofile_activity_with_user_not_found() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN).setLogin("david");
 
     // We need an actual rule in DB to test RuleName in Activity
@@ -252,7 +252,7 @@ public class QProfileServiceMediumTest {
   }
 
   @Test
-  public void search_qprofile_activity_with_rule_not_found() throws InterruptedException {
+  public void search_qprofile_activity_with_rule_not_found() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN).setLogin("me");
 
     RuleKey ruleKey = RuleKey.of("xoo", "deleted_rule");
@@ -273,7 +273,7 @@ public class QProfileServiceMediumTest {
   }
 
   @Test
-  public void search_activity_by_qprofile() throws InterruptedException {
+  public void search_activity_by_qprofile() {
 
     tester.get(ActivityService.class).save(
       ActiveRuleChange.createFor(ActiveRuleChange.Type.ACTIVATED, ActiveRuleKey.of(XOO_P1_KEY, RuleTesting.XOO_X1)).toActivity());
@@ -291,7 +291,7 @@ public class QProfileServiceMediumTest {
   }
 
   @Test
-  public void search_activity_by_qprofile_having_dashes_in_keys() throws InterruptedException {
+  public void search_activity_by_qprofile_having_dashes_in_keys() {
     tester.get(ActivityService.class).save(
       ActiveRuleChange.createFor(ActiveRuleChange.Type.ACTIVATED, ActiveRuleKey.of("java-default", RuleTesting.XOO_X1)).toActivity());
     tester.get(ActivityService.class).save(
@@ -308,7 +308,7 @@ public class QProfileServiceMediumTest {
   }
 
   @Test
-  public void set_default() throws Exception {
+  public void set_default() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN).setLogin("me");
 
     assertThat(service.getDefault("xoo")).isNull();
index 56397bbb30f30bb3e82b201cc0e3928da4de064e..4fb83dae022f4e0e2d356397185cba0664604ccc 100644 (file)
@@ -37,13 +37,13 @@ public class QProfileTest {
   }
 
   @Test
-  public void to_string() throws Exception {
+  public void to_string() {
     assertThat(new QProfile().setId(1).setName("Default").setLanguage("java").setParent("Parent").toString())
       .contains("[id=1,key=<null>,name=Default,language=java,parent=Parent,isDefault=false]");
   }
 
   @Test
-  public void is_inherited() throws Exception {
+  public void is_inherited() {
     assertThat(new QProfile().setId(1).setName("Default").setLanguage("java").setParent("Parent").isInherited()).isTrue();
     assertThat(new QProfile().setId(1).setName("Default").setLanguage("java").setParent(null).isInherited()).isFalse();
   }
index a313b0f104c082cf0fcd02fb6bb5dded8cd40a00..853e5240325b9ad8644053726843aafc1a5a33c3 100644 (file)
@@ -46,94 +46,94 @@ public class QProfilesTest {
   QProfiles qProfiles;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     qProfiles = new QProfiles(projectOperations, projectLookup, profileLookup);
   }
 
   @Test
-  public void search_profile_by_id() throws Exception {
+  public void search_profile_by_id() {
     qProfiles.profile(1);
     verify(profileLookup).profile(1);
   }
 
   @Test
-  public void search_profile_by_name_and_language() throws Exception {
+  public void search_profile_by_name_and_language() {
     qProfiles.profile("Default", "java");
     verify(profileLookup).profile("Default", "java");
   }
 
   @Test
-  public void search_profiles() throws Exception {
+  public void search_profiles() {
     qProfiles.allProfiles();
     verify(profileLookup).allProfiles();
   }
 
   @Test
-  public void search_profiles_by_language() throws Exception {
+  public void search_profiles_by_language() {
     qProfiles.profilesByLanguage("java");
     verify(profileLookup).profiles("java");
   }
 
   @Test
-  public void search_parent_profile() throws Exception {
+  public void search_parent_profile() {
     QProfile profile = new QProfile().setId(1).setParent("Parent").setLanguage("java");
     qProfiles.parent(profile);
     verify(profileLookup).parent(profile);
   }
 
   @Test
-  public void search_children() throws Exception {
+  public void search_children() {
     QProfile profile = new QProfile();
     qProfiles.children(profile);
     verify(profileLookup).children(profile);
   }
 
   @Test
-  public void search_ancestors() throws Exception {
+  public void search_ancestors() {
     QProfile profile = new QProfile();
     qProfiles.ancestors(profile);
     verify(profileLookup).ancestors(profile);
   }
 
   @Test
-  public void projects() throws Exception {
+  public void projects() {
     qProfiles.projects(1);
     verify(projectLookup).projects(1);
   }
 
   @Test
-  public void count_projects() throws Exception {
+  public void count_projects() {
     QProfile profile = new QProfile();
     qProfiles.countProjects(profile);
     verify(projectLookup).countProjects(profile);
   }
 
   @Test
-  public void get_profiles_from_project_and_language() throws Exception {
+  public void get_profiles_from_project_and_language() {
     qProfiles.findProfileByProjectAndLanguage(1, "java");
     verify(projectLookup).findProfileByProjectAndLanguage(1, "java");
   }
 
   @Test
-  public void add_project() throws Exception {
+  public void add_project() {
     qProfiles.addProject("sonar-way-java", "ABCD");
     verify(projectOperations).addProject(eq("sonar-way-java"), eq("ABCD"), any(UserSession.class));
   }
 
   @Test
-  public void remove_project_by_quality_profile_key() throws Exception {
+  public void remove_project_by_quality_profile_key() {
     qProfiles.removeProject("sonar-way-java", "ABCD");
     verify(projectOperations).removeProject(eq("sonar-way-java"), eq("ABCD"), any(UserSession.class));
   }
 
   @Test
-  public void remove_project_by_language() throws Exception {
+  public void remove_project_by_language() {
     qProfiles.removeProjectByLanguage("java", 10L);
     verify(projectOperations).removeProject(eq("java"), eq(10L), any(UserSession.class));
   }
 
   @Test
-  public void remove_all_projects() throws Exception {
+  public void remove_all_projects() {
     qProfiles.removeAllProjects("sonar-way-java");
     verify(projectOperations).removeAllProjects(eq("sonar-way-java"), any(UserSession.class));
   }
index 8009d36adb5b97b8c36a5a9580fcce7613a2e5f1..72f03220320892f221a58636dfeb7a1cd63f4ee0 100644 (file)
@@ -52,7 +52,7 @@ public class RegisterQualityProfilesMediumTest {
   DbSession dbSession;
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     if (dbSession != null) {
       dbSession.close();
     }
@@ -62,7 +62,7 @@ public class RegisterQualityProfilesMediumTest {
   }
 
   @Test
-  public void register_existing_profile_definitions() throws Exception {
+  public void register_existing_profile_definitions() {
     tester = new ServerTester().addXoo().addComponents(XooRulesDefinition.class, XooProfileDefinition.class);
     tester.start();
     dbSession = dbClient().openSession(false);
@@ -105,7 +105,7 @@ public class RegisterQualityProfilesMediumTest {
   }
 
   @Test
-  public void register_profile_definitions() throws Exception {
+  public void register_profile_definitions() {
     tester = new ServerTester().addXoo().addComponents(XooRulesDefinition.class, XooProfileDefinition.class);
     tester.start();
     dbSession = dbClient().openSession(false);
@@ -140,7 +140,7 @@ public class RegisterQualityProfilesMediumTest {
   }
 
   @Test
-  public void do_not_register_profile_if_missing_language() throws Exception {
+  public void do_not_register_profile_if_missing_language() {
     // xoo language is not installed
     tester = new ServerTester().addComponents(XooRulesDefinition.class, XooProfileDefinition.class);
     tester.start();
@@ -152,7 +152,7 @@ public class RegisterQualityProfilesMediumTest {
   }
 
   @Test
-  public void fail_if_two_definitions_are_marked_as_default_on_the_same_language() throws Exception {
+  public void fail_if_two_definitions_are_marked_as_default_on_the_same_language() {
     tester = new ServerTester().addXoo().addComponents(new SimpleProfileDefinition("one", true), new SimpleProfileDefinition("two", true));
 
     try {
@@ -163,7 +163,7 @@ public class RegisterQualityProfilesMediumTest {
   }
 
   @Test
-  public void mark_profile_as_default() throws Exception {
+  public void mark_profile_as_default() {
     tester = new ServerTester().addXoo().addComponents(new SimpleProfileDefinition("one", false), new SimpleProfileDefinition("two", true));
 
     tester.start();
@@ -171,7 +171,7 @@ public class RegisterQualityProfilesMediumTest {
   }
 
   @Test
-  public void use_sonar_way_as_default_profile_if_none_are_marked_as_default() throws Exception {
+  public void use_sonar_way_as_default_profile_if_none_are_marked_as_default() {
     tester = new ServerTester().addXoo().addComponents(new SimpleProfileDefinition("Sonar way", false), new SimpleProfileDefinition("Other way", false));
 
     tester.start();
@@ -179,7 +179,7 @@ public class RegisterQualityProfilesMediumTest {
   }
 
   @Test
-  public void do_not_reset_default_profile_if_still_valid() throws Exception {
+  public void do_not_reset_default_profile_if_still_valid() {
     tester = new ServerTester().addXoo().addComponents(new SimpleProfileDefinition("one", true), new SimpleProfileDefinition("two", false));
     tester.start();
 
@@ -200,7 +200,7 @@ public class RegisterQualityProfilesMediumTest {
    * Probably for db migration
    */
   @Test
-  public void clean_up_profiles_if_missing_loaded_template() throws Exception {
+  public void clean_up_profiles_if_missing_loaded_template() {
     tester = new ServerTester().addXoo().addComponents(XooRulesDefinition.class, XooProfileDefinition.class);
     tester.start();
 
index 927bcbedbf2e4b982d27722c40f6b5f4790a9f4b..b0c5ba6c34056a9618d0c51c9c07e6e9b13f082e 100644 (file)
@@ -111,12 +111,12 @@ public class RuleActivatorMediumTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
   @Test
-  public void activate() throws Exception {
+  public void activate() {
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setSeverity(Severity.BLOCKER);
     activation.setParameter("max", "7");
@@ -133,7 +133,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void activate_with_profile_dto() throws Exception {
+  public void activate_with_profile_dto() {
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setSeverity(Severity.BLOCKER);
     activation.setParameter("max", "7");
@@ -150,7 +150,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void activate_with_default_severity_and_parameter() throws Exception {
+  public void activate_with_default_severity_and_parameter() {
     activate(new RuleActivation(RuleTesting.XOO_X1), XOO_P1_KEY);
 
     assertThat(countActiveRules(XOO_P1_KEY)).isEqualTo(1);
@@ -162,7 +162,7 @@ public class RuleActivatorMediumTest {
    * SONAR-5841
    */
   @Test
-  public void activate_with_empty_parameter_having_no_default_value() throws Exception {
+  public void activate_with_empty_parameter_having_no_default_value() {
     activate(new RuleActivation(RuleTesting.XOO_X1)
       .setParameter("min", ""),
       XOO_P1_KEY);
@@ -177,7 +177,7 @@ public class RuleActivatorMediumTest {
    * SONAR-5841
    */
   @Test
-  public void activate_with_empty_parameters() throws Exception {
+  public void activate_with_empty_parameters() {
     activate(new RuleActivation(RuleTesting.XOO_X1)
       .setParameters(ImmutableMap.of("max", "", "min", "")),
       XOO_P1_KEY);
@@ -192,7 +192,7 @@ public class RuleActivatorMediumTest {
    * SONAR-5840
    */
   @Test
-  public void activate_rule_with_negative_integer_value_on_parameter_having_no_default_value() throws Exception {
+  public void activate_rule_with_negative_integer_value_on_parameter_having_no_default_value() {
     activate(new RuleActivation(RuleTesting.XOO_X1)
       .setParameter("min", "-10"),
       XOO_P1_KEY);
@@ -204,7 +204,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void activation_ignores_unsupported_parameters() throws Exception {
+  public void activation_ignores_unsupported_parameters() {
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setParameter("xxx", "yyy");
     activate(activation, XOO_P1_KEY);
@@ -214,7 +214,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void update_activation_severity_and_parameters() throws Exception {
+  public void update_activation_severity_and_parameters() {
     // initial activation
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setSeverity(Severity.BLOCKER);
@@ -233,7 +233,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void update_activation_with_parameter_without_default_value() throws Exception {
+  public void update_activation_with_parameter_without_default_value() {
     // initial activation -> param "max" has a default value
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setSeverity(Severity.BLOCKER);
@@ -253,7 +253,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void update_activation_but_new_parameter() throws Exception {
+  public void update_activation_but_new_parameter() {
     // initial activation
     ActiveRuleKey activeRuleKey = ActiveRuleKey.of(XOO_P1_KEY, RuleTesting.XOO_X1);
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
@@ -278,7 +278,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void ignore_activation_without_changes() throws Exception {
+  public void ignore_activation_without_changes() {
     // initial activation
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setSeverity(Severity.BLOCKER);
@@ -292,7 +292,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void do_not_change_severity_and_params_if_unset_and_already_activated() throws Exception {
+  public void do_not_change_severity_and_params_if_unset_and_already_activated() {
     // initial activation
     ActiveRuleKey activeRuleKey = ActiveRuleKey.of(XOO_P1_KEY, RuleTesting.XOO_X1);
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
@@ -309,7 +309,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void revert_activation_to_default_severity_and_parameters() throws Exception {
+  public void revert_activation_to_default_severity_and_parameters() {
     // initial activation
     ActiveRuleKey activeRuleKey = ActiveRuleKey.of(XOO_P1_KEY, RuleTesting.XOO_X1);
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
@@ -328,7 +328,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void ignore_parameters_when_activating_custom_rule() throws Exception {
+  public void ignore_parameters_when_activating_custom_rule() {
     // initial activation
     ActiveRuleKey activeRuleKey = ActiveRuleKey.of(XOO_P1_KEY, CUSTOM_RULE_KEY);
     RuleActivation activation = new RuleActivation(CUSTOM_RULE_KEY);
@@ -344,7 +344,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void fail_to_activate_if_template() throws Exception {
+  public void fail_to_activate_if_template() {
     RuleActivation activation = new RuleActivation(TEMPLATE_RULE_KEY);
 
     try {
@@ -357,7 +357,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void fail_to_activate_if_different_languages() throws Exception {
+  public void fail_to_activate_if_different_languages() {
     // profile and rule have different languages
     RuleActivation activation = new RuleActivation(RuleKey.of("squid", "j1"));
 
@@ -371,7 +371,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void fail_to_activate_if_unknown_rule() throws Exception {
+  public void fail_to_activate_if_unknown_rule() {
     // profile and rule have different languages
     RuleActivation activation = new RuleActivation(RuleKey.of("xoo", "x3"));
 
@@ -385,7 +385,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void fail_to_activate_if_rule_with_removed_status() throws Exception {
+  public void fail_to_activate_if_rule_with_removed_status() {
     RuleDto ruleDto = db.ruleDao().getByKey(dbSession, RuleTesting.XOO_X1);
     ruleDto.setStatus(RuleStatus.REMOVED);
     db.ruleDao().update(dbSession, ruleDto);
@@ -404,7 +404,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void fail_to_activate_if_manual_rule() throws Exception {
+  public void fail_to_activate_if_manual_rule() {
     RuleActivation activation = new RuleActivation(MANUAL_RULE_KEY);
 
     try {
@@ -417,7 +417,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void fail_to_activate_if_unknown_profile() throws Exception {
+  public void fail_to_activate_if_unknown_profile() {
     try {
       activate(new RuleActivation(RuleTesting.XOO_X1), "unknown");
       fail();
@@ -427,7 +427,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void fail_to_activate_if_invalid_parameter() throws Exception {
+  public void fail_to_activate_if_invalid_parameter() {
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setParameter("max", "foo");
 
@@ -442,7 +442,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void deactivate() throws Exception {
+  public void deactivate() {
     // activation
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activation.setSeverity(Severity.BLOCKER);
@@ -456,7 +456,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void ignore_deactivation_if_rule_not_activated() throws Exception {
+  public void ignore_deactivation_if_rule_not_activated() {
     // deactivation
     ActiveRuleKey key = ActiveRuleKey.of(XOO_P1_KEY, RuleTesting.XOO_X1);
     ruleActivator.deactivate(key);
@@ -465,7 +465,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void deactivation_fails_if_rule_not_found() throws Exception {
+  public void deactivation_fails_if_rule_not_found() {
     ActiveRuleKey key = ActiveRuleKey.of(XOO_P1_KEY, RuleKey.of("xoo", "x3"));
     try {
       ruleActivator.deactivate(key);
@@ -477,7 +477,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void deactivation_fails_if_profile_not_found() throws Exception {
+  public void deactivation_fails_if_profile_not_found() {
     ActiveRuleKey key = ActiveRuleKey.of("unknown", RuleTesting.XOO_X1);
     try {
       ruleActivator.deactivate(key);
@@ -488,7 +488,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void allow_to_deactivate_removed_rule() throws Exception {
+  public void allow_to_deactivate_removed_rule() {
     // activation
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1);
     activate(activation, XOO_P1_KEY);
@@ -508,7 +508,7 @@ public class RuleActivatorMediumTest {
 
   // INHERITANCE OF PROFILES
   @Test
-  public void activate_on_child_profile_but_not_on_parent() throws Exception {
+  public void activate_on_child_profile_but_not_on_parent() {
     createChildProfiles();
 
     // activate on child profile, but not on root
@@ -533,7 +533,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void propagate_activation_on_child_profiles() throws Exception {
+  public void propagate_activation_on_child_profiles() {
     createChildProfiles();
 
     // activate on root profile
@@ -549,7 +549,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void propagate_activation_update_on_child_profiles() throws Exception {
+  public void propagate_activation_update_on_child_profiles() {
     createChildProfiles();
 
     // activate on root profile
@@ -593,7 +593,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void do_not_propagate_activation_update_on_child_overrides() throws Exception {
+  public void do_not_propagate_activation_update_on_child_overrides() {
     createChildProfiles();
 
     // activate on root profile P1
@@ -633,7 +633,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void active_on_parent_a_rule_already_activated_on_child() throws Exception {
+  public void active_on_parent_a_rule_already_activated_on_child() {
     createChildProfiles();
 
     // activate on child profile
@@ -656,7 +656,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void do_not_override_on_child_if_same_values() throws Exception {
+  public void do_not_override_on_child_if_same_values() {
     createChildProfiles();
 
     // activate on root profile
@@ -677,7 +677,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void propagate_deactivation_on_child_profiles() throws Exception {
+  public void propagate_deactivation_on_child_profiles() {
     createChildProfiles();
 
     // activate on root profile
@@ -698,7 +698,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void propagate_deactivation_even_on_child_overrides() throws Exception {
+  public void propagate_deactivation_even_on_child_overrides() {
     createChildProfiles();
 
     // activate on root profile
@@ -728,7 +728,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void do_not_deactivate_inherited_or_overridden_rule() throws Exception {
+  public void do_not_deactivate_inherited_or_overridden_rule() {
     createChildProfiles();
 
     // activate on root profile
@@ -750,7 +750,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void reset_child_profile() throws Exception {
+  public void reset_child_profile() {
     createChildProfiles();
 
     // activate on root profile
@@ -780,7 +780,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void reset_is_not_propagated_to_child_overrides() throws Exception {
+  public void reset_is_not_propagated_to_child_overrides() {
     createChildProfiles();
 
     // activate on root profile
@@ -819,7 +819,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void ignore_reset_if_not_activated() throws Exception {
+  public void ignore_reset_if_not_activated() {
     createChildProfiles();
     RuleActivation activation = new RuleActivation(RuleTesting.XOO_X1).setReset(true);
     activate(activation, XOO_P1_KEY);
@@ -1008,7 +1008,7 @@ public class RuleActivatorMediumTest {
   }
 
   @Test
-  public void bulk_change_severity() throws Exception {
+  public void bulk_change_severity() {
     createChildProfiles();
 
     // activate two rules on root profile P1 (propagated to P2 and P3)
index c2093edc7f6491cd1af8dbdf161340281b8b7d7e..0d1b14751c55a69f5887edac172edc99aa4689f8 100644 (file)
@@ -41,7 +41,7 @@ public class ProfilesWsTest {
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     WebService.Controller controller = tester.controller("api/profiles");
     assertThat(controller).isNotNull();
     assertThat(controller.path()).isEqualTo("api/profiles");
@@ -50,7 +50,7 @@ public class ProfilesWsTest {
   }
 
   @Test
-  public void define_list_action() throws Exception {
+  public void define_list_action() {
     WebService.Controller controller = tester.controller("api/profiles");
 
     WebService.Action restoreProfiles = controller.action("list");
@@ -61,7 +61,7 @@ public class ProfilesWsTest {
   }
 
   @Test
-  public void define_index_action() throws Exception {
+  public void define_index_action() {
     WebService.Controller controller = tester.controller("api/profiles");
 
     WebService.Action restoreProfiles = controller.action("index");
@@ -72,7 +72,7 @@ public class ProfilesWsTest {
   }
 
   @Test
-  public void define_backup_action() throws Exception {
+  public void define_backup_action() {
     WebService.Controller controller = tester.controller("api/profiles");
 
     WebService.Action restoreProfiles = controller.action("backup");
@@ -82,7 +82,7 @@ public class ProfilesWsTest {
   }
 
   @Test
-  public void define_restore_action() throws Exception {
+  public void define_restore_action() {
     WebService.Controller controller = tester.controller("api/profiles");
 
     WebService.Action restoreProfiles = controller.action("restore");
@@ -92,7 +92,7 @@ public class ProfilesWsTest {
   }
 
   @Test
-  public void define_destroy_action() throws Exception {
+  public void define_destroy_action() {
     WebService.Controller controller = tester.controller("api/profiles");
 
     WebService.Action restoreProfiles = controller.action("destroy");
@@ -102,7 +102,7 @@ public class ProfilesWsTest {
   }
 
   @Test
-  public void define_set_as_default_action() throws Exception {
+  public void define_set_as_default_action() {
     WebService.Controller controller = tester.controller("api/profiles");
 
     WebService.Action restoreProfiles = controller.action("set_as_default");
index e3be04b57f32750dce86457e4262337fa8a2574a..b039d48813fbb05f370028a8088380acb179fb8a 100644 (file)
@@ -57,7 +57,7 @@ public class QProfileBackupActionTest {
   private WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     DbClient dbClient = new DbClient(db.database(), db.myBatis());
 
     tester = new WsTester(new QProfilesWs(
index 433a343967b044f880606cbf4ccfeaf7bb2bfbbb..7df4a80432442e59f1a90a53c053660805cb42c7 100644 (file)
@@ -56,7 +56,7 @@ public class QProfileChangeParentActionMediumTest {
   WsTester wsTester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     ws = tester.get(QProfilesWs.class);
index 232fe5f03528707ccba2b1aa5e9e702baa073e93..61b35da2389f014732d26bb2868f0cf3d428a275 100644 (file)
@@ -101,7 +101,7 @@ public class QProfileChangelogActionTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
index 19aeceeaf9d9a666000d739b21475ef6fa5f04e9..2dc5f9fe3b3d2507ff4138558c1311bc61df72d0 100644 (file)
@@ -61,7 +61,7 @@ public class QProfileCompareActionMediumTest {
   private DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     session = db.openSession(false);
index 0b2d31a3e5870aa74374c7e85798a95f87bdf2dd..47b508037681a62798ff7261afb3ef24dad2d1cf 100644 (file)
@@ -46,7 +46,7 @@ public class QProfileCopyActionTest {
   private QProfileCopier qProfileCopier;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester = new WsTester(new QProfilesWs(
       mock(RuleActivationActions.class),
       mock(BulkRuleActivationActions.class),
index b3258aec61da6951cd79e6714975692a51418e84..1c772b887e7591cf86aba41bc1cbb8f61b8a5ede 100644 (file)
@@ -64,7 +64,7 @@ public class QProfileCreateActionMediumTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
index 3d31e67aa3574d475c2f3ddd743fb8194ddb4cc2..17fc490bd18135cdffbac60261ce948c55dc6858 100644 (file)
@@ -65,7 +65,7 @@ public class QProfileDeleteActionTest {
   private DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     qualityProfileDao = new QualityProfileDao(dbTester.myBatis(), mock(System2.class));
     componentDao = new ComponentDao();
index 20b18432e739e77aa57e4a3ce2026be7b037e4db..974f4d8aa1851825fb6d205731adc9bf05027e11 100644 (file)
@@ -71,7 +71,7 @@ public class QProfileExportActionTest {
   QProfileExporters exporters;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     qualityProfileDao = new QualityProfileDao(db.myBatis(), mock(System2.class));
     dbClient = new DbClient(db.database(), db.myBatis(), qualityProfileDao);
     session = dbClient.openSession(false);
@@ -95,7 +95,7 @@ public class QProfileExportActionTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     session.close();
   }
 
index 9d3d15db5a5ff5b738cda968f211740c168e94ba..44fbc09dd1df16763451a34cca3bef88197a6dfd 100644 (file)
@@ -51,7 +51,7 @@ public class QProfileInheritanceActionMediumTest {
   private DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     session = db.openSession(false);
index 73ede38f285f3a2acd7617b485e7e388aaa4ae41..06e5285064ab8e551c1a8757b7f255bb57f2eac6 100644 (file)
@@ -66,7 +66,7 @@ public class QProfileProjectsActionTest {
   private RoleDao roleDao;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     dbClient = new DbClient(dbTester.database(), dbTester.myBatis(),
       new QualityProfileDao(dbTester.myBatis(), mock(System2.class)),
index ba784e090e5dfd3f95cbaabad3657b0011c2b381..c5c7a994b61501fa05a052f0d9316fb11e42fc62 100644 (file)
@@ -56,7 +56,7 @@ public class QProfileRenameActionTest {
 
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     qualityProfileDao = new QualityProfileDao(dbTester.myBatis(), mock(System2.class));
     dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), qualityProfileDao);
index d5de479749d4cbe935ba2147ec4aef2b14d94313..cbf140bffa7ab7ec578ca90d19d16dede3f13c10 100644 (file)
@@ -52,7 +52,7 @@ public class QProfileRestoreActionTest {
   private WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester = new WsTester(new QProfilesWs(
       mock(RuleActivationActions.class),
       mock(BulkRuleActivationActions.class),
index 48f3433ad2941b3f004253b616078eb3e968251a..043a8b372c1ac0aa415cb3700b60f4a973a2527b 100644 (file)
@@ -43,7 +43,7 @@ public class QProfileRestoreBuiltInActionTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester = new WsTester(new QProfilesWs(
       mock(RuleActivationActions.class),
       mock(BulkRuleActivationActions.class),
index 6b93a45b05a58e1c103cea3d8c21541d1c75445f..c19b24104815155a9a2f9cacde41ef4970455b88 100644 (file)
@@ -60,7 +60,7 @@ public class QProfileSearchActionTest {
   private QProfileLoader profileLoader;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     qualityProfileDao = new QualityProfileDao(dbTester.myBatis(), mock(System2.class));
     dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), qualityProfileDao);
index fbb13d55de19a880e49ead90fcc6acb744d127a8..136e83fc0bb84374ebdd2f9a7816a8c61960192e 100644 (file)
@@ -59,7 +59,7 @@ public class QProfileSetDefaultActionTest {
 
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     qualityProfileDao = new QualityProfileDao(dbTester.myBatis(), mock(System2.class));
     dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), qualityProfileDao);
@@ -161,7 +161,7 @@ public class QProfileSetDefaultActionTest {
     session.commit();
   }
 
-  private void checkDefaultProfile(String language, String key) throws Exception {
+  private void checkDefaultProfile(String language, String key) {
     assertThat(dbClient.qualityProfileDao().getDefaultProfile(language).getKey()).isEqualTo(key);
   }
 }
index 2e53f605067a9d34290cbccb2729f0ec4c595da3..b2de87d9bdaae15c32f11e682d4bb8bb65e9ea90 100644 (file)
@@ -64,7 +64,7 @@ public class QProfilesWsMediumTest {
   WsTester wsTester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     ws = tester.get(QProfilesWs.class);
index 653bf5359362b924565da0023d46e35a10f35741..130b3caab9ad2eaa079d36fd88f4624c8116f729 100644 (file)
@@ -98,7 +98,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     assertThat(controller).isNotNull();
     assertThat(controller.path()).isEqualTo(QProfilesWs.API_ENDPOINT);
     assertThat(controller.description()).isNotEmpty();
@@ -106,7 +106,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_restore_built_action() throws Exception {
+  public void define_restore_built_action() {
     WebService.Action restoreProfiles = controller.action("restore_built_in");
     assertThat(restoreProfiles).isNotNull();
     assertThat(restoreProfiles.isPost()).isTrue();
@@ -114,7 +114,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_search() throws Exception {
+  public void define_search() {
     WebService.Action search = controller.action("search");
     assertThat(search).isNotNull();
     assertThat(search.isPost()).isFalse();
@@ -125,7 +125,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_activate_rule_action() throws Exception {
+  public void define_activate_rule_action() {
     WebService.Action restoreProfiles = controller.action(RuleActivationActions.ACTIVATE_ACTION);
     assertThat(restoreProfiles).isNotNull();
     assertThat(restoreProfiles.isPost()).isTrue();
@@ -133,7 +133,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_deactivate_rule_action() throws Exception {
+  public void define_deactivate_rule_action() {
     WebService.Action restoreProfiles = controller.action(RuleActivationActions.DEACTIVATE_ACTION);
     assertThat(restoreProfiles).isNotNull();
     assertThat(restoreProfiles.isPost()).isTrue();
@@ -141,7 +141,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_add_project_action() throws Exception {
+  public void define_add_project_action() {
     WebService.Action addProject = controller.action("add_project");
     assertThat(addProject).isNotNull();
     assertThat(addProject.isPost()).isTrue();
@@ -149,7 +149,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_remove_project_action() throws Exception {
+  public void define_remove_project_action() {
     WebService.Action removeProject = controller.action("remove_project");
     assertThat(removeProject).isNotNull();
     assertThat(removeProject.isPost()).isTrue();
@@ -157,7 +157,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_set_default_action() throws Exception {
+  public void define_set_default_action() {
     WebService.Action setDefault = controller.action("set_default");
     assertThat(setDefault).isNotNull();
     assertThat(setDefault.isPost()).isTrue();
@@ -165,7 +165,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_projects_action() throws Exception {
+  public void define_projects_action() {
     WebService.Action projects = controller.action("projects");
     assertThat(projects).isNotNull();
     assertThat(projects.isPost()).isFalse();
@@ -174,7 +174,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_backup_action() throws Exception {
+  public void define_backup_action() {
     WebService.Action backup = controller.action("backup");
     assertThat(backup).isNotNull();
     assertThat(backup.isPost()).isFalse();
@@ -182,14 +182,14 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_restore_action() throws Exception {
+  public void define_restore_action() {
     WebService.Action restore = controller.action("restore");
     assertThat(restore).isNotNull();
     assertThat(restore.isPost()).isTrue();
     assertThat(restore.params()).hasSize(1);
   }
 
-  public void define_bulk_activate_rule_action() throws Exception {
+  public void define_bulk_activate_rule_action() {
     WebService.Action restoreProfiles = controller.action(BulkRuleActivationActions.BULK_ACTIVATE_ACTION);
     assertThat(restoreProfiles).isNotNull();
     assertThat(restoreProfiles.isPost()).isTrue();
@@ -197,7 +197,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_bulk_deactivate_rule_action() throws Exception {
+  public void define_bulk_deactivate_rule_action() {
     WebService.Action restoreProfiles = controller.action(BulkRuleActivationActions.BULK_DEACTIVATE_ACTION);
     assertThat(restoreProfiles).isNotNull();
     assertThat(restoreProfiles.isPost()).isTrue();
@@ -205,7 +205,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_create_action() throws Exception {
+  public void define_create_action() {
     WebService.Action create = controller.action("create");
     assertThat(create).isNotNull();
     assertThat(create.isPost()).isTrue();
@@ -221,7 +221,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_importers_action() throws Exception {
+  public void define_importers_action() {
     WebService.Action importers = controller.action("importers");
     assertThat(importers).isNotNull();
     assertThat(importers.isPost()).isFalse();
@@ -230,7 +230,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_changelog_action() throws Exception {
+  public void define_changelog_action() {
     WebService.Action changelog = controller.action("changelog");
     assertThat(changelog).isNotNull();
     assertThat(changelog.isPost()).isFalse();
@@ -241,7 +241,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_change_parent_action() throws Exception {
+  public void define_change_parent_action() {
     WebService.Action changeParent = controller.action("change_parent");
     assertThat(changeParent).isNotNull();
     assertThat(changeParent.isPost()).isTrue();
@@ -251,7 +251,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_compare_action() throws Exception {
+  public void define_compare_action() {
     WebService.Action compare = controller.action("compare");
     assertThat(compare).isNotNull();
     assertThat(compare.isPost()).isFalse();
@@ -263,7 +263,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_copy_action() throws Exception {
+  public void define_copy_action() {
     WebService.Action copy = controller.action("copy");
     assertThat(copy).isNotNull();
     assertThat(copy.isPost()).isTrue();
@@ -273,7 +273,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_delete_action() throws Exception {
+  public void define_delete_action() {
     WebService.Action delete = controller.action("delete");
     assertThat(delete).isNotNull();
     assertThat(delete.isPost()).isTrue();
@@ -283,7 +283,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_export_action() throws Exception {
+  public void define_export_action() {
     WebService.Action export = controller.action("export");
     assertThat(export).isNotNull();
     assertThat(export.isPost()).isFalse();
@@ -293,7 +293,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_exporters_action() throws Exception {
+  public void define_exporters_action() {
     WebService.Action exporters = controller.action("exporters");
     assertThat(exporters).isNotNull();
     assertThat(exporters.isPost()).isFalse();
@@ -302,7 +302,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_inheritance_action() throws Exception {
+  public void define_inheritance_action() {
     WebService.Action inheritance = controller.action("inheritance");
     assertThat(inheritance).isNotNull();
     assertThat(inheritance.isPost()).isFalse();
@@ -313,7 +313,7 @@ public class QProfilesWsTest {
   }
 
   @Test
-  public void define_rename_action() throws Exception {
+  public void define_rename_action() {
     WebService.Action rename = controller.action("rename");
     assertThat(rename).isNotNull();
     assertThat(rename.isPost()).isTrue();
index 242f32c67f83e798bc0fe4629a8d10cdb889de30..894e18375a9fa03403e8ea0d99f517710f93398b 100644 (file)
@@ -45,17 +45,17 @@ public class PlatformRackBridgeTest {
   PlatformRackBridge underTest;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     MockitoAnnotations.initMocks(this);
   }
 
   @Test(expected = RuntimeException.class)
-  public void getRubyRuntime_throws_RE_when_RackApplicationFactory_is_not_in_ServletContext() throws Exception {
+  public void getRubyRuntime_throws_RE_when_RackApplicationFactory_is_not_in_ServletContext() {
     underTest.getRubyRuntime();
   }
 
   @Test
-  public void getRubyRuntime_returns_Ruby_instance_from_rack_application() throws Exception {
+  public void getRubyRuntime_returns_Ruby_instance_from_rack_application() {
     when(servletContext.getAttribute("rack.factory")).thenReturn(rackApplicationFactory);
     when(rackApplicationFactory.getApplication()).thenReturn(rackApplication);
 
index 56729daec6f5b0dfd33d78035442d65d0b88824b..38bca7ca8469861ba7fb469061835ad5f397810b 100644 (file)
@@ -39,7 +39,7 @@ public class PlatformRubyBridgeTest {
   private PlatformRubyBridge underTest;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(rackBridge.getRubyRuntime()).thenReturn(container.getProvider().getRuntime());
     underTest = new PlatformRubyBridge(rackBridge);
   }
index 04bf1ddf430d962b7f9eb22963190a47b9c6256b..cf2e19f64f01c5c61c9e659e19bc429209d9e3e7 100644 (file)
@@ -46,7 +46,7 @@ public class DefaultRuleFinderMediumTest {
   private DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     finder = tester.get(DefaultRuleFinder.class);
     dbClient = tester.get(DbClient.class);
     session = dbClient.openSession(false);
index 2acfab4484d9c7f4f4dbd974b192b1e5c6ab44ef..15938092f9049dbe6c0b316c0f5b150218f019c1 100644 (file)
@@ -95,7 +95,7 @@ public class DeprecatedRulesDefinitionLoaderTest {
   }
 
   @Test
-  public void wrap_deprecated_rule_repositories() throws Exception {
+  public void wrap_deprecated_rule_repositories() {
     RulesDefinition.Context context = new RulesDefinition.Context();
     new DeprecatedRulesDefinitionLoader(i18n, debtModelRepository, importer, new RuleRepository[] {new CheckstyleRules()}).complete(context);
 
@@ -125,7 +125,7 @@ public class DeprecatedRulesDefinitionLoaderTest {
   }
 
   @Test
-  public void emulate_the_day_deprecated_api_can_be_dropped() throws Exception {
+  public void emulate_the_day_deprecated_api_can_be_dropped() {
     RulesDefinition.Context context = new RulesDefinition.Context();
 
     // no more RuleRepository !
@@ -135,7 +135,7 @@ public class DeprecatedRulesDefinitionLoaderTest {
   }
 
   @Test
-  public void use_l10n_bundles() throws Exception {
+  public void use_l10n_bundles() {
     RulesDefinition.Context context = new RulesDefinition.Context();
     when(i18n.getName("checkstyle", "ConstantName")).thenReturn("Constant Name");
     when(i18n.getDescription("checkstyle", "ConstantName")).thenReturn("Checks that constant names conform to the specified format");
@@ -155,7 +155,7 @@ public class DeprecatedRulesDefinitionLoaderTest {
   }
 
   @Test
-  public void define_rule_debt() throws Exception {
+  public void define_rule_debt() {
     RulesDefinition.Context context = new RulesDefinition.Context();
 
     List<DebtModelXMLExporter.RuleDebt> ruleDebts = newArrayList(
@@ -188,7 +188,7 @@ public class DeprecatedRulesDefinitionLoaderTest {
   }
 
   @Test
-  public void fail_on_invalid_rule_debt() throws Exception {
+  public void fail_on_invalid_rule_debt() {
     RulesDefinition.Context context = new RulesDefinition.Context();
 
     List<DebtModelXMLExporter.RuleDebt> ruleDebts = newArrayList(
index 2bc554247f7ef43a952a5358e1f05a2d7b07e8e4..778bb4bb11694bbbe49114a9654257a8a1807f0b 100644 (file)
@@ -105,7 +105,7 @@ public class RegisterRulesMediumTest {
   }
 
   @Test
-  public void register_rules_at_startup() throws Exception {
+  public void register_rules_at_startup() {
     register(new Rules() {
       @Override
       public void init(RulesDefinition.NewRepository repository) {
@@ -166,7 +166,7 @@ public class RegisterRulesMediumTest {
    * 4. start server -> db is up-to-date (no changes) but rules must be re-indexed
    */
   @Test
-  public void index_rules_even_if_no_changes() throws Exception {
+  public void index_rules_even_if_no_changes() {
     Rules rules = new Rules() {
       @Override
       public void init(RulesDefinition.NewRepository repository) {
@@ -303,7 +303,7 @@ public class RegisterRulesMediumTest {
   }
 
   @Test
-  public void do_not_update_rules_if_no_changes() throws Exception {
+  public void do_not_update_rules_if_no_changes() {
     Rules rules = new Rules() {
       @Override
       public void init(RulesDefinition.NewRepository repository) {
@@ -349,7 +349,7 @@ public class RegisterRulesMediumTest {
   }
 
   @Test
-  public void deactivate_removed_rules_only_if_repository_still_exists() throws Exception {
+  public void deactivate_removed_rules_only_if_repository_still_exists() {
     register(new Rules() {
       @Override
       public void init(RulesDefinition.NewRepository repository) {
@@ -378,7 +378,7 @@ public class RegisterRulesMediumTest {
   }
 
   @Test
-  public void do_not_deactivate_removed_rules_if_repository_accidentally_uninstalled() throws Exception {
+  public void do_not_deactivate_removed_rules_if_repository_accidentally_uninstalled() {
     Rules rules = new Rules() {
       @Override
       public void init(RulesDefinition.NewRepository repository) {
@@ -407,7 +407,7 @@ public class RegisterRulesMediumTest {
   }
 
   @Test
-  public void update_active_rules_on_param_changes() throws Exception {
+  public void update_active_rules_on_param_changes() {
     register(new Rules() {
       @Override
       public void init(RulesDefinition.NewRepository repository) {
@@ -482,7 +482,7 @@ public class RegisterRulesMediumTest {
   }
 
   @Test
-  public void fail_if_debt_characteristic_is_root() throws Exception {
+  public void fail_if_debt_characteristic_is_root() {
     try {
       register(new Rules() {
         @Override
@@ -500,7 +500,7 @@ public class RegisterRulesMediumTest {
   }
 
   @Test
-  public void update_custom_rule_on_template_change() throws Exception {
+  public void update_custom_rule_on_template_change() {
     register(new Rules() {
       @Override
       public void init(RulesDefinition.NewRepository repository) {
@@ -555,7 +555,7 @@ public class RegisterRulesMediumTest {
   }
 
   @Test
-  public void do_not_update_custom_rule_if_no_template_change() throws Exception {
+  public void do_not_update_custom_rule_if_no_template_change() {
     Rules rules = new Rules() {
       @Override
       public void init(RulesDefinition.NewRepository repository) {
@@ -591,7 +591,7 @@ public class RegisterRulesMediumTest {
   }
 
   @Test
-  public void do_not_update_custom_rule_params_from_template() throws Exception {
+  public void do_not_update_custom_rule_params_from_template() {
     register(new Rules() {
       @Override
       public void init(RulesDefinition.NewRepository repository) {
index 7c1abbfedc77bf02def3643aa839549662ed562f..522175215d86444e3b1c2a245c481f48c86aafaa 100644 (file)
@@ -72,7 +72,7 @@ public class RegisterRulesTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     dbSession.close();
   }
 
index 777f540f15d3168c0ad5dff7048333a0870f7c9b..12b126735bfc4d44956cca9d6450b94b9f0b307a 100644 (file)
@@ -63,18 +63,18 @@ public class RubyRuleServiceTest {
   RubyRuleService service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     service = new RubyRuleService(ruleService, updater);
   }
 
   @Test
-  public void find_by_key() throws Exception {
+  public void find_by_key() {
     service.findByKey("squid:S001");
     verify(ruleService).getByKey(RuleKey.of("squid", "S001"));
   }
 
   @Test
-  public void search_rules() throws Exception {
+  public void search_rules() {
     when(ruleService.search(any(RuleQuery.class), any(QueryContext.class))).thenReturn(mock(Result.class));
 
     HashMap<String, Object> params = newHashMap();
@@ -111,7 +111,7 @@ public class RubyRuleServiceTest {
   }
 
   @Test
-  public void search_rules_activated_on_a_profile() throws Exception {
+  public void search_rules_activated_on_a_profile() {
     when(ruleService.search(any(RuleQuery.class), any(QueryContext.class))).thenReturn(mock(Result.class));
 
     HashMap<String, Object> params = newHashMap();
@@ -125,7 +125,7 @@ public class RubyRuleServiceTest {
   }
 
   @Test
-  public void search_rules_without_page_size_param() throws Exception {
+  public void search_rules_without_page_size_param() {
     when(ruleService.search(any(RuleQuery.class), any(QueryContext.class))).thenReturn(mock(Result.class));
 
     HashMap<String, Object> params = newHashMap();
@@ -139,7 +139,7 @@ public class RubyRuleServiceTest {
   }
 
   @Test
-  public void search_all_rules() throws Exception {
+  public void search_all_rules() {
     List<Rule> rules = newArrayList(mock(Rule.class));
     Result serviceResult = mock(Result.class);
     when(serviceResult.scroll()).thenReturn(rules.iterator());
@@ -157,7 +157,7 @@ public class RubyRuleServiceTest {
   }
 
   @Test
-  public void update_rule() throws Exception {
+  public void update_rule() {
     when(ruleService.search(any(RuleQuery.class), any(QueryContext.class))).thenReturn(mock(Result.class));
 
     service.updateRule(ImmutableMap.<String, Object>of("ruleKey", "squid:S001"));
@@ -166,7 +166,7 @@ public class RubyRuleServiceTest {
   }
 
   @Test
-  public void search_manual_rules() throws Exception {
+  public void search_manual_rules() {
     when(ruleService.search(any(RuleQuery.class), any(QueryContext.class))).thenReturn(mock(Result.class));
 
     service.searchManualRules();
@@ -175,21 +175,21 @@ public class RubyRuleServiceTest {
   }
 
   @Test
-  public void create_manual_rules() throws Exception {
+  public void create_manual_rules() {
     service.createManualRule(ImmutableMap.<String, Object>of("manualKey", "MY_MANUAL"));
 
     verify(ruleService).create(any(NewRule.class));
   }
 
   @Test
-  public void update_manual_rules() throws Exception {
+  public void update_manual_rules() {
     service.updateManualRule(ImmutableMap.<String, Object>of("ruleKey", "manual:MY_MANUAL"));
 
     verify(ruleService).update(any(RuleUpdate.class));
   }
 
   @Test
-  public void delete_manual_rules() throws Exception {
+  public void delete_manual_rules() {
     service.deleteManualRule("manual:MY_MANUAL");
 
     verify(ruleService).delete(RuleKey.of("manual", "MY_MANUAL"));
index 6ee776eddd050708cc64b91e23e96d846283c17c..f24f72374020d7bdbe85bc5ac134e94eebbbba97 100644 (file)
@@ -72,7 +72,7 @@ public class RuleBackendMediumTest {
   }
 
   @Test
-  public void insert_in_db_and_multiget_in_es() throws InterruptedException {
+  public void insert_in_db_and_multiget_in_es() {
     // insert db
     RuleDto ruleDto = RuleTesting.newXooX1();
     RuleDto ruleDto2 = RuleTesting.newXooX2();
@@ -85,7 +85,7 @@ public class RuleBackendMediumTest {
   }
 
   @Test
-  public void insert_in_db_and_index_in_es() throws InterruptedException {
+  public void insert_in_db_and_index_in_es() {
     // insert db
     RuleDto ruleDto = RuleTesting.newXooX1();
     dao.insert(dbSession, ruleDto);
@@ -128,7 +128,7 @@ public class RuleBackendMediumTest {
   }
 
   @Test
-  public void insert_rule_tags_in_db_and_index_in_es() throws InterruptedException {
+  public void insert_rule_tags_in_db_and_index_in_es() {
     // insert db
     RuleDto ruleDto = RuleTesting.newXooX1();
     dao.insert(dbSession, ruleDto);
@@ -250,7 +250,7 @@ public class RuleBackendMediumTest {
   }
 
   @Test
-  public void insert_and_update_rule_param() throws InterruptedException {
+  public void insert_and_update_rule_param() {
 
     // insert db
     RuleDto ruleDto = RuleTesting.newXooX1();
@@ -309,7 +309,7 @@ public class RuleBackendMediumTest {
 
   @Test
   @Deprecated
-  public void has_id() throws Exception {
+  public void has_id() {
 
     RuleDto ruleDto = RuleTesting.newXooX1();
     dao.insert(dbSession, ruleDto);
@@ -320,7 +320,7 @@ public class RuleBackendMediumTest {
 
 
   @Test
-  public void insert_update_characteristics() throws Exception {
+  public void insert_update_characteristics() {
 
     CharacteristicDto char1 = DebtTesting.newCharacteristicDto("c1");
     db.debtCharacteristicDao().insert(char1, dbSession);
@@ -382,7 +382,7 @@ public class RuleBackendMediumTest {
   }
 
   @Test
-  public void insert_update_debt_overload() throws Exception {
+  public void insert_update_debt_overload() {
 
     RuleDto ruleDto = RuleTesting.newXooX1()
       .setRemediationFunction(null)
index 2a9d7a18aa655c187780a1b6182588a115b0a63e..2a9900c0854ce603dac6fca585e79ae7328d158a 100644 (file)
@@ -70,7 +70,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void create_custom_rule() throws Exception {
+  public void create_custom_rule() {
     // insert template rule
     RuleDto templateRule = createTemplateRule();
 
@@ -116,7 +116,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void create_custom_rule_with_empty_parameter_value() throws Exception {
+  public void create_custom_rule_with_empty_parameter_value() {
     // insert template rule
     RuleDto templateRule = createTemplateRule();
 
@@ -141,7 +141,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void create_custom_rule_with_no_parameter_value() throws Exception {
+  public void create_custom_rule_with_no_parameter_value() {
     // insert template rule
     RuleDto templateRule = createTemplateRuleWithIntArrayParam();
 
@@ -165,7 +165,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void create_custom_rule_with_multiple_parameter_values() throws Exception {
+  public void create_custom_rule_with_multiple_parameter_values() {
     // insert template rule
     RuleDto templateRule = createTemplateRuleWithIntArrayParam();
 
@@ -190,7 +190,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void create_custom_rule_with_invalid_parameter() throws Exception {
+  public void create_custom_rule_with_invalid_parameter() {
     // insert template rule
     RuleDto templateRule = createTemplateRuleWithIntArrayParam();
 
@@ -212,7 +212,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void create_custom_rule_with_invalid_parameters() throws Exception {
+  public void create_custom_rule_with_invalid_parameters() {
     // insert template rule
     RuleDto templateRule = createTemplateRuleWithTwoIntParams();
 
@@ -235,7 +235,7 @@ public class RuleCreatorMediumTest {
 
 
   @Test
-  public void reactivate_custom_rule_if_already_exists_in_removed_status() throws Exception {
+  public void reactivate_custom_rule_if_already_exists_in_removed_status() {
     String key = "CUSTOM_RULE";
 
     // insert template rule
@@ -279,7 +279,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void generate_reactivation_exception_when_rule_exists_in_removed_status_and_prevent_reactivation_parameter_is_true() throws Exception {
+  public void generate_reactivation_exception_when_rule_exists_in_removed_status_and_prevent_reactivation_parameter_is_true() {
     String key = "CUSTOM_RULE";
 
     // insert template rule
@@ -316,7 +316,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_custom_rule_when_invalid_key() throws Exception {
+  public void fail_to_create_custom_rule_when_invalid_key() {
     // insert template rule
     RuleDto templateRule = createTemplateRule();
 
@@ -336,7 +336,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_custom_rule_when_rule_key_already_exists() throws Exception {
+  public void fail_to_create_custom_rule_when_rule_key_already_exists() {
     // insert template rule
     RuleDto templateRule = createTemplateRule();
 
@@ -365,7 +365,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_custom_rule_when_missing_name() throws Exception {
+  public void fail_to_create_custom_rule_when_missing_name() {
     // insert template rule
     RuleDto templateRule = createTemplateRule();
 
@@ -384,7 +384,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_custom_rule_when_missing_description() throws Exception {
+  public void fail_to_create_custom_rule_when_missing_description() {
     // insert template rule
     RuleDto templateRule = createTemplateRule();
 
@@ -403,7 +403,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_custom_rule_when_missing_severity() throws Exception {
+  public void fail_to_create_custom_rule_when_missing_severity() {
     // insert template rule
     RuleDto templateRule = createTemplateRule();
 
@@ -422,7 +422,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_custom_rule_when_invalid_severity() throws Exception {
+  public void fail_to_create_custom_rule_when_invalid_severity() {
     // insert template rule
     RuleDto templateRule = createTemplateRule();
 
@@ -442,7 +442,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_custom_rule_when_missing_status() throws Exception {
+  public void fail_to_create_custom_rule_when_missing_status() {
     // insert template rule
     RuleDto templateRule = createTemplateRule();
 
@@ -461,7 +461,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_custom_rule_when_wrong_rule_template() throws Exception {
+  public void fail_to_create_custom_rule_when_wrong_rule_template() {
     // insert rule
     RuleDto rule = dao.insert(dbSession,
       RuleTesting.newDto(RuleKey.of("java", "S001")).setIsTemplate(false));
@@ -484,7 +484,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void create_manual_rule() throws Exception {
+  public void create_manual_rule() {
     NewRule newRule = NewRule.createForManualRule("MANUAL_RULE")
       .setName("My manual")
       .setMarkdownDescription("Some description");
@@ -509,7 +509,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void create_manual_rule_with_severity() throws Exception {
+  public void create_manual_rule_with_severity() {
     NewRule newRule = NewRule.createForManualRule("MANUAL_RULE")
       .setName("My manual")
       .setMarkdownDescription("Some description")
@@ -535,7 +535,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void reactivate_manual_rule_if_already_exists_in_removed_status() throws Exception {
+  public void reactivate_manual_rule_if_already_exists_in_removed_status() {
     String key = "MANUAL_RULE";
 
     // insert a removed rule
@@ -569,7 +569,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_manual_rule_when_missing_key() throws Exception {
+  public void fail_to_create_manual_rule_when_missing_key() {
     try {
       NewRule.createForManualRule("")
         .setName("My manual")
@@ -581,7 +581,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_manual_rule_when_invalid_key() throws Exception {
+  public void fail_to_create_manual_rule_when_invalid_key() {
     NewRule newRule = NewRule.createForManualRule("*INVALID*")
       .setName("My custom")
       .setHtmlDescription("Some description");
@@ -595,7 +595,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_manual_rule_when_rule_key_already_exists() throws Exception {
+  public void fail_to_create_manual_rule_when_rule_key_already_exists() {
     NewRule newRule = NewRule.createForManualRule("MANUAL_RULE")
       .setName("My manual")
       .setHtmlDescription("Some description");
@@ -614,7 +614,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_manual_rule_when_missing_name() throws Exception {
+  public void fail_to_create_manual_rule_when_missing_name() {
     NewRule newRule = NewRule.createForManualRule("MANUAL_RULE")
       .setHtmlDescription("Some description");
 
@@ -627,7 +627,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_manual_rule_when_missing_description() throws Exception {
+  public void fail_to_create_manual_rule_when_missing_description() {
     NewRule newRule = NewRule.createForManualRule("MANUAL_RULE")
       .setName("My manual");
 
@@ -640,7 +640,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_manual_rule_with_status() throws Exception {
+  public void fail_to_create_manual_rule_with_status() {
     try {
       NewRule.createForManualRule("MANUAL_RULE")
         .setName("My manual")
@@ -653,7 +653,7 @@ public class RuleCreatorMediumTest {
   }
 
   @Test
-  public void fail_to_create_manual_rule_with_parameters() throws Exception {
+  public void fail_to_create_manual_rule_with_parameters() {
     try {
       NewRule.createForManualRule("MANUAL_RULE")
         .setName("My manual")
index 76510d1872a1829146808337bba91459454a6ee9..9ff5e40059af315f2ca7a690ed9356ac82f5a6e7 100644 (file)
@@ -69,7 +69,7 @@ public class RuleDeleterMediumTest {
   }
 
   @Test
-  public void delete_custom_rule() throws Exception {
+  public void delete_custom_rule() {
     // Create template rule
     RuleDto templateRule = RuleTesting.newTemplateRule(RuleKey.of("xoo", "T1")).setLanguage("xoo");
     dao.insert(dbSession, templateRule);
@@ -101,7 +101,7 @@ public class RuleDeleterMediumTest {
   }
 
   @Test
-  public void delete_manual_rule() throws Exception {
+  public void delete_manual_rule() {
     // Create manual rule
     RuleDto manualRule = RuleTesting.newManualRule("Manual_Rule");
     dao.insert(dbSession, manualRule);
@@ -118,7 +118,7 @@ public class RuleDeleterMediumTest {
   }
 
   @Test
-  public void fail_to_delete_if_not_custom_or_not_manual() throws Exception {
+  public void fail_to_delete_if_not_custom_or_not_manual() {
     // Create rule
     RuleKey ruleKey = RuleKey.of("java", "S001");
     dao.insert(dbSession, RuleTesting.newDto(ruleKey));
index 8f10df6d4da46a962301e02654143e41fb06d9cc..1f3a48d2b811d59c0171154ef4c415adbaf8b10e 100644 (file)
@@ -69,7 +69,7 @@ public class RuleOperationsTest {
   RuleOperations operations;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(dbClient.openSession(false)).thenReturn(session);
     when(dbClient.ruleDao()).thenReturn(ruleDao);
     when(dbClient.debtCharacteristicDao()).thenReturn(characteristicDao);
@@ -77,7 +77,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void update_rule() throws Exception {
+  public void update_rule() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck")
       .setSubCharacteristicId(6).setRemediationFunction("CONSTANT_ISSUE").setRemediationOffset("10min");
     RuleKey ruleKey = RuleKey.of("squid", "UselessImportCheck");
@@ -111,7 +111,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void update_rule_set_overridden_values_to_null_when_new_values_are_equals_to_default_values() throws Exception {
+  public void update_rule_set_overridden_values_to_null_when_new_values_are_equals_to_default_values() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck")
       .setSubCharacteristicId(6).setRemediationFunction("CONSTANT_ISSUE").setRemediationOffset("10min")
       .setDefaultSubCharacteristicId(2).setDefaultRemediationFunction("CONSTANT_ISSUE").setDefaultRemediationOffset("10min");
@@ -145,7 +145,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void not_update_rule_if_same_sub_characteristic_and_function() throws Exception {
+  public void not_update_rule_if_same_sub_characteristic_and_function() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck")
       .setSubCharacteristicId(2).setRemediationFunction("CONSTANT_ISSUE").setRemediationOffset("10min");
     RuleKey ruleKey = RuleKey.of("squid", "UselessImportCheck");
@@ -166,7 +166,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void update_rule_set_characteristic_if_different_from_default_one() throws Exception {
+  public void update_rule_set_characteristic_if_different_from_default_one() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck")
       .setDefaultSubCharacteristicId(2).setDefaultRemediationFunction("CONSTANT_ISSUE").setDefaultRemediationOffset("10min");
     RuleKey ruleKey = RuleKey.of("squid", "UselessImportCheck");
@@ -199,7 +199,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void update_rule_set_remediation_function_if_different_from_default_one() throws Exception {
+  public void update_rule_set_remediation_function_if_different_from_default_one() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck")
       .setDefaultSubCharacteristicId(6).setDefaultRemediationFunction("CONSTANT_ISSUE").setDefaultRemediationOffset("10min");
     RuleKey ruleKey = RuleKey.of("squid", "UselessImportCheck");
@@ -232,7 +232,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void disable_rule_debt_when_update_rule_with_no_sub_characteristic() throws Exception {
+  public void disable_rule_debt_when_update_rule_with_no_sub_characteristic() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck")
       .setDefaultSubCharacteristicId(6).setDefaultRemediationFunction("LINEAR").setDefaultRemediationCoefficient("10min")
       .setSubCharacteristicId(6)
@@ -257,7 +257,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void disable_rule_debt_when_update_rule_with_no_function() throws Exception {
+  public void disable_rule_debt_when_update_rule_with_no_function() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck")
       .setDefaultSubCharacteristicId(6).setDefaultRemediationFunction("CONSTANT_ISSUE").setDefaultRemediationOffset("10min");
     RuleKey ruleKey = RuleKey.of("squid", "UselessImportCheck");
@@ -285,7 +285,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void disable_characteristic_on_rule_having_no_debt_info() throws Exception {
+  public void disable_characteristic_on_rule_having_no_debt_info() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck");
     RuleKey ruleKey = RuleKey.of("squid", "UselessImportCheck");
 
@@ -306,7 +306,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void not_disable_characteristic_when_update_rule_if_already_disabled() throws Exception {
+  public void not_disable_characteristic_when_update_rule_if_already_disabled() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck").setSubCharacteristicId(-1);
     RuleKey ruleKey = RuleKey.of("squid", "UselessImportCheck");
 
@@ -322,7 +322,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void fail_to_update_rule_on_unknown_rule() throws Exception {
+  public void fail_to_update_rule_on_unknown_rule() {
     RuleKey ruleKey = RuleKey.of("squid", "UselessImportCheck");
 
     when(ruleDao.getNullableByKey(session, ruleKey)).thenReturn(null);
@@ -342,7 +342,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void fail_to_update_rule_on_unknown_sub_characteristic() throws Exception {
+  public void fail_to_update_rule_on_unknown_sub_characteristic() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck")
       .setSubCharacteristicId(2).setRemediationFunction("CONSTANT_ISSUE").setRemediationOffset("10min");
     RuleKey ruleKey = RuleKey.of("squid", "UselessImportCheck");
@@ -366,7 +366,7 @@ public class RuleOperationsTest {
   }
 
   @Test
-  public void fail_to_update_rule_on_invalid_coefficient() throws Exception {
+  public void fail_to_update_rule_on_invalid_coefficient() {
     RuleDto dto = new RuleDto().setId(1).setRepositoryKey("squid").setRuleKey("UselessImportCheck")
       .setSubCharacteristicId(2).setRemediationFunction("LINEAR").setRemediationCoefficient("1h");
     RuleKey ruleKey = RuleKey.of("squid", "UselessImportCheck");
index d203f55c21e8b7af54783479d77a8b0f95c981c8..d9a9268f8db6c2bc895a62ee84950022da8bb063 100644 (file)
@@ -69,7 +69,7 @@ public class RuleServiceMediumTest {
   }
 
   @Test
-  public void get_rule_by_key() throws Exception {
+  public void get_rule_by_key() {
     MockUserSession.set()
       .setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN)
       .setLogin("me");
@@ -87,7 +87,7 @@ public class RuleServiceMediumTest {
   }
 
   @Test
-  public void get_non_null_rule_by_key() throws Exception {
+  public void get_non_null_rule_by_key() {
     MockUserSession.set()
       .setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN)
       .setLogin("me");
@@ -108,7 +108,7 @@ public class RuleServiceMediumTest {
   }
 
   @Test
-  public void get_rule_by_key_escape_description_on_manual_rule() throws Exception {
+  public void get_rule_by_key_escape_description_on_manual_rule() {
     MockUserSession.set()
       .setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN)
       .setLogin("me");
@@ -125,7 +125,7 @@ public class RuleServiceMediumTest {
   }
 
   @Test
-  public void get_rule_by_keys() throws Exception {
+  public void get_rule_by_keys() {
     MockUserSession.set()
       .setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN)
       .setLogin("me");
@@ -140,7 +140,7 @@ public class RuleServiceMediumTest {
   }
 
   @Test
-  public void list_tags() throws InterruptedException {
+  public void list_tags() {
     // insert db
     RuleKey key1 = RuleKey.of("javascript", "S001");
     RuleKey key2 = RuleKey.of("java", "S001");
@@ -163,7 +163,7 @@ public class RuleServiceMediumTest {
   }
 
   @Test
-  public void update_rule() throws Exception {
+  public void update_rule() {
     MockUserSession.set()
       .setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN)
       .setLogin("me");
@@ -185,7 +185,7 @@ public class RuleServiceMediumTest {
   }
 
   @Test(expected = UnauthorizedException.class)
-  public void do_not_update_if_not_granted() throws Exception {
+  public void do_not_update_if_not_granted() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
 
     RuleKey key = RuleKey.of("java", "S001");
@@ -200,7 +200,7 @@ public class RuleServiceMediumTest {
   }
 
   @Test
-  public void create_rule() throws Exception {
+  public void create_rule() {
     MockUserSession.set()
       .setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN)
       .setLogin("me");
@@ -226,14 +226,14 @@ public class RuleServiceMediumTest {
   }
 
   @Test(expected = UnauthorizedException.class)
-  public void do_not_create_if_not_granted() throws Exception {
+  public void do_not_create_if_not_granted() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
 
     service.create(NewRule.createForCustomRule("MY_CUSTOM", RuleKey.of("java", "S001")));
   }
 
   @Test
-  public void delete_rule() throws Exception {
+  public void delete_rule() {
     MockUserSession.set()
       .setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN)
       .setLogin("me");
@@ -257,7 +257,7 @@ public class RuleServiceMediumTest {
   }
 
   @Test(expected = UnauthorizedException.class)
-  public void do_not_delete_if_not_granted() throws Exception {
+  public void do_not_delete_if_not_granted() {
     MockUserSession.set().setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
 
     service.delete(RuleKey.of("java", "S001"));
index 5d61ed462eab242228619f344b19b8f2eb43ff9a..2a9b004f2067d4dcda904b1d0530227211b223d6 100644 (file)
@@ -31,7 +31,7 @@ import static org.junit.Assert.fail;
 public class RuleTagHelperTest {
 
   @Test
-  public void applyTags() throws Exception {
+  public void applyTags() {
     RuleDto rule = new RuleDto().setTags(Sets.newHashSet("performance"));
     boolean changed = RuleTagHelper.applyTags(rule, Sets.newHashSet("java8", "security"));
     assertThat(rule.getTags()).containsOnly("java8", "security");
@@ -39,7 +39,7 @@ public class RuleTagHelperTest {
   }
 
   @Test
-  public void applyTags_remove_all_existing_tags() throws Exception {
+  public void applyTags_remove_all_existing_tags() {
     RuleDto rule = new RuleDto().setTags(Sets.newHashSet("performance"));
     boolean changed = RuleTagHelper.applyTags(rule, Collections.<String>emptySet());
     assertThat(rule.getTags()).isEmpty();
@@ -47,7 +47,7 @@ public class RuleTagHelperTest {
   }
 
   @Test
-  public void applyTags_no_changes() throws Exception {
+  public void applyTags_no_changes() {
     RuleDto rule = new RuleDto().setTags(Sets.newHashSet("performance"));
     boolean changed = RuleTagHelper.applyTags(rule, Sets.newHashSet("performance"));
     assertThat(rule.getTags()).containsOnly("performance");
@@ -55,7 +55,7 @@ public class RuleTagHelperTest {
   }
 
   @Test
-  public void applyTags_validate_format() throws Exception {
+  public void applyTags_validate_format() {
     RuleDto rule = new RuleDto();
     boolean changed = RuleTagHelper.applyTags(rule, Sets.newHashSet("java8", "security"));
     assertThat(rule.getTags()).containsOnly("java8", "security");
@@ -70,7 +70,7 @@ public class RuleTagHelperTest {
   }
 
   @Test
-  public void applyTags_do_not_duplicate_system_tags() throws Exception {
+  public void applyTags_do_not_duplicate_system_tags() {
     RuleDto rule = new RuleDto()
       .setTags(Sets.newHashSet("performance"))
       .setSystemTags(Sets.newHashSet("security"));
index 21c7c613fdad8d9bbf938284ef4fe5e1dae9b7ee..7b01cfe2510e3ff6f00441b6420a0d1270f5d774 100644 (file)
@@ -83,7 +83,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void do_not_update_rule_with_removed_status() throws Exception {
+  public void do_not_update_rule_with_removed_status() {
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY).setStatus(RuleStatus.REMOVED));
     dbSession.commit();
 
@@ -97,7 +97,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void no_changes() throws Exception {
+  public void no_changes() {
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY)
       // the following fields are not supposed to be updated
       .setNoteData("my *note*")
@@ -125,7 +125,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void set_markdown_note() throws Exception {
+  public void set_markdown_note() {
     MockUserSession.set().setLogin("me");
 
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY)
@@ -159,7 +159,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void remove_markdown_note() throws Exception {
+  public void remove_markdown_note() {
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY)
       .setNoteData("my *note*")
       .setNoteUserLogin("me"));
@@ -177,7 +177,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void set_tags() throws Exception {
+  public void set_tags() {
     // insert db
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY)
       .setTags(Sets.newHashSet("security"))
@@ -199,7 +199,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void remove_tags() throws Exception {
+  public void remove_tags() {
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY)
       .setTags(Sets.newHashSet("security"))
       .setSystemTags(Sets.newHashSet("java8", "javadoc")));
@@ -219,7 +219,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void override_debt() throws Exception {
+  public void override_debt() {
     insertDebtCharacteristics(dbSession);
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY)
       .setDefaultSubCharacteristicId(hardReliabilityId)
@@ -256,7 +256,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void override_debt_only_offset() throws Exception {
+  public void override_debt_only_offset() {
     insertDebtCharacteristics(dbSession);
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY)
       .setDefaultSubCharacteristicId(hardReliabilityId)
@@ -290,7 +290,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void override_debt_from_linear_with_offset_to_constant() throws Exception {
+  public void override_debt_from_linear_with_offset_to_constant() {
     insertDebtCharacteristics(dbSession);
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY)
       .setDefaultSubCharacteristicId(hardReliabilityId)
@@ -324,7 +324,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void reset_debt() throws Exception {
+  public void reset_debt() {
     insertDebtCharacteristics(dbSession);
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY)
       .setDefaultSubCharacteristicId(hardReliabilityId)
@@ -359,7 +359,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void unset_debt() throws Exception {
+  public void unset_debt() {
     insertDebtCharacteristics(dbSession);
     ruleDao.insert(dbSession, RuleTesting.newDto(RULE_KEY)
       .setDefaultSubCharacteristicId(hardReliabilityId)
@@ -398,7 +398,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void update_custom_rule() throws Exception {
+  public void update_custom_rule() {
     // Create template rule
     RuleDto templateRule = RuleTesting.newTemplateRule(RuleKey.of("java", "S001"));
     ruleDao.insert(dbSession, templateRule);
@@ -444,7 +444,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void update_custom_rule_with_empty_parameter() throws Exception {
+  public void update_custom_rule_with_empty_parameter() {
     // Create template rule
     RuleDto templateRule = RuleTesting.newTemplateRule(RuleKey.of("java", "S001"));
     ruleDao.insert(dbSession, templateRule);
@@ -479,7 +479,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void update_active_rule_parameters_when_updating_custom_rule() throws Exception {
+  public void update_active_rule_parameters_when_updating_custom_rule() {
     // Create template rule with 3 parameters
     RuleDto templateRule = RuleTesting.newTemplateRule(RuleKey.of("java", "S001")).setLanguage("xoo");
     ruleDao.insert(dbSession, templateRule);
@@ -540,7 +540,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void fail_to_update_custom_rule_when_empty_name() throws Exception {
+  public void fail_to_update_custom_rule_when_empty_name() {
     // Create template rule
     RuleDto templateRule = RuleTesting.newTemplateRule(RuleKey.of("java", "S001"));
     ruleDao.insert(dbSession, templateRule);
@@ -564,7 +564,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void fail_to_update_custom_rule_when_empty_description() throws Exception {
+  public void fail_to_update_custom_rule_when_empty_description() {
     // Create template rule
     RuleDto templateRule = RuleTesting.newTemplateRule(RuleKey.of("java", "S001"));
     ruleDao.insert(dbSession, templateRule);
@@ -588,7 +588,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void update_manual_rule() throws Exception {
+  public void update_manual_rule() {
     // Create manual rule
     RuleDto manualRule = RuleTesting.newManualRule("My manual")
       .setName("Old name")
@@ -616,7 +616,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void fail_to_update_manual_rule_if_status_is_set() throws Exception {
+  public void fail_to_update_manual_rule_if_status_is_set() {
     // Create manual rule
     RuleDto manualRule = RuleTesting.newManualRule("My manual");
     ruleDao.insert(dbSession, manualRule);
@@ -634,7 +634,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void fail_to_update_manual_rule_if_parameters_are_set() throws Exception {
+  public void fail_to_update_manual_rule_if_parameters_are_set() {
     // Create manual rule
     RuleDto manualRule = RuleTesting.newManualRule("My manual");
     ruleDao.insert(dbSession, manualRule);
@@ -653,7 +653,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void fail_to_update_plugin_rule_if_name_is_set() throws Exception {
+  public void fail_to_update_plugin_rule_if_name_is_set() {
     // Create rule rule
     RuleDto ruleDto = RuleTesting.newDto(RuleKey.of("squid", "S01"));
     ruleDao.insert(dbSession, ruleDto);
@@ -671,7 +671,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void fail_to_update_plugin_rule_if_description_is_set() throws Exception {
+  public void fail_to_update_plugin_rule_if_description_is_set() {
     // Create rule rule
     RuleDto ruleDto = RuleTesting.newDto(RuleKey.of("squid", "S01"));
     ruleDao.insert(dbSession, ruleDto);
@@ -689,7 +689,7 @@ public class RuleUpdaterMediumTest {
   }
 
   @Test
-  public void fail_to_update_plugin_rule_if_severity_is_set() throws Exception {
+  public void fail_to_update_plugin_rule_if_severity_is_set() {
     // Create rule rule
     RuleDto ruleDto = RuleTesting.newDto(RuleKey.of("squid", "S01"));
     ruleDao.insert(dbSession, ruleDto);
index 2b82eb2aaa98e3efa662018129fd5ef82a3adfa0..efddaf517a954662dee94e72d49f8884610e245f 100644 (file)
@@ -48,7 +48,7 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   private System2 system2;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     this.session = getMyBatis().openSession(false);
     this.system2 = mock(System2.class);
     this.dao = new RuleDao(system2);
@@ -60,7 +60,7 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_all() throws Exception {
+  public void select_all() {
     setupData("selectAll");
     List<RuleDto> ruleDtos = dao.findAll(session);
 
@@ -86,7 +86,7 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_enables_and_non_manual() throws Exception {
+  public void select_enables_and_non_manual() {
     setupData("select_enables_and_non_manual");
     List<RuleDto> ruleDtos = dao.findByEnabledAndNotManual(session);
 
@@ -111,7 +111,7 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_by_id() throws Exception {
+  public void select_by_id() {
     setupData("selectById");
     RuleDto ruleDto = dao.getById(session, 2);
 
@@ -124,7 +124,7 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_by_rule_key() throws Exception {
+  public void select_by_rule_key() {
     setupData("select_by_rule_key");
     assertThat(dao.getNullableByKey(session, RuleKey.of("checkstyle", "AvoidComparison"))).isNotNull();
     assertThat(dao.getNullableByKey(session, RuleKey.of("checkstyle", "Unknown"))).isNull();
@@ -132,7 +132,7 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_by_name() throws Exception {
+  public void select_by_name() {
     setupData("select_by_name");
     RuleDto ruleDto = dao.getByName("Avoid Null", session);
 
@@ -146,7 +146,7 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_non_manual() throws Exception {
+  public void select_non_manual() {
     setupData("selectNonManual");
     List<RuleDto> ruleDtos = dao.findByNonManual(session);
     session.commit();
@@ -297,7 +297,7 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_parameters() throws Exception {
+  public void select_parameters() {
     setupData("selectParameters");
     List<RuleParamDto> ruleDtos = dao.findAllRuleParams(session);
 
@@ -311,7 +311,7 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_parameters_by_rule_id() throws Exception {
+  public void select_parameters_by_rule_id() {
     setupData("select_parameters_by_rule_id");
     RuleDto rule = dao.getById(session, 1);
     List<RuleParamDto> ruleDtos = dao.findRuleParamsByRuleKey(session, rule.getKey());
index 75d3fed430fd29b56bc62a00576dcc7f8ee81bd8..9e27542bbb7b01072b29868912b5d6bbdb1501ce 100644 (file)
@@ -97,7 +97,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void getByKey() throws InterruptedException {
+  public void getByKey() {
     RuleDto ruleDto = RuleTesting.newDto(RuleKey.of("javascript", "S001"));
     dao.insert(dbSession, ruleDto);
     dbSession.commit();
@@ -115,7 +115,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void getByKey_null_if_not_found() throws InterruptedException {
+  public void getByKey_null_if_not_found() {
     Rule rule = index.getNullableByKey(RuleKey.of("javascript", "unknown"));
 
     assertThat(rule).isNull();
@@ -269,7 +269,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_all_rules() throws InterruptedException {
+  public void search_all_rules() {
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("javascript", "S001")));
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S002")));
     dbSession.commit();
@@ -281,7 +281,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void scroll_all_rules() throws InterruptedException {
+  public void scroll_all_rules() {
     int max = 100;
     for (int i = 0; i < max; i++) {
       dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "scroll_" + i)));
@@ -304,7 +304,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_has_debt_characteristic() throws InterruptedException {
+  public void search_by_has_debt_characteristic() {
     CharacteristicDto char1 = DebtTesting.newCharacteristicDto("c1")
       .setEnabled(true)
       .setName("char1");
@@ -349,7 +349,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void facet_on_debt_characteristic() throws InterruptedException {
+  public void facet_on_debt_characteristic() {
     CharacteristicDto char1 = DebtTesting.newCharacteristicDto("c1")
       .setEnabled(true)
       .setName("char1");
@@ -460,7 +460,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_any_of_languages() throws InterruptedException {
+  public void search_by_any_of_languages() {
     dao.insert(dbSession,
       RuleTesting.newDto(RuleKey.of("java", "S001")).setLanguage("java"),
       RuleTesting.newDto(RuleKey.of("javascript", "S002")).setLanguage("js"));
@@ -486,7 +486,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_characteristics() throws InterruptedException {
+  public void search_by_characteristics() {
     CharacteristicDto char1 = DebtTesting.newCharacteristicDto("RELIABILITY");
     db.debtCharacteristicDao().insert(char1, dbSession);
 
@@ -540,7 +540,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_characteristics_with_default_and_overridden_char() throws InterruptedException {
+  public void search_by_characteristics_with_default_and_overridden_char() {
     CharacteristicDto char1 = DebtTesting.newCharacteristicDto("RELIABILITY");
     db.debtCharacteristicDao().insert(char1, dbSession);
 
@@ -608,7 +608,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_any_of_severities() throws InterruptedException {
+  public void search_by_any_of_severities() {
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S001")).setSeverity(Severity.BLOCKER));
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S002")).setSeverity(Severity.INFO));
     dbSession.commit();
@@ -632,7 +632,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_any_of_statuses() throws InterruptedException {
+  public void search_by_any_of_statuses() {
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S001")).setStatus(RuleStatus.BETA));
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S002")).setStatus(RuleStatus.READY));
     dbSession.commit();
@@ -678,7 +678,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void fail_sort_by_language() throws InterruptedException {
+  public void fail_sort_by_language() {
     try {
       // Sorting on a field not tagged as sortable
       new RuleQuery().setSortField(RuleNormalizer.RuleField.LANGUAGE);
@@ -689,7 +689,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_profile() throws InterruptedException {
+  public void search_by_profile() {
     QualityProfileDto qualityProfileDto1 = QProfileTesting.newXooP1();
     QualityProfileDto qualityProfileDto2 = QProfileTesting.newXooP2();
     db.qualityProfileDao().insert(dbSession, qualityProfileDto1, qualityProfileDto2);
@@ -734,7 +734,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_profile_and_inheritance() throws InterruptedException {
+  public void search_by_profile_and_inheritance() {
     QualityProfileDto qualityProfileDto1 = QProfileTesting.newXooP1();
     QualityProfileDto qualityProfileDto2 = QProfileTesting.newXooP2().setParentKee(QProfileTesting.XOO_P1_KEY);
     db.qualityProfileDao().insert(dbSession, qualityProfileDto1, qualityProfileDto2);
@@ -835,7 +835,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_profile_and_active_severity() throws InterruptedException {
+  public void search_by_profile_and_active_severity() {
     QualityProfileDto qualityProfileDto1 = QProfileTesting.newXooP1();
     QualityProfileDto qualityProfileDto2 = QProfileTesting.newXooP2();
     db.qualityProfileDao().insert(dbSession, qualityProfileDto1, qualityProfileDto2);
@@ -874,7 +874,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void complex_param_value() throws InterruptedException {
+  public void complex_param_value() {
     String value = "//expression[primary/qualifiedIdentifier[count(IDENTIFIER) = 2]/IDENTIFIER[2]/@tokenValue = 'firstOf' and primary/identifierSuffix/arguments/expression[not(primary) or primary[not(qualifiedIdentifier) or identifierSuffix]]]";
 
     QualityProfileDto profile = QProfileTesting.newXooP1();
@@ -896,7 +896,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_tag() throws InterruptedException {
+  public void search_by_tag() {
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S001")).setTags(ImmutableSet.of("tag1")));
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S002")).setTags(ImmutableSet.of("tag2")));
     dbSession.commit();
@@ -938,7 +938,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_is_template() throws InterruptedException {
+  public void search_by_is_template() {
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S001")).setIsTemplate(false));
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S002")).setIsTemplate(true));
     dbSession.commit();
@@ -968,7 +968,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_template_key() throws InterruptedException {
+  public void search_by_template_key() {
     RuleDto templateRule = RuleTesting.newDto(RuleKey.of("java", "S001")).setIsTemplate(true);
     dao.insert(dbSession, templateRule);
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S001_MY_CUSTOM")).setTemplateId(templateRule.getId()));
@@ -992,7 +992,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_by_template_key_with_params() throws InterruptedException {
+  public void search_by_template_key_with_params() {
     RuleDto templateRule = RuleTesting.newDto(RuleKey.of("java", "S001")).setIsTemplate(true);
     RuleParamDto ruleParamDto = RuleParamDto.createFor(templateRule).setName("regex").setType("STRING").setDescription("Reg ex").setDefaultValue(".*");
     dao.insert(dbSession, templateRule);
@@ -1015,7 +1015,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void show_custom_rule() throws InterruptedException {
+  public void show_custom_rule() {
     RuleDto templateRule = RuleTesting.newDto(RuleKey.of("java", "S001")).setIsTemplate(true);
     dao.insert(dbSession, templateRule);
     dao.insert(dbSession, RuleTesting.newDto(RuleKey.of("java", "S001_MY_CUSTOM")).setTemplateId(templateRule.getId()));
@@ -1089,7 +1089,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void scroll_byIds() throws Exception {
+  public void scroll_byIds() {
     Set<Integer> ids = new HashSet<Integer>();
     for (int i = 0; i < 150; i++) {
       RuleDto rule = RuleTesting.newDto(RuleKey.of("scroll", "r_" + i));
@@ -1102,7 +1102,7 @@ public class RuleIndexMediumTest {
   }
 
   @Test
-  public void search_protected_chars() throws InterruptedException {
+  public void search_protected_chars() {
     String nameWithProtectedChars = "ja#va&sc\"r:ipt";
 
     RuleDto ruleDto = RuleTesting.newXooX1().setName(nameWithProtectedChars);
index 3e432a78d2f4b2c7747073510877bdc1a94e0783..0bb5e5e4b129d65648d9c7640046e065621ae062 100644 (file)
@@ -55,7 +55,7 @@ public class CreateActionMediumTest {
   DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     wsTester = tester.get(WsTester.class);
     ruleDao = tester.get(RuleDao.class);
@@ -118,7 +118,7 @@ public class CreateActionMediumTest {
   }
 
   @Test
-  public void fail_if_custom_key_and_manual_key_parameters_are_not_set() throws Exception {
+  public void fail_if_custom_key_and_manual_key_parameters_are_not_set() {
     MockUserSession.set()
       .setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN)
       .setLogin("me");
index 002da0ff0ca97632bf72597e0581868f43255b63..b5d99e70294e76f019e4fbf247e6b7d09e58118a 100644 (file)
@@ -40,7 +40,7 @@ public class DeleteActionTest {
   RuleService ruleService;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester = new WsTester(new RulesWebService(new DeleteAction(ruleService)));
   }
 
index a67998be0a4ce179fc5d1110f7a5d9cf170c7870..9bc23ade21a118b07b8b4de6629a23c5123bfe06 100644 (file)
@@ -38,7 +38,7 @@ public class RuleMappingTest {
   DebtModel debtModel = mock(DebtModel.class);
 
   @Test
-  public void toQueryOptions_load_all_fields() throws Exception {
+  public void toQueryOptions_load_all_fields() {
     RuleMapping mapping = new RuleMapping(languages, macroInterpreter, debtModel);
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "1");
@@ -49,7 +49,7 @@ public class RuleMappingTest {
   }
 
   @Test
-  public void toQueryOptions_load_only_few_simple_fields() throws Exception {
+  public void toQueryOptions_load_only_few_simple_fields() {
     RuleMapping mapping = new RuleMapping(languages, macroInterpreter, debtModel);
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "1");
@@ -64,7 +64,7 @@ public class RuleMappingTest {
   }
 
   @Test
-  public void toQueryOptions_langName_requires_lang() throws Exception {
+  public void toQueryOptions_langName_requires_lang() {
     RuleMapping mapping = new RuleMapping(languages, macroInterpreter, debtModel);
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "1");
@@ -76,7 +76,7 @@ public class RuleMappingTest {
   }
 
   @Test
-  public void toQueryOptions_debt_requires_group_of_fields() throws Exception {
+  public void toQueryOptions_debt_requires_group_of_fields() {
     RuleMapping mapping = new RuleMapping(languages, macroInterpreter, debtModel);
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "1");
@@ -91,7 +91,7 @@ public class RuleMappingTest {
   }
 
   @Test
-  public void toQueryOptions_html_note_requires_markdown_note() throws Exception {
+  public void toQueryOptions_html_note_requires_markdown_note() {
     RuleMapping mapping = new RuleMapping(languages, macroInterpreter, debtModel);
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "1");
@@ -103,7 +103,7 @@ public class RuleMappingTest {
   }
 
   @Test
-  public void toQueryOptions_debt_characteristics() throws Exception {
+  public void toQueryOptions_debt_characteristics() {
     RuleMapping mapping = new RuleMapping(languages, macroInterpreter, debtModel);
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "1");
@@ -116,7 +116,7 @@ public class RuleMappingTest {
   }
 
   @Test
-  public void toQueryOptions_debt_overloaded() throws Exception {
+  public void toQueryOptions_debt_overloaded() {
     RuleMapping mapping = new RuleMapping(languages, macroInterpreter, debtModel);
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "1");
index 9a45b332a79b2cb127e2d82481b0009d2928ddd1..f0775422e0577cbe552a239eeaa7d613b766aa17 100644 (file)
@@ -74,7 +74,7 @@ public class RulesWebServiceMediumTest {
   int softReliabilityId, hardReliabilityId;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     db = tester.get(DbClient.class);
     ruleDao = tester.get(RuleDao.class);
@@ -88,7 +88,7 @@ public class RulesWebServiceMediumTest {
   }
 
   @Test
-  public void define() throws Exception {
+  public void define() {
     WebService.Context context = new WebService.Context();
     ws.define(context);
 
index 779487d4e4b7cd02f7298baf6de8b811f17be49d..0eb34a9428c386e965e6f25163de251ac70b668b 100644 (file)
@@ -57,7 +57,7 @@ public class ShowActionMediumTest {
   DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     wsTester = tester.get(WsTester.class);
     ruleService = tester.get(RuleService.class);
index 7ce82055083e5bd1bd82779e6d8e72807ae4a739..2db2133379a3cb3836971f558f58a48fa9483684 100644 (file)
@@ -56,7 +56,7 @@ public class UpdateActionMediumTest {
   DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     wsTester = tester.get(WsTester.class);
     ruleService = tester.get(RuleService.class);
@@ -102,7 +102,7 @@ public class UpdateActionMediumTest {
   }
 
   @Test
-  public void fail_to_update_custom_when_description_is_empty() throws Exception {
+  public void fail_to_update_custom_when_description_is_empty() {
     MockUserSession.set()
       .setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN)
       .setLogin("me");
index 82b6a5e3e74b9a089a197165a6d03726d7ee9ada..0a81ff6425b56f6e58c49a2f65e73d26442086a1 100644 (file)
@@ -32,7 +32,7 @@ import static org.junit.Assert.fail;
 public class BaseDocTest {
 
   @Test
-  public void getField() throws Exception {
+  public void getField() {
     Map<String, Object> fields = Maps.newHashMap();
     fields.put("a_string", "foo");
     fields.put("a_int", 42);
@@ -46,7 +46,7 @@ public class BaseDocTest {
   }
 
   @Test
-  public void getField_fails_if_missing_field() throws Exception {
+  public void getField_fails_if_missing_field() {
     Map<String, Object> fields = Collections.emptyMap();
     BaseDoc doc = new BaseDoc(fields) {
     };
@@ -60,7 +60,7 @@ public class BaseDocTest {
   }
 
   @Test
-  public void getFieldAsDate() throws Exception {
+  public void getFieldAsDate() {
     BaseDoc doc = new BaseDoc(Maps.<String,Object>newHashMap()) {
     };
     long now = System.currentTimeMillis();
@@ -72,7 +72,7 @@ public class BaseDocTest {
   }
 
   @Test
-  public void getNullableFieldAsDate() throws Exception {
+  public void getNullableFieldAsDate() {
     BaseDoc doc = new BaseDoc(Maps.<String,Object>newHashMap()) {
     };
     long now = System.currentTimeMillis();
index 6d772538a171159942ae7be12365dc26a122c779..9a0249aa88841f3888b12564b07ae5213bc65391 100644 (file)
@@ -44,7 +44,7 @@ public class BaseIndexTest {
   SearchClient searchClient;
 
   @Before
-  public void setup() throws IOException {
+  public void setup() {
     EsServerHolder holder = EsServerHolder.get();
     Settings settings = new Settings();
     settings.setProperty(ProcessProperties.CLUSTER_ACTIVATE, false);
@@ -56,7 +56,7 @@ public class BaseIndexTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     if (searchClient != null) {
       searchClient.stop();
     }
index 579ec6da2a4483093850df1366a451717d928c38..80eb1bb18ebd6205e0fdeea8bab4d1d91e3c91fe 100644 (file)
@@ -50,12 +50,12 @@ public class FacetsMediumTest {
   public static EsTester esTester = new EsTester().addDefinitions(new FacetsTestDefinition());
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     esTester.truncateIndices();
   }
 
   @Test
-  public void should_ignore_result_without_aggregations() throws Exception {
+  public void should_ignore_result_without_aggregations() {
     Facets facets = new Facets(mock(SearchResponse.class));
     assertThat(facets.getFacets()).isEmpty();
     assertThat(facets.getFacetKeys("polop")).isEmpty();
index bdf59fb682224cdaf2ab5f64f8b4fe91013025b1..f08ad8f41d3cabd4af935c13a5c376674e44741e 100644 (file)
@@ -35,19 +35,19 @@ public class QueryContextTest {
   QueryContext options;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     MockUserSession.set().setLogin("john").setUserGroups("sonar-users");
     options = new QueryContext();
   }
 
   @Test
-  public void user_and_groups() throws Exception {
+  public void user_and_groups() {
     assertThat(options.getUserLogin()).isEqualTo("john");
     assertThat(options.getUserGroups()).containsOnly("sonar-users", "Anyone");
   }
 
   @Test
-  public void page_shortcut_for_limit_and_offset() throws Exception {
+  public void page_shortcut_for_limit_and_offset() {
     options.setPage(3, 10);
 
     assertThat(options.getLimit()).isEqualTo(10);
@@ -55,7 +55,7 @@ public class QueryContextTest {
   }
 
   @Test
-  public void page_starts_at_one() throws Exception {
+  public void page_starts_at_one() {
     options.setPage(1, 10);
     assertThat(options.getLimit()).isEqualTo(10);
     assertThat(options.getOffset()).isEqualTo(0);
@@ -63,7 +63,7 @@ public class QueryContextTest {
   }
 
   @Test
-  public void with_zero_page_size() throws Exception {
+  public void with_zero_page_size() {
     options.setPage(1, 0);
     assertThat(options.getLimit()).isEqualTo(0);
     assertThat(options.getOffset()).isEqualTo(0);
@@ -71,7 +71,7 @@ public class QueryContextTest {
   }
 
   @Test
-  public void page_must_be_strictly_positive() throws Exception {
+  public void page_must_be_strictly_positive() {
     try {
       options.setPage(0, 10);
       fail();
@@ -81,7 +81,7 @@ public class QueryContextTest {
   }
 
   @Test
-  public void page_size_must_be_positive() throws Exception {
+  public void page_size_must_be_positive() {
     try {
       options.setPage(2, -1);
       fail();
@@ -91,7 +91,7 @@ public class QueryContextTest {
   }
 
   @Test
-  public void max_limit() throws Exception {
+  public void max_limit() {
     options.setLimit(42);
     assertThat(options.getLimit()).isEqualTo(42);
 
@@ -100,20 +100,20 @@ public class QueryContextTest {
   }
 
   @Test
-  public void set_max_limit() throws Exception {
+  public void set_max_limit() {
     options.setMaxLimit();
     assertThat(options.getLimit()).isEqualTo(QueryContext.MAX_LIMIT);
   }
 
   @Test
-  public void max_page_size() throws Exception {
+  public void max_page_size() {
     options.setPage(3, QueryContext.MAX_LIMIT + 10);
     assertThat(options.getOffset()).isEqualTo(QueryContext.MAX_LIMIT * 2);
     assertThat(options.getLimit()).isEqualTo(QueryContext.MAX_LIMIT);
   }
 
   @Test
-  public void getFieldsToReturn() throws Exception {
+  public void getFieldsToReturn() {
     assertThat(options.getFieldsToReturn()).isEmpty();
 
     options.setFieldsToReturn(Arrays.asList("one", "two"));
@@ -127,7 +127,7 @@ public class QueryContextTest {
   }
 
   @Test
-  public void support_immutable_fields() throws Exception {
+  public void support_immutable_fields() {
     options.setFieldsToReturn(ImmutableList.of("one", "two"));
     assertThat(options.getFieldsToReturn()).containsOnly("one", "two");
 
@@ -139,7 +139,7 @@ public class QueryContextTest {
   }
 
   @Test
-  public void do_not_request_facets_by_default() throws Exception {
+  public void do_not_request_facets_by_default() {
     assertThat(options.isFacet()).isFalse();
 
     options.addFacets(Arrays.asList("polop"));
index 5f0aa3305a4cfad325ebc5eda6a911a4c2f7e2c1..6682c53e32105be530a6937ccbd7bbb5ffd70f31 100644 (file)
@@ -36,13 +36,13 @@ public class SearchClientMediumTest {
   SearchClient searchClient;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     searchClient = tester.get(SearchClient.class);
   }
 
   @Test
-  public void prepare_multi_search_is_not_yet_implemented() throws Exception {
+  public void prepare_multi_search_is_not_yet_implemented() {
     try {
       searchClient.prepareMultiSearch();
       fail();
@@ -52,7 +52,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void prepare_update_is_not_yet_implemented() throws Exception {
+  public void prepare_update_is_not_yet_implemented() {
     try {
       searchClient.prepareUpdate();
       fail();
@@ -69,7 +69,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void prepare_delete_is_not_yet_implemented() throws Exception {
+  public void prepare_delete_is_not_yet_implemented() {
     try {
       searchClient.prepareDelete();
       fail();
@@ -79,7 +79,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void delete_by_query_is_not_supported() throws Exception {
+  public void delete_by_query_is_not_supported() {
     try {
       searchClient.prepareDeleteByQuery();
       fail();
@@ -89,7 +89,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void prepare_percolate_is_not_yet_implemented() throws Exception {
+  public void prepare_percolate_is_not_yet_implemented() {
     try {
       searchClient.preparePercolate();
       fail();
@@ -99,7 +99,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void prepare_multi_percolate_is_not_yet_implemented() throws Exception {
+  public void prepare_multi_percolate_is_not_yet_implemented() {
     try {
       searchClient.prepareMultiPercolate();
       fail();
@@ -109,7 +109,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void prepare_suggest_is_not_yet_implemented() throws Exception {
+  public void prepare_suggest_is_not_yet_implemented() {
     try {
       searchClient.prepareSuggest("index");
       fail();
@@ -119,7 +119,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void prepare_more_like_this_is_not_yet_implemented() throws Exception {
+  public void prepare_more_like_this_is_not_yet_implemented() {
     try {
       searchClient.prepareMoreLikeThis("index", "tpye", "id");
       fail();
@@ -129,7 +129,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void prepare_term_vector_is_not_yet_implemented() throws Exception {
+  public void prepare_term_vector_is_not_yet_implemented() {
     try {
       searchClient.prepareTermVector("index", "tpye", "id");
       fail();
@@ -139,7 +139,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void prepare_multi_term_vectors_is_not_yet_implemented() throws Exception {
+  public void prepare_multi_term_vectors_is_not_yet_implemented() {
     try {
       searchClient.prepareMultiTermVectors();
       fail();
@@ -149,7 +149,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void prepare_explain_is_not_yet_implemented() throws Exception {
+  public void prepare_explain_is_not_yet_implemented() {
     try {
       searchClient.prepareExplain("index", "tpye", "id");
       fail();
@@ -159,7 +159,7 @@ public class SearchClientMediumTest {
   }
 
   @Test
-  public void prepare_clear_scroll_is_not_yet_implemented() throws Exception {
+  public void prepare_clear_scroll_is_not_yet_implemented() {
     try {
       searchClient.prepareClearScroll();
       fail();
index b7a587f9da22efb22c1d675e4685fb453ad16a52..13a654ce7f5325ddf02d528cf6a2586e76553e5c 100644 (file)
@@ -39,13 +39,13 @@ public class DeleteKeyTest {
   Index index;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     index = mock(Index.class);
     when(index.getIndexName()).thenReturn(TEST_INDEX.getIndexName());
   }
 
   @Test
-  public void get_delete_request() throws Exception {
+  public void get_delete_request() {
     String key = "test_key";
     DeleteKey<String> deleteAction = new DeleteKey<String>(TEST_INDEX.getIndexType(), key);
 
index b3eb3e785b2437c02c50325c649977d2f03d4ae7..32cd52992f9618b06b7445ffc2e916569d4f6335 100644 (file)
@@ -38,13 +38,13 @@ public class RefreshIndexTest {
   Index index;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     index = mock(Index.class);
     when(index.getIndexName()).thenReturn(TEST_INDEX.getIndexName());
   }
 
   @Test
-  public void get_delete_request() throws Exception {
+  public void get_delete_request() {
     RefreshIndex refreshAction = new RefreshIndex(TEST_INDEX.getIndexType());
 
     try {
index e69e22ee157f4a95a17e2538e6a2ed57ac37a708..f30ee445908801475d70ac9d05b00a158fc14a64 100644 (file)
@@ -38,7 +38,7 @@ import static org.mockito.Mockito.when;
 public class SearchOptionsTest {
 
   @Test
-  public void create_from_http_request() throws Exception {
+  public void create_from_http_request() {
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "3");
     request.setParam("ps", "10");
@@ -53,7 +53,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void hasField() throws Exception {
+  public void hasField() {
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "3");
     request.setParam("ps", "10");
@@ -65,7 +65,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void hasField_always_true_by_default() throws Exception {
+  public void hasField_always_true_by_default() {
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "3");
     request.setParam("ps", "10");
@@ -75,7 +75,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void hasField_no_if_empty_value() throws Exception {
+  public void hasField_no_if_empty_value() {
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "3");
     request.setParam("ps", "10");
@@ -86,7 +86,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void write_statistics_to_json_response() throws Exception {
+  public void write_statistics_to_json_response() {
     SimpleGetRequest request = new SimpleGetRequest();
     request.setParam("p", "3");
     request.setParam("ps", "10");
@@ -105,7 +105,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void defineFieldsParam() throws Exception {
+  public void defineFieldsParam() {
     WebService.Context context = new WebService.Context();
     new WebService() {
       @Override
@@ -125,7 +125,7 @@ public class SearchOptionsTest {
   }
 
   @Test
-  public void definePageParams() throws Exception {
+  public void definePageParams() {
     WebService.Context context = new WebService.Context();
     new WebService() {
       @Override
index 147813f98f1a7810cc700c1f9e6b0e0867bcf80c..985e72b76f4feb8b5173b34349b76c446b7c8e29 100644 (file)
@@ -42,7 +42,7 @@ public class DecorationDataHolderTest {
   }
 
   @Test
-  public void should_extract_lower_bounds_from_serialized_rules() throws Exception {
+  public void should_extract_lower_bounds_from_serialized_rules() {
 
     List<OpeningHtmlTag> openingTagsEntries = decorationDataHolder.getOpeningTagsEntries();
 
@@ -58,7 +58,7 @@ public class DecorationDataHolderTest {
   }
 
   @Test
-  public void should_extract_upper_bounds_from_serialized_rules() throws Exception {
+  public void should_extract_upper_bounds_from_serialized_rules() {
 
     List<Integer> offsets = decorationDataHolder.getClosingTagsOffsets();
 
index 9f21bfff3fdcf2e883a0dd5c042008a6cb27d2fa..4d2ab618fbc5ec09375a5d165e55b664efd8d9bc 100644 (file)
@@ -31,7 +31,7 @@ import static org.sonar.server.source.HtmlTextDecorator.LF_END_OF_LINE;
 public class HtmlTextDecoratorTest {
 
   @Test
-  public void should_decorate_simple_character_range() throws Exception {
+  public void should_decorate_simple_character_range() {
 
     String packageDeclaration = "package org.sonar.core.source;";
 
@@ -45,7 +45,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void should_decorate_multiple_lines_characters_range() throws Exception {
+  public void should_decorate_multiple_lines_characters_range() {
 
     String firstCommentLine = "/*";
     String secondCommentLine = " * Test";
@@ -70,7 +70,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void should_highlight_multiple_words_in_one_line() throws Exception {
+  public void should_highlight_multiple_words_in_one_line() {
 
     String classDeclaration = "public class MyClass implements MyInterface {";
 
@@ -87,7 +87,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void should_allow_multiple_levels_highlighting() throws Exception {
+  public void should_allow_multiple_levels_highlighting() {
 
     String javaDocSample =
       "/**" + LF_END_OF_LINE +
@@ -117,7 +117,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void should_support_crlf_line_breaks() throws Exception {
+  public void should_support_crlf_line_breaks() {
 
     String crlfCodeSample =
       "/**" + CR_END_OF_LINE + LF_END_OF_LINE +
@@ -147,7 +147,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void should_close_tags_at_end_of_file() throws Exception {
+  public void should_close_tags_at_end_of_file() {
 
     String classDeclarationSample =
       "/*" + LF_END_OF_LINE +
@@ -174,7 +174,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void should_escape_markup_chars() throws Exception {
+  public void should_escape_markup_chars() {
 
     String javadocWithHtml =
       "/**\n" +
@@ -211,7 +211,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void should_escape_ampersand_char() throws Exception {
+  public void should_escape_ampersand_char() {
 
     String javadocWithAmpersandChar =
       "/**\n" +
@@ -242,7 +242,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void should_support_cr_line_breaks() throws Exception {
+  public void should_support_cr_line_breaks() {
 
     String crCodeSample =
       "/**" + CR_END_OF_LINE +
@@ -273,7 +273,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void should_support_multiple_empty_lines_at_end_of_file() throws Exception {
+  public void should_support_multiple_empty_lines_at_end_of_file() {
 
     String classDeclarationSample =
       "/*" + LF_END_OF_LINE +
@@ -303,7 +303,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void returned_code_begin_from_given_param() throws Exception {
+  public void returned_code_begin_from_given_param() {
 
     String javadocWithHtml =
       "/**\n" +
@@ -339,7 +339,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void returned_code_end_to_given_param() throws Exception {
+  public void returned_code_end_to_given_param() {
 
     String javadocWithHtml =
       "/**\n" +
@@ -370,7 +370,7 @@ public class HtmlTextDecoratorTest {
   }
 
   @Test
-  public void returned_code_is_between_from_and_to_params() throws Exception {
+  public void returned_code_is_between_from_and_to_params() {
 
     String javadocWithHtml =
       "/**\n" +
index 67cc7e51b49739f18b3744a11160958124a7974e..256f2206e3b85efd8a1358682bfbc364f82cb180 100644 (file)
@@ -54,12 +54,12 @@ public class SourceServiceTest {
   SourceService service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     service = new SourceService(sourceDecorator, sourceLineIndex);
   }
 
   @Test
-  public void get_html_lines() throws Exception {
+  public void get_html_lines() {
     when(sourceLineIndex.getLines(COMPONENT_UUID, 1, Integer.MAX_VALUE)).thenReturn(
       Arrays.asList(new SourceLineDoc().setSource("source").setHighlighting("highlight").setSymbols("symbols")));
 
@@ -69,7 +69,7 @@ public class SourceServiceTest {
   }
 
   @Test
-  public void get_block_of_lines() throws Exception {
+  public void get_block_of_lines() {
 
     when(sourceLineIndex.getLines(COMPONENT_UUID, 1, Integer.MAX_VALUE)).thenReturn(
       Arrays.asList(new SourceLineDoc().setSource("source").setHighlighting("highlight").setSymbols("symbols"),
@@ -82,7 +82,7 @@ public class SourceServiceTest {
   }
 
   @Test
-  public void getLinesAsTxt() throws Exception {
+  public void getLinesAsTxt() {
     when(sourceLineIndex.getLines(COMPONENT_UUID, 1, Integer.MAX_VALUE)).thenReturn(
       Arrays.asList(
         new SourceLineDoc().setSource("line1"),
index 7fe56d6dc38228add7e78e98d3b6a417e84cf334..94d1a998130891c11ebc8fe917ae0581d3a79104 100644 (file)
@@ -49,12 +49,12 @@ public class FileSourceDaoTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void select() throws Exception {
+  public void select() {
     setupData("shared");
 
     FileSourceDto fileSourceDto = sut.selectSource("FILE1_UUID");
@@ -69,7 +69,7 @@ public class FileSourceDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_data() throws Exception {
+  public void select_data() {
     setupData("shared");
 
     InputStreamToStringFunction fn = new InputStreamToStringFunction();
@@ -79,7 +79,7 @@ public class FileSourceDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_line_hashes() throws Exception {
+  public void select_line_hashes() {
     setupData("shared");
 
     ReaderToStringFunction fn = new ReaderToStringFunction();
@@ -89,7 +89,7 @@ public class FileSourceDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void no_line_hashes_on_unknown_file() throws Exception {
+  public void no_line_hashes_on_unknown_file() {
     setupData("shared");
 
     ReaderToStringFunction fn = new ReaderToStringFunction();
@@ -99,7 +99,7 @@ public class FileSourceDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void insert() throws Exception {
+  public void insert() {
     setupData("shared");
 
     sut.insert(new FileSourceDto()
@@ -117,7 +117,7 @@ public class FileSourceDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void update() throws Exception {
+  public void update() {
     setupData("shared");
 
     sut.update(new FileSourceDto()
@@ -135,7 +135,7 @@ public class FileSourceDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void update_date_when_updated_date_is_zero() throws Exception {
+  public void update_date_when_updated_date_is_zero() {
     setupData("update_date_when_updated_date_is_zero");
 
     sut.updateDateWhenUpdatedDateIsZero(session, "ABCD", 1500000000002L);
index f33c15c528178a22036bedebcd9f95ec83de8bef..5fef0817afeecc233ab02fb9326bd803da2b133a 100644 (file)
@@ -32,7 +32,7 @@ public class SourceLineIndexDefinitionTest {
   IndexDefinition.IndexDefinitionContext context = new IndexDefinition.IndexDefinitionContext();
 
   @Test
-  public void define() throws Exception {
+  public void define() {
     IndexDefinition def = new SourceLineIndexDefinition(new Settings());
     def.define(context);
 
@@ -47,7 +47,7 @@ public class SourceLineIndexDefinitionTest {
   }
 
   @Test
-  public void enable_cluster() throws Exception {
+  public void enable_cluster() {
     Settings settings = new Settings();
     settings.setProperty(ProcessProperties.CLUSTER_ACTIVATE, true);
     IndexDefinition def = new SourceLineIndexDefinition(settings);
index 750b1d987a9ab4b13047a41b59795b1497449165..ece9adaf88f7dc3c2e33952f899eaf29ed099a72 100644 (file)
@@ -82,7 +82,7 @@ public class SourceLineIndexTest {
   }
 
   @Test
-  public void fail_to_get_line_when_line_is_not_greater_than_0() throws Exception {
+  public void fail_to_get_line_when_line_is_not_greater_than_0() {
     try {
       index.getLine("file1", 0);
     } catch (Exception e) {
@@ -105,7 +105,7 @@ public class SourceLineIndexTest {
   }
 
   @Test
-  public void fail_to_get_line_on_unknown_file() throws Exception {
+  public void fail_to_get_line_on_unknown_file() {
     try {
       index.getLine("file1", 1);
     } catch (Exception e) {
@@ -134,7 +134,7 @@ public class SourceLineIndexTest {
   }
 
   @Test
-  public void last_commit_null_when_not_found() throws Exception {
+  public void last_commit_null_when_not_found() {
     Date date = index.lastCommitDateOnProject("fake-project-uuid");
 
     assertThat(date).isNull();
index 047c30f8e9e78d1906825f224eda352727ec4912..d1c3de5eaaad2ddce0c0254767639f6b3c340976 100644 (file)
@@ -193,7 +193,7 @@ public class SourceLineIndexerTest {
   }
 
   @Test
-  public void index_source_lines_with_big_test_data() throws Exception {
+  public void index_source_lines_with_big_test_data() {
     Integer bigValue = Short.MAX_VALUE * 2;
 
     FileSourceDb.Data.Builder dataBuilder = FileSourceDb.Data.newBuilder();
index 205e4e4e35ae6dddbc31490d8695cda941b5433c..970166ff20ebe72f483b85e40c270f081c0f0b9c 100644 (file)
@@ -141,7 +141,7 @@ public class SourceLineResultSetIteratorTest {
   }
 
   @Test
-  public void filter_by_date() throws Exception {
+  public void filter_by_date() {
     db.prepareDbUnit(getClass(), "shared.xml");
 
     iterator = SourceLineResultSetIterator.create(dbClient, connection, 2000000000000L, null);
index b8bdf6771ec2ee08ff5543eef23716043fe1fe5b..c869d8b07884c2eb0f464ca0401513cb494a1e96 100644 (file)
@@ -56,7 +56,7 @@ public class HashActionTest {
   WsTester tester;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     db.truncateTables();
     this.session = db.myBatis().openSession(false);
 
@@ -89,7 +89,7 @@ public class HashActionTest {
   }
 
   @Test
-  public void fail_to_show_hashes_if_file_does_not_exist() throws Exception {
+  public void fail_to_show_hashes_if_file_does_not_exist() {
     MockUserSession.set().setLogin("polop").addProjectUuidPermissions(UserRole.USER, PROJECT_UUID);
     try {
       WsTester.TestRequest request = tester.newGetRequest("api/sources", "hash").setParam("key", COMPONENT_KEY);
index 521afdaa870be09fe02bbcf22a9690d61c060739..32dc4aa4b04faf5642e84ac772b736a1e6175bb3 100644 (file)
@@ -62,7 +62,7 @@ public class IndexActionTest {
   ComponentDto file = ComponentTesting.newFileDto(project);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(dbClient.componentDao()).thenReturn(componentDao);
     when(dbClient.openSession(false)).thenReturn(session);
     tester = new WsTester(new SourcesWs(new IndexAction(dbClient, sourceService)));
index f8a3825b08e0b971ae192f1a396c656dcf104775..c1da0aca749950df5a39681ab29763091ce01ec0 100644 (file)
@@ -72,7 +72,7 @@ public class LinesActionTest {
   WsTester wsTester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     esTester.truncateIndices();
 
@@ -87,7 +87,7 @@ public class LinesActionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
@@ -163,7 +163,7 @@ public class LinesActionTest {
   }
 
   @Test
-  public void fail_to_show_source_if_no_source_found() throws Exception {
+  public void fail_to_show_source_if_no_source_found() {
     newFile();
 
     MockUserSession.set().setLogin("login").addProjectUuidPermissions(UserRole.CODEVIEWER, PROJECT_UUID);
index 7b50c879a40ca10270fad2fd82223d686aecbcd7..2f4c27d729624ec2c8426053792751b86cb57f6e 100644 (file)
@@ -61,7 +61,7 @@ public class RawActionTest {
   ComponentDto file = ComponentTesting.newFileDto(project);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(dbClient.componentDao()).thenReturn(componentDao);
     when(dbClient.openSession(false)).thenReturn(session);
     tester = new WsTester(new SourcesWs(new RawAction(dbClient, sourceService)));
index a4e1f6e1c5fc63b1ba19be9a285f70bd958aa922..83d87337034dc5f6ff149c6e04adba94824c2460 100644 (file)
@@ -62,7 +62,7 @@ public class ScmActionTest {
   DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     esTester.truncateIndices();
     dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new ComponentDao());
@@ -72,7 +72,7 @@ public class ScmActionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index b8534b387976c78cf8b43317ed53cad63b5b1e85..55e92cedba62c0a4910f3caa6d9a54c7832f271b 100644 (file)
@@ -60,7 +60,7 @@ public class ShowActionTest {
   ComponentDto file = ComponentTesting.newFileDto(project);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(dbClient.componentDao()).thenReturn(componentDao);
     when(dbClient.openSession(false)).thenReturn(session);
     tester = new WsTester(new SourcesWs(new ShowAction(sourceService, dbClient)));
index 32a7887d33c216363dcd46ac5decb039686f3f18..dc7022937cc342b79b007cbb0fd5fc6213a7d535 100644 (file)
@@ -41,7 +41,7 @@ public class SourcesWsTest {
   WsTester tester = new WsTester(new SourcesWs(showAction, rawAction, linesAction, hashAction, indexAction));
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WebService.Controller controller = tester.controller("api/sources");
     assertThat(controller).isNotNull();
     assertThat(controller.since()).isEqualTo("4.2");
index c5540d8ff9ba9217bc2517c2eb2aeebd7de86fae..aaa29b610a8489c9a9c91575bdf453d6f81a2a6f 100644 (file)
@@ -53,14 +53,14 @@ public class CopyRequirementsFromCharacteristicsToRulesTest {
   CopyRequirementsFromCharacteristicsToRules service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(system2.now()).thenReturn(DateUtils.parseDate("2014-03-13").getTime());
     dbClient = new DbClient(db.database(), db.myBatis(), new RuleDao(system2), new LoadedTemplateDao(db.myBatis()));
     service = new CopyRequirementsFromCharacteristicsToRules(dbClient, null);
   }
 
   @Test
-  public void copy_requirements_from_characteristics_to_rules() throws Exception {
+  public void copy_requirements_from_characteristics_to_rules() {
     db.prepareDbUnit(getClass(), "copy_requirements_from_characteristics_to_rules.xml");
 
     service.start();
@@ -72,7 +72,7 @@ public class CopyRequirementsFromCharacteristicsToRulesTest {
    * SONAR-5335
    */
   @Test
-  public void convert_constant_issue_with_coeff_to_constant_issue_with_offset() throws Exception {
+  public void convert_constant_issue_with_coeff_to_constant_issue_with_offset() {
     db.prepareDbUnit(getClass(), "convert_constant_issue_with_coeff_to_constant_issue_with_offset.xml");
 
     service.start();
@@ -81,7 +81,7 @@ public class CopyRequirementsFromCharacteristicsToRulesTest {
   }
 
   @Test
-  public void remove_requirements_data_from_characteristics() throws Exception {
+  public void remove_requirements_data_from_characteristics() {
     db.prepareDbUnit(getClass(), "remove_requirements_data_from_characteristics.xml");
 
     service.start();
@@ -90,7 +90,7 @@ public class CopyRequirementsFromCharacteristicsToRulesTest {
   }
 
   @Test
-  public void do_nothing_when_already_executed() throws Exception {
+  public void do_nothing_when_already_executed() {
     db.prepareDbUnit(getClass(), "do_nothing_when_already_executed.xml");
 
     service.start();
@@ -99,7 +99,7 @@ public class CopyRequirementsFromCharacteristicsToRulesTest {
   }
 
   @Test
-  public void convert_duration() throws Exception {
+  public void convert_duration() {
     assertThat(CopyRequirementsFromCharacteristicsToRules.convertDuration(1.0, "h")).isEqualTo("1h");
     assertThat(CopyRequirementsFromCharacteristicsToRules.convertDuration(15.0, "d")).isEqualTo("15d");
     assertThat(CopyRequirementsFromCharacteristicsToRules.convertDuration(5.0, "min")).isEqualTo("5min");
@@ -115,7 +115,7 @@ public class CopyRequirementsFromCharacteristicsToRulesTest {
   }
 
   @Test
-  public void is_debt_default_values_same_as_overridden_values() throws Exception {
+  public void is_debt_default_values_same_as_overridden_values() {
     assertThat(CopyRequirementsFromCharacteristicsToRules.isDebtDefaultValuesSameAsOverriddenValues(new RuleDto()
         .setDefaultSubCharacteristicId(1).setSubCharacteristicId(1)
         .setDefaultRemediationFunction("LINEAR_OFFSET").setRemediationFunction("LINEAR_OFFSET")
index 642b55c71471ab116d7a18f63359392d28285355..56d686142a503e1d1d3a767866095c1d3024e600 100644 (file)
@@ -64,7 +64,7 @@ public class JdbcDriverDeployerTest {
   }
 
   @Test
-  public void dont_fail_when_medium_test() throws Exception {
+  public void dont_fail_when_medium_test() {
     Settings settings = new Settings();
     DefaultServerFileSystem fs = mock(DefaultServerFileSystem.class);
 
index 208e9236038b1899b7cb1f461c1f1c2960fdaa4a..eefc9578ff135b9bd7cbbdfa087aa54fd35fa728 100644 (file)
@@ -46,12 +46,12 @@ public class RegisterDebtModelTest {
   RegisterDebtModel registerDebtModel;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     registerDebtModel = new RegisterDebtModel(dao, debtModelBackup);
   }
 
   @Test
-  public void create_debt_model() throws Exception {
+  public void create_debt_model() {
     when(dao.selectEnabledCharacteristics()).thenReturn(Collections.<CharacteristicDto>emptyList());
 
     registerDebtModel.start();
@@ -60,7 +60,7 @@ public class RegisterDebtModelTest {
   }
 
   @Test
-  public void not_create_debt_model_if_already_exists() throws Exception {
+  public void not_create_debt_model_if_already_exists() {
     when(dao.selectEnabledCharacteristics()).thenReturn(newArrayList(new CharacteristicDto()));
 
     registerDebtModel.start();
index fd8b0eb827190759cf2b9aec099b3e95fd000107..5fa9a9af0f455299020e3dd7574e6b3b81fb63f6 100644 (file)
@@ -59,7 +59,7 @@ public class RegisterPermissionTemplatesTest {
   }
 
   @Test
-  public void should_insert_and_register_default_permission_template() throws Exception {
+  public void should_insert_and_register_default_permission_template() {
     LoadedTemplateDto expectedTemplate = new LoadedTemplateDto().setKey(PermissionTemplateDto.DEFAULT.getKee())
       .setType(LoadedTemplateDto.PERMISSION_TEMPLATE_TYPE);
     PermissionTemplateDto permissionTemplate = PermissionTemplateDto.DEFAULT.setId(1L);
@@ -85,7 +85,7 @@ public class RegisterPermissionTemplatesTest {
   }
 
   @Test
-  public void should_skip_insertion_and_registration() throws Exception {
+  public void should_skip_insertion_and_registration() {
     when(loadedTemplateDao.countByTypeAndKey(LoadedTemplateDto.PERMISSION_TEMPLATE_TYPE, PermissionTemplateDto.DEFAULT.getKee()))
       .thenReturn(1);
 
@@ -97,7 +97,7 @@ public class RegisterPermissionTemplatesTest {
   }
 
   @Test
-  public void should_reference_TRK_template_as_default_when_present() throws Exception {
+  public void should_reference_TRK_template_as_default_when_present() {
     when(settings.getString(RegisterPermissionTemplates.DEFAULT_PROJECTS_TEMPLATE_PROPERTY)).thenReturn("my_projects_template");
 
     LoadedTemplateDto expectedTemplate = new LoadedTemplateDto().setKey(PermissionTemplateDto.DEFAULT.getKee())
index 21df0bbbe1ef56044ba844f5c08a6ac6cdda447b..61b09224b25308318adf901a05096bcaafa7043b 100644 (file)
@@ -48,7 +48,7 @@ public class RenameIssueWidgetsTest {
   public DbTester dbTester = new DbTester();
 
   @Test
-  public void should_rename_widgets() throws Exception {
+  public void should_rename_widgets() {
     dbTester.prepareDbUnit(this.getClass(), "before.xml");
 
     doStart();
@@ -65,7 +65,7 @@ public class RenameIssueWidgetsTest {
   }
 
   @Test
-  public void should_skip_when_already_executed() throws Exception {
+  public void should_skip_when_already_executed() {
     dbTester.prepareDbUnit(this.getClass(), "after.xml");
 
     doStart();
index e514c411f6bf326f68c83d0f90354133aef0b2d1..a90e354e1adfd2c27af0b343363e34151a45a5e8 100644 (file)
@@ -56,14 +56,14 @@ public class CoverageServiceTest {
   CoverageService service;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     MyBatis myBatis = mock(MyBatis.class);
     when(myBatis.openSession(false)).thenReturn(session);
     service = new CoverageService(myBatis, measureDao, snapshotPerspectives);
   }
 
   @Test
-  public void check_permission() throws Exception {
+  public void check_permission() {
     String projectKey = "org.sonar.sample";
     MockUserSession.set().addComponentPermission(UserRole.CODEVIEWER, projectKey, COMPONENT_KEY);
 
@@ -71,7 +71,7 @@ public class CoverageServiceTest {
   }
 
   @Test
-  public void get_hits_data() throws Exception {
+  public void get_hits_data() {
     service.getHits(COMPONENT_KEY, CoverageService.TYPE.UT);
     verify(measureDao).findByComponentKeyAndMetricKey(session, COMPONENT_KEY, CoreMetrics.COVERAGE_LINE_HITS_DATA_KEY);
 
@@ -83,13 +83,13 @@ public class CoverageServiceTest {
   }
 
   @Test
-  public void not_get_hits_data_if_no_data() throws Exception {
+  public void not_get_hits_data_if_no_data() {
     when(measureDao.findByComponentKeyAndMetricKey(eq(session), anyString(), anyString())).thenReturn(null);
     assertThat(service.getHits(COMPONENT_KEY, CoverageService.TYPE.UT)).isEqualTo(Collections.emptyMap());
   }
 
   @Test
-  public void get_conditions_data() throws Exception {
+  public void get_conditions_data() {
     service.getConditions(COMPONENT_KEY, CoverageService.TYPE.UT);
     verify(measureDao).findByComponentKeyAndMetricKey(session, COMPONENT_KEY, CoreMetrics.CONDITIONS_BY_LINE_KEY);
 
@@ -101,7 +101,7 @@ public class CoverageServiceTest {
   }
 
   @Test
-  public void get_covered_conditions_data() throws Exception {
+  public void get_covered_conditions_data() {
     service.getCoveredConditions(COMPONENT_KEY, CoverageService.TYPE.UT);
     verify(measureDao).findByComponentKeyAndMetricKey(session, COMPONENT_KEY, CoreMetrics.COVERED_CONDITIONS_BY_LINE_KEY);
 
@@ -113,7 +113,7 @@ public class CoverageServiceTest {
   }
 
   @Test
-  public void get_test_cases_by_lines() throws Exception {
+  public void get_test_cases_by_lines() {
     MutableTestable testable = mock(MutableTestable.class);
     when(snapshotPerspectives.as(MutableTestable.class, COMPONENT_KEY)).thenReturn(testable);
 
@@ -124,7 +124,7 @@ public class CoverageServiceTest {
   }
 
   @Test
-  public void not_get_test_cases_by_lines_if_no_testable() throws Exception {
+  public void not_get_test_cases_by_lines_if_no_testable() {
     when(snapshotPerspectives.as(MutableTestable.class, COMPONENT_KEY)).thenReturn(null);
 
     assertThat(service.getTestCases(COMPONENT_KEY, CoverageService.TYPE.UT)).isEqualTo(Collections.emptyMap());
index 5b841bc2cf7211b9024f34e2c9c82049520a40fe..f64c1e81fac9100251a5e3c96d201133f3b71250 100644 (file)
@@ -39,7 +39,7 @@ public class TestIndexTest {
   TestIndex sut = new TestIndex(es.client());
 
   @Before
-  public void setup() throws Exception {
+  public void setup() {
     es.truncateIndices();
   }
 
index 432e924ec1b9590aaf68c926f01a253bbec19249..6e08ead1e28073cee9944a733baa1d45bd507711 100644 (file)
@@ -138,7 +138,7 @@ public class TestResultSetIteratorTest {
   }
 
   @Test
-  public void filter_by_date() throws Exception {
+  public void filter_by_date() {
     db.prepareDbUnit(getClass(), "shared.xml");
     sut = TestResultSetIterator.create(dbClient, connection, 2000000000000L, null);
 
@@ -191,7 +191,7 @@ public class TestResultSetIteratorTest {
     }
   }
 
-  private static List<FileSourceDb.Test> newFakeTests(int numberOfTests) throws IOException {
+  private static List<FileSourceDb.Test> newFakeTests(int numberOfTests) {
     List<FileSourceDb.Test> tests = new ArrayList<>();
     for (int i = 1; i <= numberOfTests; i++) {
       FileSourceDb.Test.Builder test = FileSourceDb.Test.newBuilder()
index 35ab69f33a70c39a23f7af9c02691ca7eed640e1..65aa8094bb948d3b5aa2d1a860098e4711c9ea65 100644 (file)
@@ -49,7 +49,7 @@ public class TestsCoveredFilesActionTest {
   private TestIndex testIndex;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbClient = mock(DbClient.class, RETURNS_DEEP_STUBS);
     testIndex = mock(TestIndex.class, RETURNS_DEEP_STUBS);
     ws = new WsTester(new TestsWs(new TestsCoveredFilesAction(dbClient, testIndex)));
index 08e15006bd0a8d16d8f104a10f476223d22b5d2c..6a33608844eedad3240e22d56a67d3e1c58add35 100644 (file)
@@ -56,7 +56,7 @@ public class TestsListActionTest {
   public static EsTester es = new EsTester().addDefinitions(new TestIndexDefinition(new Settings()));
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbClient = new DbClient(db.database(), db.myBatis(), new ComponentDao());
     dbSession = dbClient.openSession(false);
     db.truncateTables();
@@ -67,7 +67,7 @@ public class TestsListActionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     dbSession.close();
   }
 
index 590777108bcf9113951a401be0028b0dc8641114..b854c9cd419ab06a2844a76d97c1a87add1e1edb 100644 (file)
@@ -35,7 +35,7 @@ public class TestsWsTest {
   WebService.Controller controller;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     WsTester tester = new WsTester(new TestsWs(
       new TestsListAction(mock(DbClient.class), mock(TestIndex.class)),
       new TestsCoveredFilesAction(mock(DbClient.class), mock(TestIndex.class))));
@@ -43,7 +43,7 @@ public class TestsWsTest {
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     assertThat(controller).isNotNull();
     assertThat(controller.since()).isEqualTo("4.4");
     assertThat(controller.description()).isNotEmpty();
@@ -51,7 +51,7 @@ public class TestsWsTest {
   }
 
   @Test
-  public void define_list_action() throws Exception {
+  public void define_list_action() {
     WebService.Action action = controller.action("list");
     assertThat(action).isNotNull();
     assertThat(action.isInternal()).isFalse();
@@ -62,7 +62,7 @@ public class TestsWsTest {
   }
 
   @Test
-  public void define_covered_files() throws Exception {
+  public void define_covered_files() {
     WebService.Action action = controller.action("covered_files");
     assertThat(action).isNotNull();
     assertThat(action.isInternal()).isFalse();
index ef43ebf1a4c545ae79487e09423e251cefd3d63a..1fd3d434827411be9d60588bffd1c3327d88d4a1 100644 (file)
@@ -32,19 +32,19 @@ public class RubyTextServiceTest {
   RubyTextService text = new RubyTextService(macroInterpreter);
 
   @Test
-  public void interpretMacros() throws Exception {
+  public void interpretMacros() {
     text.interpretMacros("text with macros");
     verify(macroInterpreter, times(1)).interpret("text with macros");
   }
 
   @Test
-  public void markdownToHtml() throws Exception {
+  public void markdownToHtml() {
     String html = text.markdownToHtml("some *markdown*");
     assertThat(html).isEqualTo("some <em>markdown</em>");
   }
 
   @Test
-  public void should_escape_markdown_input() throws Exception {
+  public void should_escape_markdown_input() {
     String html = text.markdownToHtml("a > b");
     assertThat(html).isEqualTo("a &gt; b");
   }
index 6697f578d436c41b6ba54a14f4caa4296f0bcf52..acda1ad907c06b3dd870407e4f5d4e2595870b76 100644 (file)
@@ -49,7 +49,7 @@ public class JRubyI18nTest {
 
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     jRubyI18n = new JRubyI18n(i18n, durations);
   }
 
@@ -70,37 +70,37 @@ public class JRubyI18nTest {
   }
 
   @Test
-  public void default_locale_should_be_english() throws Exception {
+  public void default_locale_should_be_english() {
     assertThat(JRubyI18n.toLocale(null)).isEqualTo(Locale.ENGLISH);
   }
 
   @Test
-  public void message() throws Exception {
+  public void message() {
     jRubyI18n.message("en", "my.key", "default");
     verify(i18n).message(any(Locale.class), eq("my.key"), eq("default"));
   }
 
   @Test
-  public void age_from_now() throws Exception {
+  public void age_from_now() {
     Date date = new Date();
     jRubyI18n.ageFromNow(date);
     verify(i18n).ageFromNow(any(Locale.class), eq(date));
   }
 
   @Test
-  public void format_work_duration() throws Exception {
+  public void format_work_duration() {
     jRubyI18n.formatDuration(Duration.create(10L), "SHORT");
     verify(durations).format(any(Locale.class), eq(Duration.create(10L)), eq(Durations.DurationFormat.SHORT));
   }
 
   @Test
-  public void format_long_work_duration() throws Exception {
+  public void format_long_work_duration() {
     jRubyI18n.formatLongDuration(10L, "SHORT");
     verify(durations).format(any(Locale.class), eq(Duration.create(10L)), eq(Durations.DurationFormat.SHORT));
   }
 
   @Test
-  public void format_date_time() throws Exception {
+  public void format_date_time() {
     Date date = new Date();
     jRubyI18n.formatDateTime(date);
     verify(i18n).formatDateTime(any(Locale.class), eq(date));
index 60a335023aa0469ce34e21692d2fd2a45bcdca4d..db1cf9f28b089cc5cb2374bd3e291f5816d7b6b5 100644 (file)
@@ -192,7 +192,7 @@ public class ViewProxyTest {
   }
 
   @Test
-  public void shouldAcceptAvailableMeasuresForNoRequiredMeasures() throws Exception {
+  public void shouldAcceptAvailableMeasuresForNoRequiredMeasures() {
     class MyView extends FakeView {
       MyView() {
         super("fake");
@@ -204,7 +204,7 @@ public class ViewProxyTest {
   }
 
   @Test
-  public void shouldAcceptAvailableMeasuresForMandatoryMeasures() throws Exception {
+  public void shouldAcceptAvailableMeasuresForMandatoryMeasures() {
     @RequiredMeasures(allOf = {"lines", "ncloc"})
     class MyView extends FakeView {
       MyView() {
@@ -218,7 +218,7 @@ public class ViewProxyTest {
   }
 
   @Test
-  public void shouldAcceptAvailableMeasuresForOneOfNeededMeasures() throws Exception {
+  public void shouldAcceptAvailableMeasuresForOneOfNeededMeasures() {
     @RequiredMeasures(anyOf = {"lines", "ncloc"})
     class MyView extends FakeView {
       MyView() {
@@ -232,7 +232,7 @@ public class ViewProxyTest {
   }
 
   @Test
-  public void shouldAcceptAvailableMeasuresForMandatoryAndOneOfNeededMeasures() throws Exception {
+  public void shouldAcceptAvailableMeasuresForMandatoryAndOneOfNeededMeasures() {
     @RequiredMeasures(allOf = {"lines", "ncloc"}, anyOf = {"duplications", "duplictated_blocks"})
     class MyView extends FakeView {
       MyView() {
index 53dcad171cab6e9506bcfcf6426eab8d5449f852..fe1bd5d59c9ce6d1bbd76efd9fe0d7f9d820fd6a 100644 (file)
@@ -90,7 +90,7 @@ public class ComponentNavigationActionTest {
   private ResourceTypes resourceTypes;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     dbTester.truncateTables();
 
     System2 system = mock(System2.class);
@@ -117,7 +117,7 @@ public class ComponentNavigationActionTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     session.close();
   }
 
index 18b74d183c420061d48ecfa855161703c2ce23ef..92adb3f3a38440f9293c930731923eca82bc2316 100644 (file)
@@ -64,7 +64,7 @@ public class GlobalNavigationActionTest {
   private ActiveDashboardDao activeDashboardDao;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     dbTester.truncateTables();
 
     userDao = new UserDao(dbTester.myBatis(), mock(System2.class));
@@ -77,7 +77,7 @@ public class GlobalNavigationActionTest {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     session.close();
   }
 
index 16c9b6ea04c343417b7b3f84546f8c0a7a7d6501..7be8ff71cf673d0e9a07184a443d1a271c97e0ac 100644 (file)
@@ -50,7 +50,7 @@ public class SettingsNavigationActionTest {
   private I18n i18n;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     settings = new Settings();
     i18n = mock(I18n.class);
     when(i18n.message(any(Locale.class), anyString(), anyString())).thenAnswer(new Answer<String>() {
index 0208a7d859c36490c75f5793c1d4815bd5c78746..5b1b2f54b8e6050c6feebe0e372539a23088a4ec 100644 (file)
@@ -33,12 +33,12 @@ public class UpdateCenterWsTest {
   WsTester tester;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester = new WsTester(new UpdateCenterWs());
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     WebService.Controller controller = tester.controller("api/updatecenter");
     assertThat(controller).isNotNull();
     assertThat(controller.since()).isEqualTo("2.10");
@@ -47,7 +47,7 @@ public class UpdateCenterWsTest {
   }
 
   @Test
-  public void define_installed_plugins_action() throws Exception {
+  public void define_installed_plugins_action() {
     WebService.Controller controller = tester.controller("api/updatecenter");
 
     WebService.Action action = controller.action("installed_plugins");
index 142362e3dfde12585a85126b487eb040faed71ee..b2e0de9de51aa31ccf52f93d717dd09db0bdc8e1 100644 (file)
@@ -59,7 +59,7 @@ public class DefaultUserServiceTest {
   public ExpectedException thrown = ExpectedException.none();
 
   @Test
-  public void parse_query() throws Exception {
+  public void parse_query() {
     service.find(ImmutableMap.<String, Object>of(
       "logins", "simon,loic",
       "includeDeactivated", "true",
@@ -91,7 +91,7 @@ public class DefaultUserServiceTest {
   }
 
   @Test
-  public void self_deactivation_is_not_possible() throws Exception {
+  public void self_deactivation_is_not_possible() {
     try {
       MockUserSession.set().setLogin("simon").setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
       service.deactivate("simon");
@@ -103,7 +103,7 @@ public class DefaultUserServiceTest {
   }
 
   @Test
-  public void user_deactivation_requires_admin_permission() throws Exception {
+  public void user_deactivation_requires_admin_permission() {
     try {
       MockUserSession.set().setLogin("simon").setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN);
       service.deactivate("julien");
@@ -114,14 +114,14 @@ public class DefaultUserServiceTest {
   }
 
   @Test
-  public void deactivate_user() throws Exception {
+  public void deactivate_user() {
     MockUserSession.set().setLogin("simon").setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
     service.deactivate("julien");
     verify(userUpdater).deactivateUserByLogin("julien");
   }
 
   @Test
-  public void fail_to_deactivate_when_blank_login() throws Exception {
+  public void fail_to_deactivate_when_blank_login() {
     MockUserSession.set().setLogin("simon").setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
     try {
       service.deactivate("");
@@ -132,7 +132,7 @@ public class DefaultUserServiceTest {
   }
 
   @Test
-  public void create() throws Exception {
+  public void create() {
     Map<String, Object> params = newHashMap();
     params.put("login", "john");
     params.put("name", "John");
@@ -149,7 +149,7 @@ public class DefaultUserServiceTest {
   }
 
   @Test
-  public void update() throws Exception {
+  public void update() {
     Map<String, Object> params = newHashMap();
     params.put("login", "john");
     params.put("name", "John");
@@ -171,7 +171,7 @@ public class DefaultUserServiceTest {
   }
 
   @Test
-  public void update_only_name() throws Exception {
+  public void update_only_name() {
     Map<String, Object> params = newHashMap();
     params.put("login", "john");
     params.put("name", "John");
@@ -186,7 +186,7 @@ public class DefaultUserServiceTest {
   }
 
   @Test
-  public void update_only_email() throws Exception {
+  public void update_only_email() {
     Map<String, Object> params = newHashMap();
     params.put("login", "john");
     params.put("email", "john@email.com");
@@ -201,7 +201,7 @@ public class DefaultUserServiceTest {
   }
 
   @Test
-  public void update_only_scm_accounts() throws Exception {
+  public void update_only_scm_accounts() {
     Map<String, Object> params = newHashMap();
     params.put("login", "john");
     params.put("scm_accounts", newArrayList("jn"));
@@ -216,7 +216,7 @@ public class DefaultUserServiceTest {
   }
 
   @Test
-  public void update_only_password() throws Exception {
+  public void update_only_password() {
     Map<String, Object> params = newHashMap();
     params.put("login", "john");
     params.put("password", "1234");
@@ -232,13 +232,13 @@ public class DefaultUserServiceTest {
   }
 
   @Test
-  public void get_by_login() throws Exception {
+  public void get_by_login() {
     service.getByLogin("john");
     verify(userIndex).getNullableByLogin("john");
   }
 
   @Test
-  public void index() throws Exception {
+  public void index() {
     service.index();
     verify(userUpdater).index();
   }
index 090369bb2b2a311b640914dc70318f58e479b3e8..77a3d8131c540df632f2ccecfbc96d837e0b69fd 100644 (file)
@@ -39,13 +39,13 @@ public class GroupMembershipFinderTest {
   GroupMembershipFinder finder;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     when(userDao.selectActiveUserByLogin("arthur")).thenReturn(new UserDto().setId(100L).setName("arthur"));
     finder = new GroupMembershipFinder(userDao, groupMembershipDao);
   }
 
   @Test
-  public void find() throws Exception {
+  public void find() {
     GroupMembershipQuery query = GroupMembershipQuery.builder().login("arthur").build();
     when(groupMembershipDao.selectGroups(eq(query), anyLong(), anyInt(), anyInt())).thenReturn(
       newArrayList(new GroupMembershipDto().setId(1L).setName("users").setDescription("Users group").setUserId(100L))
@@ -63,7 +63,7 @@ public class GroupMembershipFinderTest {
   }
 
   @Test
-  public void find_with_paging() throws Exception {
+  public void find_with_paging() {
     GroupMembershipQuery query = GroupMembershipQuery.builder().login("arthur").pageIndex(3).pageSize(10).build();
     finder.find(query);
 
@@ -76,7 +76,7 @@ public class GroupMembershipFinderTest {
   }
 
   @Test
-  public void find_with_paging_having_more_results() throws Exception {
+  public void find_with_paging_having_more_results() {
     GroupMembershipQuery query = GroupMembershipQuery.builder().login("arthur").pageIndex(1).pageSize(2).build();
     when(groupMembershipDao.selectGroups(eq(query), anyLong(), anyInt(), anyInt())).thenReturn(newArrayList(
       new GroupMembershipDto().setId(1L).setName("group1"),
@@ -95,7 +95,7 @@ public class GroupMembershipFinderTest {
   }
 
   @Test
-  public void find_with_paging_having_no_more_results() throws Exception {
+  public void find_with_paging_having_no_more_results() {
     GroupMembershipQuery query = GroupMembershipQuery.builder().login("arthur").pageIndex(1).pageSize(10).build();
     when(groupMembershipDao.selectGroups(eq(query), anyLong(), anyInt(), anyInt())).thenReturn(newArrayList(
       new GroupMembershipDto().setId(1L).setName("group1"),
index 55688bfe10e528736ab84ad883a5e8ed09a3608c..2c5b83f64227b5908c48791bb2314aff311b76b8 100644 (file)
@@ -43,7 +43,7 @@ public class GroupMembershipServiceTest extends AbstractDaoTestCase {
   GroupMembershipService service;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     GroupMembershipDao membershipDao = new GroupMembershipDao(getMyBatis());
     UserDao userDao = new UserDao(getMyBatis(), System2.INSTANCE);
     GroupMembershipFinder finder = new GroupMembershipFinder(userDao, membershipDao);
index 6a32744ea58aa340a13268f5cc59e08cfff5fec1..a435689aa078e364d8c40afef2a77541de58140b 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 public class RubyUserSessionTest {
   @Test
-  public void should_set_session() throws Exception {
+  public void should_set_session() {
     RubyUserSession.setSession(123, "karadoc", "Karadoc", newArrayList("sonar-users"), "fr");
 
     UserSession session = UserSession.get();
@@ -43,7 +43,7 @@ public class RubyUserSessionTest {
   }
 
   @Test
-  public void should_set_anonymous_session() throws Exception {
+  public void should_set_anonymous_session() {
     RubyUserSession.setSession(null, null, null, null, "fr");
 
     UserSession session = UserSession.get();
index 589ccd36a6e23978ec73a7d8c66e5bcd41c83fe8..ec163751110f51a2436e30c78c80ae498540ad53 100644 (file)
@@ -45,7 +45,7 @@ public class UserSessionTest {
   public ExpectedException thrown = ExpectedException.none();
 
   @Test
-  public void getSession_get_anonymous_by_default() throws Exception {
+  public void getSession_get_anonymous_by_default() {
     UserSession.remove();
 
     UserSession session = UserSession.get();
@@ -59,7 +59,7 @@ public class UserSessionTest {
   }
 
   @Test
-  public void get_session() throws Exception {
+  public void get_session() {
     UserSession.set(new UserSession().setUserId(123).setLogin("karadoc").setLocale(Locale.FRENCH));
 
     UserSession session = UserSession.get();
@@ -71,14 +71,14 @@ public class UserSessionTest {
   }
 
   @Test
-  public void login_should_not_be_empty() throws Exception {
+  public void login_should_not_be_empty() {
     UserSession session = new UserSession().setLogin("");
     assertThat(session.login()).isNull();
     assertThat(session.isLoggedIn()).isFalse();
   }
 
   @Test
-  public void has_global_permission() throws Exception {
+  public void has_global_permission() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao);
 
@@ -90,7 +90,7 @@ public class UserSessionTest {
   }
 
   @Test
-  public void check_global_Permission_ok() throws Exception {
+  public void check_global_Permission_ok() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao);
 
@@ -100,7 +100,7 @@ public class UserSessionTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void check_global_Permission_ko() throws Exception {
+  public void check_global_Permission_ko() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao);
 
@@ -110,7 +110,7 @@ public class UserSessionTest {
   }
 
   @Test
-  public void has_project_permission() throws Exception {
+  public void has_project_permission() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao).setUserId(1);
     when(authorizationDao.selectAuthorizedRootProjectsKeys(1, UserRole.USER)).thenReturn(newArrayList("com.foo:Bar"));
@@ -121,7 +121,7 @@ public class UserSessionTest {
   }
 
   @Test
-  public void has_project_permission_by_uuid() throws Exception {
+  public void has_project_permission_by_uuid() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao).setUserId(1);
     when(authorizationDao.selectAuthorizedRootProjectsUuids(1, UserRole.USER)).thenReturn(newArrayList("ABCD"));
@@ -132,7 +132,7 @@ public class UserSessionTest {
   }
 
   @Test
-  public void check_project_permission_ok() throws Exception {
+  public void check_project_permission_ok() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao).setUserId(1);
     when(authorizationDao.selectAuthorizedRootProjectsKeys(1, UserRole.USER)).thenReturn(newArrayList("com.foo:Bar"));
@@ -141,7 +141,7 @@ public class UserSessionTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void check_project_permission_ko() throws Exception {
+  public void check_project_permission_ko() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao).setUserId(1);
     when(authorizationDao.selectAuthorizedRootProjectsKeys(1, UserRole.USER)).thenReturn(newArrayList("com.foo:Bar2"));
@@ -150,7 +150,7 @@ public class UserSessionTest {
   }
 
   @Test
-  public void check_project_uuid_permission_ok() throws Exception {
+  public void check_project_uuid_permission_ok() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao).setUserId(1);
 
@@ -161,7 +161,7 @@ public class UserSessionTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void check_project_uuid_permission_ko() throws Exception {
+  public void check_project_uuid_permission_ko() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao).setUserId(1);
 
@@ -172,7 +172,7 @@ public class UserSessionTest {
   }
 
   @Test
-  public void has_component_permission() throws Exception {
+  public void has_component_permission() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     ResourceDao resourceDao = mock(ResourceDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao, resourceDao).setUserId(1);
@@ -187,7 +187,7 @@ public class UserSessionTest {
   }
 
   @Test
-  public void check_component_key_permission_ok() throws Exception {
+  public void check_component_key_permission_ok() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     ResourceDao resourceDao = mock(ResourceDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao, resourceDao).setUserId(1);
@@ -199,7 +199,7 @@ public class UserSessionTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void check_component_key_permission_ko() throws Exception {
+  public void check_component_key_permission_ko() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     ResourceDao resourceDao = mock(ResourceDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao, resourceDao).setUserId(1);
@@ -211,7 +211,7 @@ public class UserSessionTest {
   }
 
   @Test
-  public void check_component_uuid_permission_ok() throws Exception {
+  public void check_component_uuid_permission_ok() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     ResourceDao resourceDao = mock(ResourceDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao,resourceDao).setUserId(1);
@@ -225,7 +225,7 @@ public class UserSessionTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void check_component_uuid_permission_ko() throws Exception {
+  public void check_component_uuid_permission_ko() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     ResourceDao resourceDao = mock(ResourceDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao,resourceDao).setUserId(1);
@@ -239,7 +239,7 @@ public class UserSessionTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void check_component_key_permission_when_project_not_found() throws Exception {
+  public void check_component_key_permission_when_project_not_found() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     ResourceDao resourceDao = mock(ResourceDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao, resourceDao).setUserId(1);
@@ -250,7 +250,7 @@ public class UserSessionTest {
   }
 
   @Test(expected = ForbiddenException.class)
-  public void check_component_dto_permission_ko() throws Exception {
+  public void check_component_dto_permission_ko() {
     AuthorizationDao authorizationDao = mock(AuthorizationDao.class);
     ResourceDao resourceDao = mock(ResourceDao.class);
     UserSession session = new SpyUserSession("marius", authorizationDao, resourceDao).setUserId(1);
index 76185dfce8a4d786d2ea012d4b698c40b1d80c07..a96cd3b697c77d77e5f1bd94afad30ae4d8124ba 100644 (file)
@@ -93,7 +93,7 @@ public class UserUpdaterTest {
 
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     db.truncateTables();
     es.truncateIndices();
     settings = new Settings();
@@ -111,12 +111,12 @@ public class UserUpdaterTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void create_user() throws Exception {
+  public void create_user() {
     when(system2.now()).thenReturn(1418215735482L);
     createDefaultGroup();
 
@@ -152,7 +152,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void create_user_with_minimum_fields() throws Exception {
+  public void create_user_with_minimum_fields() {
     when(system2.now()).thenReturn(1418215735482L);
     createDefaultGroup();
 
@@ -172,7 +172,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void create_user_with_scm_accounts_containing_blank_or_null_entries() throws Exception {
+  public void create_user_with_scm_accounts_containing_blank_or_null_entries() {
     when(system2.now()).thenReturn(1418215735482L);
     createDefaultGroup();
 
@@ -187,7 +187,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void create_user_with_scm_accounts_containing_one_blank_entry() throws Exception {
+  public void create_user_with_scm_accounts_containing_one_blank_entry() {
     when(system2.now()).thenReturn(1418215735482L);
     createDefaultGroup();
 
@@ -202,7 +202,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void create_user_with_scm_accounts_containing_duplications() throws Exception {
+  public void create_user_with_scm_accounts_containing_duplications() {
     when(system2.now()).thenReturn(1418215735482L);
     createDefaultGroup();
 
@@ -217,7 +217,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_missing_login() throws Exception {
+  public void fail_to_create_user_with_missing_login() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin(null)
@@ -232,7 +232,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_invalid_login() throws Exception {
+  public void fail_to_create_user_with_invalid_login() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("/marius/")
@@ -247,7 +247,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_too_short_login() throws Exception {
+  public void fail_to_create_user_with_too_short_login() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("ma")
@@ -262,7 +262,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_too_long_login() throws Exception {
+  public void fail_to_create_user_with_too_long_login() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin(Strings.repeat("m", 256))
@@ -277,7 +277,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_missing_name() throws Exception {
+  public void fail_to_create_user_with_missing_name() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("marius")
@@ -292,7 +292,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_too_long_name() throws Exception {
+  public void fail_to_create_user_with_too_long_name() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("marius")
@@ -307,7 +307,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_too_long_email() throws Exception {
+  public void fail_to_create_user_with_too_long_email() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("marius")
@@ -322,7 +322,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_missing_password() throws Exception {
+  public void fail_to_create_user_with_missing_password() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("marius")
@@ -337,7 +337,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_missing_password_confirmation() throws Exception {
+  public void fail_to_create_user_with_missing_password_confirmation() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("marius")
@@ -352,7 +352,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_password_not_matching_password_confirmation() throws Exception {
+  public void fail_to_create_user_with_password_not_matching_password_confirmation() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("marius")
@@ -367,7 +367,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_with_many_errors() throws Exception {
+  public void fail_to_create_user_with_many_errors() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("")
@@ -382,7 +382,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_when_scm_account_is_already_used() throws Exception {
+  public void fail_to_create_user_when_scm_account_is_already_used() {
     db.prepareDbUnit(getClass(), "fail_to_create_user_when_scm_account_is_already_used.xml");
 
     try {
@@ -400,7 +400,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_when_scm_account_is_already_used_by_many_user() throws Exception {
+  public void fail_to_create_user_when_scm_account_is_already_used_by_many_user() {
     db.prepareDbUnit(getClass(), "fail_to_create_user_when_scm_account_is_already_used_by_many_user.xml");
 
     try {
@@ -418,7 +418,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_when_scm_account_is_user_login() throws Exception {
+  public void fail_to_create_user_when_scm_account_is_user_login() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("marius")
@@ -434,7 +434,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_create_user_when_scm_account_is_user_email() throws Exception {
+  public void fail_to_create_user_when_scm_account_is_user_email() {
     try {
       userUpdater.create(NewUser.create()
         .setLogin("marius")
@@ -450,7 +450,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void notify_new_user() throws Exception {
+  public void notify_new_user() {
     createDefaultGroup();
 
     userUpdater.create(NewUser.create()
@@ -468,7 +468,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void associate_default_group_when_creating_user() throws Exception {
+  public void associate_default_group_when_creating_user() {
     createDefaultGroup();
 
     userUpdater.create(NewUser.create()
@@ -486,7 +486,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_associate_default_group_to_user_if_no_default_group() throws Exception {
+  public void fail_to_associate_default_group_to_user_if_no_default_group() {
     settings.setProperty(CoreProperties.CORE_DEFAULT_GROUP, (String) null);
 
     try {
@@ -503,7 +503,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void reactivate_user_when_creating_user_with_existing_login() throws Exception {
+  public void reactivate_user_when_creating_user_with_existing_login() {
     db.prepareDbUnit(getClass(), "reactivate_user.xml");
     when(system2.now()).thenReturn(1418215735486L);
     createDefaultGroup();
@@ -531,7 +531,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_reactivate_user_if_not_disabled() throws Exception {
+  public void fail_to_reactivate_user_if_not_disabled() {
     db.prepareDbUnit(getClass(), "fail_to_reactivate_user_if_not_disabled.xml");
     createDefaultGroup();
 
@@ -549,7 +549,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void associate_default_groups_when_reactivating_user() throws Exception {
+  public void associate_default_groups_when_reactivating_user() {
     db.prepareDbUnit(getClass(), "associate_default_groups_when_reactivating_user.xml");
     createDefaultGroup();
 
@@ -568,7 +568,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void update_user() throws Exception {
+  public void update_user() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     when(system2.now()).thenReturn(1418215735486L);
     createDefaultGroup();
@@ -603,7 +603,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void update_user_with_scm_accounts_containing_blank_entry() throws Exception {
+  public void update_user_with_scm_accounts_containing_blank_entry() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     createDefaultGroup();
 
@@ -621,7 +621,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void update_only_user_name() throws Exception {
+  public void update_only_user_name() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     createDefaultGroup();
 
@@ -641,7 +641,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void update_only_user_email() throws Exception {
+  public void update_only_user_email() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     createDefaultGroup();
 
@@ -661,7 +661,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void update_only_scm_accounts() throws Exception {
+  public void update_only_scm_accounts() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     createDefaultGroup();
 
@@ -681,7 +681,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void update_scm_accounts_with_same_values() throws Exception {
+  public void update_scm_accounts_with_same_values() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     createDefaultGroup();
 
@@ -695,7 +695,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void remove_scm_accounts() throws Exception {
+  public void remove_scm_accounts() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     createDefaultGroup();
 
@@ -709,7 +709,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void update_only_user_password() throws Exception {
+  public void update_only_user_password() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     createDefaultGroup();
 
@@ -730,7 +730,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void associate_default_group_when_updating_user() throws Exception {
+  public void associate_default_group_when_updating_user() {
     db.prepareDbUnit(getClass(), "associate_default_groups_when_updating_user.xml");
     createDefaultGroup();
 
@@ -749,7 +749,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void not_associate_default_group_when_updating_user_if_already_existing() throws Exception {
+  public void not_associate_default_group_when_updating_user_if_already_existing() {
     db.prepareDbUnit(getClass(), "not_associate_default_group_when_updating_user_if_already_existing.xml");
     settings.setProperty(CoreProperties.CORE_DEFAULT_GROUP, "sonar-users");
     session.commit();
@@ -776,7 +776,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_update_user_when_scm_account_is_already_used() throws Exception {
+  public void fail_to_update_user_when_scm_account_is_already_used() {
     db.prepareDbUnit(getClass(), "fail_to_update_user_when_scm_account_is_already_used.xml");
     createDefaultGroup();
 
@@ -794,7 +794,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_update_user_when_scm_account_is_user_login() throws Exception {
+  public void fail_to_update_user_when_scm_account_is_user_login() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     createDefaultGroup();
 
@@ -808,7 +808,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_update_user_when_scm_account_is_existing_user_email() throws Exception {
+  public void fail_to_update_user_when_scm_account_is_existing_user_email() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     createDefaultGroup();
 
@@ -822,7 +822,7 @@ public class UserUpdaterTest {
   }
 
   @Test
-  public void fail_to_update_user_when_scm_account_is_new_user_email() throws Exception {
+  public void fail_to_update_user_when_scm_account_is_new_user_email() {
     db.prepareDbUnit(getClass(), "update_user.xml");
     createDefaultGroup();
 
index 281f65e00eac36c302c7472ff49b6819a32b860f..744c742b77d2fe2fc53e93566ec52cf8beed70d1 100644 (file)
@@ -47,7 +47,7 @@ public class GroupDaoTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
@@ -65,7 +65,7 @@ public class GroupDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void find_by_user_login() throws Exception {
+  public void find_by_user_login() {
     setupData("find_by_user_login");
 
     assertThat(dao.findByUserLogin(session, "john")).hasSize(2);
@@ -73,7 +73,7 @@ public class GroupDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void insert() throws Exception {
+  public void insert() {
     when(system2.now()).thenReturn(DateUtils.parseDate("2014-09-08").getTime());
 
     setupData("empty");
index 3393ca9075f96256b0e003989db9b1133bcd9625..1de7629233e2ed605e8f0da36621ab0873835c09 100644 (file)
@@ -48,7 +48,7 @@ public class UserDaoTest {
   private DbSession session;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     db.truncateTables();
 
     this.session = db.myBatis().openSession(false);
index f1074bd24b33c29d256a84f6ae0ff49f48ecb703..3be2dd038e5209365a9a27bda868ef113858a488 100644 (file)
@@ -40,7 +40,7 @@ public class UserGroupDaoTest {
   private DbSession session;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     db.truncateTables();
     this.session = db.myBatis().openSession(false);
     this.dao = new UserGroupDao();
index 8de69b73d93c3e0e5a0199bd62c433f8cc8d523c..727deb08f3b189c62aa793c7e37c1d5aa6fbbd49 100644 (file)
@@ -32,7 +32,7 @@ public class UserIndexDefinitionTest {
   IndexDefinition.IndexDefinitionContext context = new IndexDefinition.IndexDefinitionContext();
 
   @Test
-  public void define() throws Exception {
+  public void define() {
     UserIndexDefinition def = new UserIndexDefinition(new Settings());
     def.define(context);
 
@@ -47,7 +47,7 @@ public class UserIndexDefinitionTest {
   }
 
   @Test
-  public void enable_cluster() throws Exception {
+  public void enable_cluster() {
     Settings settings = new Settings();
     settings.setProperty(ProcessProperties.CLUSTER_ACTIVATE, true);
     UserIndexDefinition def = new UserIndexDefinition(settings);
index 152393cd7f9c82ba433da1db6cab671865462428..b29a3e37c6fd5ee8925fdee016881313a0ee2a30 100644 (file)
@@ -86,7 +86,7 @@ public class UserIndexTest {
   }
 
   @Test
-  public void fail_to_get_by_login_on_unknown_user() throws Exception {
+  public void fail_to_get_by_login_on_unknown_user() {
     try {
       index.getByLogin("unknown");
       fail();
index 812b703252aa580ce689829bbda231df82ea540f..8a4bf020f7a39cb772bb32e056d9e027201924ff 100644 (file)
@@ -43,20 +43,20 @@ public class UserIndexerTest {
   public static EsTester esTester = new EsTester().addDefinitions(new UserIndexDefinition(new Settings()));
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     esTester.truncateIndices();
   }
 
   @Test
-  public void index_nothing() throws Exception {
+  public void index_nothing() {
     UserIndexer indexer = createIndexer();
     indexer.index();
     assertThat(esTester.countDocuments(UserIndexDefinition.INDEX, UserIndexDefinition.TYPE_USER)).isEqualTo(0L);
   }
 
   @Test
-  public void index() throws Exception {
+  public void index() {
     dbTester.prepareDbUnit(getClass(), "index.xml");
 
     UserIndexer indexer = createIndexer();
@@ -75,7 +75,7 @@ public class UserIndexerTest {
   }
 
   @Test
-  public void do_nothing_if_disabled() throws Exception {
+  public void do_nothing_if_disabled() {
     dbTester.prepareDbUnit(getClass(), "index.xml");
 
     createIndexer().setEnabled(false).index();
index f23bf973a0751f94048b2ff729a313db118979cf..ecedc14b5a147ba9994a08a2d5f8e8acc5215232 100644 (file)
@@ -53,12 +53,12 @@ public class UserResultSetIteratorTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     DbUtils.closeQuietly(connection);
   }
 
   @Test
-  public void iterator_over_users() throws Exception {
+  public void iterator_over_users() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
     UserResultSetIterator it = UserResultSetIterator.create(client, connection, 0L);
     Map<String, UserDoc> usersByLogin = Maps.uniqueIndex(it, new Function<UserDoc, String>() {
@@ -97,7 +97,7 @@ public class UserResultSetIteratorTest {
   }
 
   @Test
-  public void select_after_date() throws Exception {
+  public void select_after_date() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
     UserResultSetIterator it = UserResultSetIterator.create(client, connection, 1520000000000L);
 
index 896c251ad4b6382e7993e9a01e7014b68b56116a..885117eca6f3e321ccd1e5af81a08ceedd0b3db9 100644 (file)
@@ -74,7 +74,7 @@ public class ChangePasswordActionTest {
   DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     esTester.truncateIndices();
 
@@ -96,7 +96,7 @@ public class ChangePasswordActionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index 8b2a17cb0aab5284cb5eca6122630dd910fe5a69..db4e2b278210a8277d92c025f25944a04bded936 100644 (file)
@@ -84,7 +84,7 @@ public class CreateActionTest {
   I18n i18n;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     esTester.truncateIndices();
 
@@ -107,7 +107,7 @@ public class CreateActionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index 772e91dc61f71330aa61cd310442586340b10bed..d7edbbc6b7899c4f7eac66f1e8c9e5926f216a15 100644 (file)
@@ -79,7 +79,7 @@ public class DeactivateActionTest {
   I18n i18n;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     esTester.truncateIndices();
 
@@ -98,7 +98,7 @@ public class DeactivateActionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index d35d5220e43cfce7e2386ad78de7ff62cc2c7f04..0f7717332e3efba058704031db26bb14d48a9ea2 100644 (file)
@@ -31,7 +31,7 @@ public class FavoritesWsTest {
   WsTester tester = new WsTester(new FavoritesWs());
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WebService.Controller controller = tester.controller("api/favorites");
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
index 487e5168911f56d22e154dbe78a343d37ffac4ba..f4537b4ebfbe6b0ac7d6da1258793e75842c95f6 100644 (file)
@@ -53,7 +53,7 @@ public class GroupsActionTest {
   DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
 
     System2 system2 = new System2();
@@ -72,7 +72,7 @@ public class GroupsActionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index fa7dfcac2363809df823c41039a298680a636b1c..722f1eaaddf9653c6ffbc0eed1f3bf81580eba10 100644 (file)
@@ -47,7 +47,7 @@ public class SearchActionTest {
   UserIndex index;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     esTester.truncateIndices();
 
     index = new UserIndex(esTester.client());
index 450dd4e2371c33c2bae638894ce39044b34ab96c..a5e893e4a1ff07652aaae02a0c9858f357cb17d9 100644 (file)
@@ -72,7 +72,7 @@ public class UpdateActionTest {
   DbSession session;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     esTester.truncateIndices();
 
@@ -95,7 +95,7 @@ public class UpdateActionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index 38cf64ef5a369a937ebcb680723336b936132d06..99da81b1ae4f1b678e8129bae2df5e14f7ef8557 100644 (file)
@@ -31,7 +31,7 @@ public class UserPropertiesWsTest {
   WsTester tester = new WsTester(new UserPropertiesWs());
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WebService.Controller controller = tester.controller("api/user_properties");
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
index 952d26d1cbc585db6d7ad6feaaa0583df15e2928..78270a6904b2fa293c054b6919bc77806d96753f 100644 (file)
@@ -37,7 +37,7 @@ public class UsersWsTest {
   WebService.Controller controller;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     WsTester tester = new WsTester(new UsersWs(
       new CreateAction(mock(UserIndex.class), mock(UserUpdater.class), mock(I18n.class)),
       new UpdateAction(mock(UserIndex.class), mock(UserUpdater.class)),
@@ -48,7 +48,7 @@ public class UsersWsTest {
   }
 
   @Test
-  public void define_controller() throws Exception {
+  public void define_controller() {
     assertThat(controller).isNotNull();
     assertThat(controller.description()).isNotEmpty();
     assertThat(controller.since()).isEqualTo("3.6");
@@ -56,7 +56,7 @@ public class UsersWsTest {
   }
 
   @Test
-  public void define_search_action() throws Exception {
+  public void define_search_action() {
     WebService.Action action = controller.action("search");
     assertThat(action).isNotNull();
     assertThat(action.isPost()).isFalse();
@@ -66,7 +66,7 @@ public class UsersWsTest {
   }
 
   @Test
-  public void define_create_action() throws Exception {
+  public void define_create_action() {
     WebService.Action action = controller.action("create");
     assertThat(action).isNotNull();
     assertThat(action.isPost()).isTrue();
@@ -74,7 +74,7 @@ public class UsersWsTest {
   }
 
   @Test
-  public void define_update_action() throws Exception {
+  public void define_update_action() {
     WebService.Action action = controller.action("update");
     assertThat(action).isNotNull();
     assertThat(action.isPost()).isTrue();
@@ -82,7 +82,7 @@ public class UsersWsTest {
   }
 
   @Test
-  public void define_change_password_action() throws Exception {
+  public void define_change_password_action() {
     WebService.Action action = controller.action("change_password");
     assertThat(action).isNotNull();
     assertThat(action.isPost()).isTrue();
@@ -90,7 +90,7 @@ public class UsersWsTest {
   }
 
   @Test
-  public void define_deactivate_action() throws Exception {
+  public void define_deactivate_action() {
     WebService.Action action = controller.action("deactivate");
     assertThat(action).isNotNull();
     assertThat(action.isPost()).isTrue();
@@ -98,7 +98,7 @@ public class UsersWsTest {
   }
 
   @Test
-  public void define_current_action() throws Exception {
+  public void define_current_action() {
     WebService.Action action = controller.action("current");
     assertThat(action).isNotNull();
     assertThat(action.isPost()).isFalse();
index e10d437fe0750727b43a67dcf3d89584c3124258..4b0293a6eb042fd3b5d7a4be71fb747922b46dac 100644 (file)
@@ -32,7 +32,7 @@ public class BooleanTypeValidationTest {
   BooleanTypeValidation validation;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     validation = new BooleanTypeValidation();
   }
 
index 672ff885e0224a7c8e614f89b9dbf2e730217b62..4cfb6efb50e19e9fa09937f91184bafb28b5504d 100644 (file)
@@ -29,7 +29,7 @@ import static org.junit.Assert.fail;
 public class CloseableIteratorTest {
 
   @Test
-  public void iterate() throws Exception {
+  public void iterate() {
     SimpleCloseableIterator it = new SimpleCloseableIterator();
     assertThat(it.isClosed).isFalse();
 
@@ -54,7 +54,7 @@ public class CloseableIteratorTest {
   }
 
   @Test
-  public void call_next_without_hasNext() throws Exception {
+  public void call_next_without_hasNext() {
     SimpleCloseableIterator it = new SimpleCloseableIterator();
     assertThat(it.next()).isEqualTo(1);
     assertThat(it.next()).isEqualTo(2);
@@ -67,7 +67,7 @@ public class CloseableIteratorTest {
   }
 
   @Test
-  public void automatic_close_if_traversal_error() throws Exception {
+  public void automatic_close_if_traversal_error() {
     FailureCloseableIterator it = new FailureCloseableIterator();
     try {
       it.next();
@@ -79,7 +79,7 @@ public class CloseableIteratorTest {
   }
 
   @Test
-  public void remove_is_not_supported_by_default() throws Exception {
+  public void remove_is_not_supported_by_default() {
     SimpleCloseableIterator it = new SimpleCloseableIterator();
     try {
       it.remove();
@@ -90,14 +90,14 @@ public class CloseableIteratorTest {
   }
 
   @Test
-  public void remove_can_be_overridden() throws Exception {
+  public void remove_can_be_overridden() {
     RemovableCloseableIterator it = new RemovableCloseableIterator();
     it.remove();
     assertThat(it.isRemoved).isTrue();
   }
 
   @Test
-  public void has_next_should_not_call_do_next_when_already_closed() throws Exception {
+  public void has_next_should_not_call_do_next_when_already_closed() {
     DoNextShouldNotBeCalledWhenClosedIterator it = new DoNextShouldNotBeCalledWhenClosedIterator();
 
     it.next();
index 9b7a28d8859343cf81b83679ac8184dabc3fab16..d822686336a29973811804bf5778f1711c55d4e7 100644 (file)
@@ -29,12 +29,12 @@ public class DateCollectorTest {
   DateCollector collector = new DateCollector();
 
   @Test
-  public void max_is_zero_if_no_dates() throws Exception {
+  public void max_is_zero_if_no_dates() {
     assertThat(collector.getMax()).isEqualTo(0L);
   }
 
   @Test
-  public void max() throws Exception {
+  public void max() {
     collector.add(DateUtils.parseDate("2013-06-01"));
     collector.add(null);
     collector.add(DateUtils.parseDate("2014-01-01"));
index 1863814c48619353f10143aebfdce0242e950f13..29249d80369b6078364f51d5cc8d99396bdf480f 100644 (file)
@@ -32,7 +32,7 @@ public class FloatTypeValidationTest {
   FloatTypeValidation validation;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     validation = new FloatTypeValidation();
   }
 
index 823fae859b1a819380844d1666f6166ec9f10a1a..b4ecdcd87023bd82ce27fb7924bcd523d2c1dd65 100644 (file)
@@ -32,7 +32,7 @@ public class IntegerTypeValidationTest {
   IntegerTypeValidation validation;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     validation = new IntegerTypeValidation();
   }
 
index ec0afe6966b849143e9330dec6f87f12a14bc47e..2ffd1a93d649b284745b77769faf4b370d9b8a8f 100644 (file)
@@ -47,7 +47,7 @@ public class ProgressLoggerTest {
   }
 
   @Test
-  public void create() throws Exception {
+  public void create() {
     ProgressLogger progress = ProgressLogger.create(getClass(), new AtomicLong());
 
     // default values
index 59174852d8cc7b6b88e2b22784532a08c7e48d23..79935062d19fa5b742bac95cb3501c32a5bd15e5 100644 (file)
@@ -66,7 +66,7 @@ public class RubyUtilsTest {
   }
 
   @Test
-  public void toInteger() throws Exception {
+  public void toInteger() {
     assertThat(RubyUtils.toInteger(null)).isNull();
     assertThat(RubyUtils.toInteger("")).isNull();
     assertThat(RubyUtils.toInteger("   ")).isNull();
@@ -76,14 +76,14 @@ public class RubyUtilsTest {
   }
 
   @Test
-  public void toInteger_unexpected_class() throws Exception {
+  public void toInteger_unexpected_class() {
     throwable.expect(IllegalArgumentException.class);
 
     RubyUtils.toInteger(1.2);
   }
 
   @Test
-  public void toDouble() throws Exception {
+  public void toDouble() {
     assertThat(RubyUtils.toDouble(null)).isNull();
     assertThat(RubyUtils.toDouble("")).isNull();
     assertThat(RubyUtils.toDouble("  ")).isNull();
@@ -95,14 +95,14 @@ public class RubyUtilsTest {
   }
 
   @Test
-  public void toDouble_unexpected_class() throws Exception {
+  public void toDouble_unexpected_class() {
     throwable.expect(IllegalArgumentException.class);
 
     RubyUtils.toDouble(true);
   }
 
   @Test
-  public void toBoolean() throws Exception {
+  public void toBoolean() {
     assertThat(RubyUtils.toBoolean(null)).isNull();
     assertThat(RubyUtils.toBoolean("")).isNull();
     assertThat(RubyUtils.toBoolean("  ")).isNull();
@@ -113,14 +113,14 @@ public class RubyUtilsTest {
   }
 
   @Test
-  public void toBoolean_unexpected_class() throws Exception {
+  public void toBoolean_unexpected_class() {
     throwable.expect(IllegalArgumentException.class);
 
     RubyUtils.toBoolean(333);
   }
 
   @Test
-  public void toDate() throws Exception {
+  public void toDate() {
     assertThat(RubyUtils.toDate(null)).isNull();
     assertThat(RubyUtils.toDate("")).isNull();
     assertThat(RubyUtils.toDate("   ")).isNull();
@@ -131,21 +131,21 @@ public class RubyUtilsTest {
   }
 
   @Test
-  public void toDate_bad_format() throws Exception {
+  public void toDate_bad_format() {
     throwable.expect(SonarException.class);
 
     RubyUtils.toDate("01/02/2013");
   }
 
   @Test
-  public void toDate_unexpected_class() throws Exception {
+  public void toDate_unexpected_class() {
     throwable.expect(IllegalArgumentException.class);
 
     RubyUtils.toDate(333);
   }
 
   @Test
-  public void toLong() throws Exception {
+  public void toLong() {
     assertThat(RubyUtils.toLong(null)).isNull();
     assertThat(RubyUtils.toLong(2)).isEqualTo(2L);
     assertThat(RubyUtils.toLong(3L)).isEqualTo(3L);
@@ -153,7 +153,7 @@ public class RubyUtilsTest {
   }
 
   @Test
-  public void toLong_unexpected_class() throws Exception {
+  public void toLong_unexpected_class() {
     throwable.expect(IllegalArgumentException.class);
 
     RubyUtils.toLong(false);
index f6043d19aad4936cac4c33d85e6419eb87564d7e..c2fe1f333b1a4dc37964416d321536996cc3a9d0 100644 (file)
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class SlugTest {
 
   @Test
-  public void slugify() throws Exception {
+  public void slugify() {
     assertThat(Slug.slugify("foo")).isEqualTo("foo");
     assertThat(Slug.slugify("  FOO ")).isEqualTo("foo");
     assertThat(Slug.slugify("he's here")).isEqualTo("he-s-here");
index 95d56d08eb051cf88868939b881738c041ecf596..7d728ebd263f0d08aab15d8541aedb7719b045ab 100644 (file)
@@ -33,7 +33,7 @@ public class StringListTypeValidationTest {
   StringListTypeValidation validation;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     validation = new StringListTypeValidation();
   }
 
index 764603473862c161eb2eb6bbf23e341998da0501..e1a8cabdffb7ef43824f3f3c4f6a73dfbefa7ffd 100644 (file)
@@ -30,7 +30,7 @@ public class StringTypeValidationTest {
   StringTypeValidation validation;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     validation = new StringTypeValidation();
   }
 
index 02ce599aa227b6a7828c938e2b2bd7277c5bc105..d044d166eb50bed1e44d988cbbc57f65e8496bad 100644 (file)
@@ -30,7 +30,7 @@ public class TextTypeValidationTest {
   TextTypeValidation validation;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     validation = new TextTypeValidation();
   }
 
index 36696b0adb831d68541a21935d4b5f9a3e014757..1d6acfec93efe5a76ab3d3420b3d7dba818c3bb2 100644 (file)
@@ -31,7 +31,7 @@ import static org.mockito.Mockito.*;
 public class TypeValidationsTest {
 
   @Test
-  public void validate() throws Exception {
+  public void validate() {
     TypeValidation fakeTypeValidation = mock(TypeValidation.class);
     when(fakeTypeValidation.key()).thenReturn("Fake");
 
@@ -42,7 +42,7 @@ public class TypeValidationsTest {
   }
 
   @Test
-  public void validate__multiple_values() throws Exception {
+  public void validate__multiple_values() {
     TypeValidation fakeTypeValidation = mock(TypeValidation.class);
     when(fakeTypeValidation.key()).thenReturn("Fake");
 
@@ -53,7 +53,7 @@ public class TypeValidationsTest {
   }
 
   @Test
-  public void fail_on_unknown_type() throws Exception {
+  public void fail_on_unknown_type() {
     TypeValidation fakeTypeValidation = mock(TypeValidation.class);
     when(fakeTypeValidation.key()).thenReturn("Fake");
 
index b4160f6b65724849f3717443ff5f250b6e6218c3..86235edf6de00ec5b9c9828f84bf5cec2b83d396 100644 (file)
@@ -66,7 +66,7 @@ public class DiskCacheTest {
   @Test
   public void fail_to_serialize() throws Exception {
     class Unserializable implements Serializable {
-      private void writeObject(ObjectOutputStream out) throws IOException {
+      private void writeObject(ObjectOutputStream out) {
         throw new UnsupportedOperationException("expected error");
       }
     }
index 56559ba59e9dd2584cb83b811c97299e052600b2..54f1f2f09e831d60dbf6c5563611645326c57f8a 100644 (file)
@@ -38,7 +38,7 @@ public class MemoryCacheTest {
   MemoryCache<String, String> cache = new MemoryCache<>(loader);
 
   @Test
-  public void getNullable() throws Exception {
+  public void getNullable() {
     when(loader.load("foo")).thenReturn("bar");
     assertThat(cache.getNullable("foo")).isEqualTo("bar");
     assertThat(cache.getNullable("foo")).isEqualTo("bar");
@@ -54,7 +54,7 @@ public class MemoryCacheTest {
   }
 
   @Test
-  public void get_throws_exception_if_not_exists() throws Exception {
+  public void get_throws_exception_if_not_exists() {
     when(loader.load("foo")).thenReturn("bar");
     assertThat(cache.get("foo")).isEqualTo("bar");
     assertThat(cache.get("foo")).isEqualTo("bar");
@@ -69,7 +69,7 @@ public class MemoryCacheTest {
   }
 
   @Test
-  public void getAllNullable() throws Exception {
+  public void getAllNullable() {
     // ask for 3 keys but only 2 are available in backed (third key is missing)
     List<String> keys = Arrays.asList("one", "two", "three");
     Map<String, String> values = new HashMap<>();
index 9da76180dc8091487c20eae4aa5373b3da22ef3d..4fed312ce2b9c7635bb1b4c077db2b3d4b0e24a2 100644 (file)
@@ -33,7 +33,7 @@ public class ViewIndexDefinitionTest {
   IndexDefinition.IndexDefinitionContext context = new IndexDefinition.IndexDefinitionContext();
 
   @Test
-  public void define() throws Exception {
+  public void define() {
     ViewIndexDefinition def = new ViewIndexDefinition(new Settings());
     def.define(context);
 
@@ -48,7 +48,7 @@ public class ViewIndexDefinitionTest {
   }
 
   @Test
-  public void enable_cluster() throws Exception {
+  public void enable_cluster() {
     Settings settings = new Settings();
     settings.setProperty(ProcessProperties.CLUSTER_ACTIVATE, true);
     ViewIndexDefinition def = new ViewIndexDefinition(settings);
index f92bdc0da7bfb83b31a974fa44809467f855f354..22bf29dc165eeb0a2ae8cc341b02d0f365b1269d 100644 (file)
@@ -54,7 +54,7 @@ public class ViewIndexTest {
   }
 
   @Test
-  public void not_find_all_view_uuids() throws Exception {
+  public void not_find_all_view_uuids() {
     List<String> result = newArrayList(index.findAllViewUuids());
 
     assertThat(result).isEmpty();
index 3f80f02f69585a168553645c75607c088836de75..2fa57a53d62a0e88d887ca8bcddf6d48de67e313 100644 (file)
@@ -70,7 +70,7 @@ public class ViewIndexerMediumTest {
   IssueIndex index;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     tester.clearDbAndIndexes();
     dbSession = tester.get(DbClient.class).openSession(false);
     index = tester.get(IssueIndex.class);
@@ -83,7 +83,7 @@ public class ViewIndexerMediumTest {
   }
 
   @Test
-  public void clear_views_lookup_cache_on_index_view_uuid() throws Exception {
+  public void clear_views_lookup_cache_on_index_view_uuid() {
     String viewUuid = "ABCD";
 
     RuleDto rule = RuleTesting.newXooX1();
index 9656c19994859e1d32c605d6125c74b2d341eafa..21db4db9539d22660aebc57e05d1ef7bdf7f80c3 100644 (file)
@@ -51,7 +51,7 @@ public class ViewIndexerTest {
   ViewIndexer indexer;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
     esTester.truncateIndices();
     indexer = new ViewIndexer(new DbClient(dbTester.database(), dbTester.myBatis(), new ComponentDao()), esTester.client());
@@ -59,13 +59,13 @@ public class ViewIndexerTest {
   }
 
   @Test
-  public void index_nothing() throws Exception {
+  public void index_nothing() {
     indexer.index();
     assertThat(esTester.countDocuments(ViewIndexDefinition.INDEX, ViewIndexDefinition.TYPE_VIEW)).isEqualTo(0L);
   }
 
   @Test
-  public void index() throws Exception {
+  public void index() {
     dbTester.prepareDbUnit(getClass(), "index.xml");
 
     indexer.index();
@@ -100,7 +100,7 @@ public class ViewIndexerTest {
   }
 
   @Test
-  public void index_root_view() throws Exception {
+  public void index_root_view() {
     dbTester.prepareDbUnit(getClass(), "index.xml");
 
     indexer.index("EFGH");
@@ -120,7 +120,7 @@ public class ViewIndexerTest {
   }
 
   @Test
-  public void index_view_doc() throws Exception {
+  public void index_view_doc() {
     indexer.index(new ViewDoc().setUuid("EFGH").setProjects(newArrayList("KLMN", "JKLM")));
 
     List<ViewDoc> docs = esTester.getDocuments("views", "view", ViewDoc.class);
index d4e29d785b72c0ee20d5fde35fcc5e5ba6650b34..04a290e4d2a7c43acdfdf6f5331ebcebfbebc196 100644 (file)
@@ -33,7 +33,7 @@ public class ListingWsTest {
   ListingWs ws = new ListingWs();
 
   @Test
-  public void define_ws() throws Exception {
+  public void define_ws() {
     WsTester tester = new WsTester(ws);
     WebService.Controller controller = tester.controller("api/webservices");
     assertThat(controller).isNotNull();
index c638180c5766ed71b687bc37334800bfad321937..719be0264177c188cb9985b0e83763bbd642288f 100644 (file)
@@ -36,34 +36,34 @@ public class ServletRequestTest {
   HttpServletRequest source = mock(HttpServletRequest.class);
 
   @Test
-  public void call_method() throws Exception {
+  public void call_method() {
     ServletRequest request = new ServletRequest(source, Collections.<String, Object>emptyMap());
     request.method();
     verify(source).getMethod();
   }
 
   @Test
-  public void has_param_from_source() throws Exception {
+  public void has_param_from_source() {
     when(source.getParameterMap()).thenReturn(ImmutableMap.of("param", new String[]{"value"}));
     ServletRequest request = new ServletRequest(source, Collections.<String, Object>emptyMap());
     assertThat(request.hasParam("param")).isTrue();
   }
 
   @Test
-  public void has_param_from_params() throws Exception {
+  public void has_param_from_params() {
     ServletRequest request = new ServletRequest(source, ImmutableMap.<String, Object>of("param", "value"));
     assertThat(request.hasParam("param")).isTrue();
   }
 
   @Test
-  public void read_param_from_source() throws Exception {
+  public void read_param_from_source() {
     when(source.getParameter("param")).thenReturn("value");
     ServletRequest request = new ServletRequest(source, Collections.<String, Object>emptyMap());
     assertThat(request.readParam("param")).isEqualTo("value");
   }
 
   @Test
-  public void read_param_from_param() throws Exception {
+  public void read_param_from_param() {
     ServletRequest request = new ServletRequest(source, ImmutableMap.<String, Object>of("param1", "value", "param2", 1));
     assertThat(request.readParam("param1")).isEqualTo("value");
     assertThat(request.readParam("param2")).isNull();
@@ -71,7 +71,7 @@ public class ServletRequestTest {
   }
 
   @Test
-  public void read_input_stream() throws Exception {
+  public void read_input_stream() {
     RubyFile file = mock(RubyFile.class);
     ServletRequest request = new ServletRequest(source, ImmutableMap.<String, Object>of("param1", file, "param2", "value"));
     request.readInputStreamParam("param1");
@@ -81,7 +81,7 @@ public class ServletRequestTest {
   }
 
   @Test
-  public void to_string() throws Exception {
+  public void to_string() {
     when(source.getRequestURL()).thenReturn(new StringBuffer("http:localhost:9000/api/issues"));
     ServletRequest request = new ServletRequest(source, Collections.<String, Object>emptyMap());
     assertThat(request.toString()).isEqualTo("http:localhost:9000/api/issues");
index 376842ed5da372fc3b6ca365121f55e25174875c..3441a74bf735429f3dcf427251d5377196ae06da 100644 (file)
@@ -107,13 +107,13 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void load_ws_definitions_at_startup() throws Exception {
+  public void load_ws_definitions_at_startup() {
     assertThat(engine.controllers()).hasSize(1);
     assertThat(engine.controllers().get(0).path()).isEqualTo("api/system");
   }
 
   @Test
-  public void execute_request() throws Exception {
+  public void execute_request() {
     ValidatingRequest request = new SimpleRequest("GET");
     ServletResponse response = new ServletResponse();
     engine.execute(request, response, "api/system", "health");
@@ -122,7 +122,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void no_content() throws Exception {
+  public void no_content() {
     ValidatingRequest request = new SimpleRequest("GET");
     ServletResponse response = new ServletResponse();
     engine.execute(request, response, "api/system", "alive");
@@ -131,7 +131,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void bad_controller() throws Exception {
+  public void bad_controller() {
     ValidatingRequest request = new SimpleRequest("GET");
     ServletResponse response = new ServletResponse();
     engine.execute(request, response, "api/xxx", "health");
@@ -140,7 +140,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void bad_action() throws Exception {
+  public void bad_action() {
     ValidatingRequest request = new SimpleRequest("GET");
     ServletResponse response = new ServletResponse();
     engine.execute(request, response, "api/system", "xxx");
@@ -149,7 +149,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void method_get_not_allowed() throws Exception {
+  public void method_get_not_allowed() {
     ValidatingRequest request = new SimpleRequest("GET");
     ServletResponse response = new ServletResponse();
     engine.execute(request, response, "api/system", "ping");
@@ -158,7 +158,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void method_post_required() throws Exception {
+  public void method_post_required() {
     ValidatingRequest request = new SimpleRequest("POST");
     ServletResponse response = new ServletResponse();
     engine.execute(request, response, "api/system", "ping");
@@ -167,7 +167,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void unknown_parameter_is_set() throws Exception {
+  public void unknown_parameter_is_set() {
     ValidatingRequest request = new SimpleRequest("GET").setParam("unknown", "Unknown");
     ServletResponse response = new ServletResponse();
     engine.execute(request, response, "api/system", "fail_with_undeclared_parameter");
@@ -176,7 +176,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void required_parameter_is_not_set() throws Exception {
+  public void required_parameter_is_not_set() {
     ValidatingRequest request = new SimpleRequest("GET");
     ServletResponse response = new ServletResponse();
     engine.execute(request, response, "api/system", "print");
@@ -185,7 +185,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void optional_parameter_is_not_set() throws Exception {
+  public void optional_parameter_is_not_set() {
     ValidatingRequest request = new SimpleRequest("GET").setParam("message", "Hello World");
     ServletResponse response = new ServletResponse();
     engine.execute(request, response, "api/system", "print");
@@ -194,7 +194,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void optional_parameter_is_set() throws Exception {
+  public void optional_parameter_is_set() {
     ValidatingRequest request = new SimpleRequest("GET")
       .setParam("message", "Hello World")
       .setParam("author", "Marcel");
@@ -205,7 +205,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void param_value_is_in_possible_values() throws Exception {
+  public void param_value_is_in_possible_values() {
     ValidatingRequest request = new SimpleRequest("GET")
       .setParam("message", "Hello World")
       .setParam("format", "json");
@@ -216,7 +216,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void param_value_is_not_in_possible_values() throws Exception {
+  public void param_value_is_not_in_possible_values() {
     ValidatingRequest request = new SimpleRequest("GET")
       .setParam("message", "Hello World")
       .setParam("format", "html");
@@ -227,7 +227,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void internal_error() throws Exception {
+  public void internal_error() {
     ValidatingRequest request = new SimpleRequest("GET");
     ServletResponse response = new ServletResponse();
     engine.execute(request, response, "api/system", "fail");
@@ -238,7 +238,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void bad_request_with_i18n_message() throws Exception {
+  public void bad_request_with_i18n_message() {
     MockUserSession.set().setLocale(Locale.ENGLISH);
     ValidatingRequest request = new SimpleRequest("GET").setParam("count", "3");
     ServletResponse response = new ServletResponse();
@@ -254,7 +254,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void bad_request_with_multiple_messages() throws Exception {
+  public void bad_request_with_multiple_messages() {
     ValidatingRequest request = new SimpleRequest("GET").setParam("count", "3");
     ServletResponse response = new ServletResponse();
 
@@ -270,7 +270,7 @@ public class WebServiceEngineTest {
   }
 
   @Test
-  public void bad_request_with_multiple_i18n_messages() throws Exception {
+  public void bad_request_with_multiple_i18n_messages() {
     MockUserSession.set().setLocale(Locale.ENGLISH);
 
     ValidatingRequest request = new SimpleRequest("GET").setParam("count", "3");
index 63889f42730a4ebad8024c3b3d8e95bcfcefe19a..7c1ed06d2378665ce2324c93f3281b6f6bee0cec 100644 (file)
@@ -111,7 +111,7 @@ public class SonarClientTest {
   }
 
   @Test
-  public void get() throws Exception {
+  public void get() {
     HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
     SonarClient client = new SonarClient(requestFactory);
 
@@ -126,7 +126,7 @@ public class SonarClientTest {
   }
 
   @Test
-  public void post() throws Exception {
+  public void post() {
     HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
     SonarClient client = new SonarClient(requestFactory);
 
@@ -140,7 +140,7 @@ public class SonarClientTest {
   }
 
   @Test
-  public void fail_if_odd_number_arguments() throws Exception {
+  public void fail_if_odd_number_arguments() {
     HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
     SonarClient client = new SonarClient(requestFactory);
 
@@ -153,7 +153,7 @@ public class SonarClientTest {
   }
 
   @Test
-  public void fail_if_null_property_key() throws Exception {
+  public void fail_if_null_property_key() {
     HttpRequestFactory requestFactory = mock(HttpRequestFactory.class);
     SonarClient client = new SonarClient(requestFactory);
 
index c1ff002fa00dcb592136c82ecf1449f116cfa026..930b24569fe1499987cb4e491931700fee12024c 100644 (file)
@@ -98,7 +98,7 @@ public class SonarTest {
   }
 
   @Test(expected = ConnectionException.class)
-  public void failWhenConnectionIsClosed() throws Exception {
+  public void failWhenConnectionIsClosed() {
     Sonar fakeSonar = Sonar.create("http://localhost:70");
     fakeSonar.findAll(MetricQuery.all());
   }
index 0e790b07650d9666b28f09c6f7d8fcc95751ca77..54bd54782bcdce9e8eb8540ac61de51d7f9d6056 100644 (file)
@@ -123,7 +123,7 @@ public class HttpRequestFactoryTest {
   }
 
   @Test
-  public void beginning_slash_is_optional() throws Exception {
+  public void beginning_slash_is_optional() {
     HttpRequestFactory factory = new HttpRequestFactory(httpServer.url());
     factory.get("api/foo", Collections.<String, Object>emptyMap());
     assertThat(httpServer.requestedPath()).isEqualTo("/api/foo");
index 9621c9878fc826390d43f880046f3001a5ba49ad..8cb916be1fc8d3b87b0aaa973c5ae6bfed1b8aa3 100644 (file)
@@ -79,7 +79,7 @@ public class DefaultActionPlanClientTest {
   }
 
   @Test
-  public void should_create_action_plan() throws Exception {
+  public void should_create_action_plan() {
     HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
     httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");
 
index 79c869e5c25f753d3aa7f3f458908cb8c7f4cdc6..5cc232195045fe656dfd2509df9a80cfc8bf7037 100644 (file)
@@ -61,7 +61,7 @@ public class DefaultSystemClientTest {
   }
 
   @Test
-  public void fail_if_rate_is_greater_than_timeout() throws Exception {
+  public void fail_if_rate_is_greater_than_timeout() {
     try {
       DefaultSystemClient client = new DefaultSystemClient(mock(HttpRequestFactory.class));
       client.migrate(5L, 50L);
index 17592ec2909eef5e6ad55129538995af49cca2b2..7fb56905784b2fde1dff4677ea8ac97de31ee6ad 100644 (file)
@@ -32,7 +32,7 @@ import static org.junit.Assert.assertThat;
 public class PluginUnmarshallerTest extends UnmarshallerTestCase {
 
   @Test
-  public void toModel() throws Exception {
+  public void toModel() {
     WSUtils.setInstance(new JdkUtils());
 
     List<Plugin> plugins = new PluginUnmarshaller().toModels(loadFile("/plugins/plugins.json"));
index 60d1f1223e69feb9b431796b844b9e0a37af4d51..965d27217bc69fc88754f3c624e1c07f0deed5f8 100644 (file)
@@ -52,7 +52,7 @@ public class TimeMachineUnmarshallerTest extends UnmarshallerTestCase {
   }
 
   @Test
-  public void should_accept_null_values() throws Exception {
+  public void should_accept_null_values() {
     TimeMachine timeMachine = new TimeMachineUnmarshaller().toModel(loadFile("/timemachine/null-values.json"));
 
     assertThat(timeMachine.getCells()[0].getValues().length).isEqualTo(2);
@@ -64,7 +64,7 @@ public class TimeMachineUnmarshallerTest extends UnmarshallerTestCase {
   }
 
   @Test
-  public void should_cast_values() throws Exception {
+  public void should_cast_values() {
     TimeMachine timeMachine = new TimeMachineUnmarshaller().toModel(loadFile("/timemachine/typed-values.json"));
 
     assertThat(timeMachine.getCells()[0].getValues().length).isEqualTo(2);
index e59927c5dde885d30f682cb521b1c49bdc8d96dc..d521d115053f0be5758619caa79bac83b676b29f 100644 (file)
@@ -63,7 +63,7 @@ public class DefaultUserClientTest {
   }
 
   @Test
-  public void should_create_user() throws Exception {
+  public void should_create_user() {
     httpServer.stubResponseBody("{\"user\":{\"login\":\"daveloper\",\"name\":\"daveloper\",\"email\":null}}");
 
     UserParameters params = UserParameters.create().login("daveloper").password("pass1").passwordConfirmation("pass1");
@@ -82,7 +82,7 @@ public class DefaultUserClientTest {
   }
 
   @Test
-  public void should_update_user() throws Exception {
+  public void should_update_user() {
     httpServer.stubResponseBody("{\"user\":{\"login\":\"daveloper\",\"name\":\"daveloper\",\"email\":\"new_email\"}}");
 
     UserParameters params = UserParameters.create().login("daveloper").email("new_email");
@@ -100,7 +100,7 @@ public class DefaultUserClientTest {
   }
 
   @Test
-  public void should_deactivate_user() throws Exception {
+  public void should_deactivate_user() {
     httpServer.stubStatusCode(200);
 
     client.deactivate("daveloper");
index 20f4b9893d4eec75bddfaa192c42825318302891..5cad47114ef792cbc04275e51c0f107f474a3ec3 100644 (file)
@@ -44,13 +44,13 @@ public class UserQueryTest {
   }
 
   @Test
-  public void should_replace_logins() throws Exception {
+  public void should_replace_logins() {
     UserQuery query = UserQuery.create().logins("simon").logins("loic");
     assertThat(query.urlParams().get("logins")).isEqualTo("loic");
   }
 
   @Test
-  public void should_search_by_text() throws Exception {
+  public void should_search_by_text() {
     UserQuery query = UserQuery.create().searchText("sim");
     assertThat(query.urlParams().get("s")).isEqualTo("sim");
 
index fc187f3e4a4db5e50d352a91c35ef5b7243657e5..4bc159a7af06aea03c9312a167ee1b6ccf0a7114 100644 (file)
@@ -59,7 +59,7 @@ public class AppLoggingTest {
   }
 
   @Test
-  public void configure_defaults() throws Exception {
+  public void configure_defaults() {
     LoggerContext ctx = sut.configure(props);
 
     Logger gobbler = ctx.getLogger(AppLogging.GOBBLER_LOGGER);
@@ -72,7 +72,7 @@ public class AppLoggingTest {
   }
 
   @Test
-  public void configure_no_rotation() throws Exception {
+  public void configure_no_rotation() {
     props.set("sonar.log.rollingPolicy", "none");
 
     LoggerContext ctx = sut.configure(props);
@@ -83,7 +83,7 @@ public class AppLoggingTest {
   }
 
   @Test
-  public void copyGobblerToConsole() throws Exception {
+  public void copyGobblerToConsole() {
     props.set("sonar.log.console", "true");
 
     LoggerContext ctx = sut.configure(props);
index fa57d8d353d8cc477bae047fcadd3c8e579c232d..e2320b7eeda24fb4b64de1c18ad95428351615d2 100644 (file)
@@ -31,7 +31,7 @@ public class CommandLineParserTest {
   CommandLineParser parser = new CommandLineParser();
 
   @Test
-  public void parseArguments() throws Exception {
+  public void parseArguments() {
     System.setProperty("CommandLineParserTest.unused", "unused");
     System.setProperty("sonar.CommandLineParserTest.used", "used");
 
@@ -46,7 +46,7 @@ public class CommandLineParserTest {
   }
 
   @Test
-  public void argumentsToProperties() throws Exception {
+  public void argumentsToProperties() {
     Properties p = parser.argumentsToProperties(new String[] {"-Dsonar.foo=bar", "-Dsonar.whitespace=foo bar"});
     assertThat(p).hasSize(2);
     assertThat(p.getProperty("sonar.foo")).isEqualTo("bar");
index d6d575bfad1cf2ecf7354ae79a4e23a562041175..9e809a2aeab28c225f4580c79690a20d2ccc6fe1 100644 (file)
@@ -41,7 +41,7 @@ public class JdbcSettingsTest {
   JdbcSettings settings = new JdbcSettings();
 
   @Test
-  public void driver_provider() throws Exception {
+  public void driver_provider() {
     assertThat(settings.driverProvider("jdbc:oracle:thin:@localhost/XE")).isEqualTo(JdbcSettings.Provider.ORACLE);
     assertThat(settings.driverProvider("jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance"))
       .isEqualTo(JdbcSettings.Provider.MYSQL);
@@ -60,7 +60,7 @@ public class JdbcSettingsTest {
   }
 
   @Test
-  public void check_mysql_parameters() throws Exception {
+  public void check_mysql_parameters() {
     // minimal -> ok
     settings.checkUrlParameters(JdbcSettings.Provider.MYSQL,
       "jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8");
index 8084bb2d94787b536a3316823b35164fa1935502..e9e57cf74dd9963dbf985d82b28ee58ab68982ef 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ProtobufUtilTest {
 
   @Test
-  public void only_utils() throws Exception {
+  public void only_utils() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(ProtobufUtil.class));
   }
 
index fb7c5d46fb038cabca782374248cf1df6434a685..cda3a633e1a2e1b5a4f423b2671bb267d1285b69 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class GlobalRepositoriesTest {
 
   @Test
-  public void to_json() throws Exception {
+  public void to_json() {
     GlobalRepositories ref = new GlobalRepositories();
     ref.addMetric(new Metric(1, "ncloc", "INT", "Description", -1, "NCLOC", true, false, 2.0, 1.0, true));
     ref.addGlobalSetting("prop", "value");
index 223e997950eec68b49b61a1d17d986e76ce42b69..e01cc0d606c2f9932538845a073eb7702a369173 100644 (file)
@@ -51,7 +51,7 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void read_metadata() throws Exception {
+  public void read_metadata() {
     BatchReportWriter writer = new BatchReportWriter(dir);
     BatchReport.Metadata.Builder metadata = BatchReport.Metadata.newBuilder()
       .setAnalysisDate(15000000L)
@@ -68,12 +68,12 @@ public class BatchReportReaderTest {
   }
 
   @Test(expected = IllegalStateException.class)
-  public void fail_if_missing_metadata_file() throws Exception {
+  public void fail_if_missing_metadata_file() {
     sut.readMetadata();
   }
 
   @Test
-  public void read_components() throws Exception {
+  public void read_components() {
     BatchReportWriter writer = new BatchReportWriter(dir);
     BatchReport.Component.Builder component = BatchReport.Component.newBuilder()
       .setRef(1)
@@ -84,12 +84,12 @@ public class BatchReportReaderTest {
   }
 
   @Test(expected = IllegalStateException.class)
-  public void fail_if_missing_file_on_component() throws Exception {
+  public void fail_if_missing_file_on_component() {
     sut.readComponent(UNKNOWN_COMPONENT_REF);
   }
 
   @Test
-  public void read_issues() throws Exception {
+  public void read_issues() {
     BatchReportWriter writer = new BatchReportWriter(dir);
     BatchReport.Issue issue = BatchReport.Issue.newBuilder()
       .setUuid("ISSUE_A")
@@ -107,17 +107,17 @@ public class BatchReportReaderTest {
   }
 
   @Test(expected = IllegalStateException.class)
-  public void fail_if_missing_file_on_deleted_component() throws Exception {
+  public void fail_if_missing_file_on_deleted_component() {
     sut.readDeletedComponentIssues(UNKNOWN_COMPONENT_REF);
   }
 
   @Test
-  public void empty_list_if_no_issue_found() throws Exception {
+  public void empty_list_if_no_issue_found() {
     assertThat(sut.readComponentIssues(UNKNOWN_COMPONENT_REF)).isEmpty();
   }
 
   @Test
-  public void read_measures() throws Exception {
+  public void read_measures() {
     BatchReportWriter writer = new BatchReportWriter(dir);
     BatchReport.Measure.Builder measure = BatchReport.Measure.newBuilder()
       .setStringValue("value_a");
@@ -128,12 +128,12 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void empty_list_if_no_measure_found() throws Exception {
+  public void empty_list_if_no_measure_found() {
     assertThat(sut.readComponentMeasures(UNKNOWN_COMPONENT_REF)).isEmpty();
   }
 
   @Test
-  public void read_changesets() throws Exception {
+  public void read_changesets() {
     BatchReportWriter writer = new BatchReportWriter(dir);
     BatchReport.Changesets.Builder scm = BatchReport.Changesets.newBuilder()
       .setComponentRef(1)
@@ -145,12 +145,12 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void null_if_no_changeset_found() throws Exception {
+  public void null_if_no_changeset_found() {
     assertThat(sut.readChangesets(UNKNOWN_COMPONENT_REF)).isNull();
   }
 
   @Test
-  public void read_duplications() throws Exception {
+  public void read_duplications() {
     BatchReportWriter writer = new BatchReportWriter(dir);
     writer.writeMetadata(BatchReport.Metadata.newBuilder()
       .setRootComponentRef(1).build());
@@ -180,7 +180,7 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void empty_list_if_no_duplication_found() throws Exception {
+  public void empty_list_if_no_duplication_found() {
     assertThat(sut.readComponentDuplications(UNKNOWN_COMPONENT_REF)).isEmpty();
   }
 
@@ -213,12 +213,12 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void return_null_if_no_highlighting_found() throws Exception {
+  public void return_null_if_no_highlighting_found() {
     assertThat(sut.readComponentSyntaxHighlighting(UNKNOWN_COMPONENT_REF)).isNull();
   }
 
   @Test
-  public void read_symbols() throws Exception {
+  public void read_symbols() {
     BatchReportWriter writer = new BatchReportWriter(dir);
     writer.writeMetadata(BatchReport.Metadata.newBuilder()
       .setRootComponentRef(1)
@@ -248,7 +248,7 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void empty_list_if_no_symbol_found() throws Exception {
+  public void empty_list_if_no_symbol_found() {
     assertThat(sut.readComponentSymbols(UNKNOWN_COMPONENT_REF)).isEmpty();
   }
 
@@ -305,7 +305,7 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void return_null_if_no_coverage_found() throws Exception {
+  public void return_null_if_no_coverage_found() {
     assertThat(sut.readComponentCoverage(UNKNOWN_COMPONENT_REF)).isNull();
   }
 
@@ -340,7 +340,7 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void null_if_no_test_found() throws Exception {
+  public void null_if_no_test_found() {
     assertThat(sut.readTests(UNKNOWN_COMPONENT_REF)).isNull();
   }
 
@@ -366,7 +366,7 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void null_if_no_coverage_detail_found() throws Exception {
+  public void null_if_no_coverage_detail_found() {
     assertThat(sut.readCoverageDetails(UNKNOWN_COMPONENT_REF)).isNull();
   }
 
@@ -388,12 +388,12 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void null_if_no_file_dependencies_found() throws Exception {
+  public void null_if_no_file_dependencies_found() {
     assertThat(sut.readFileDependencies(UNKNOWN_COMPONENT_REF)).isNull();
   }
 
   @Test
-  public void read_module_dependencies() throws Exception {
+  public void read_module_dependencies() {
     BatchReportWriter writer = new BatchReportWriter(dir);
     writer.writeModuleDependencies(1, Arrays.asList(BatchReport.ModuleDependencies.ModuleDependency.newBuilder()
       .setKey("PROJECT_1")
@@ -415,7 +415,7 @@ public class BatchReportReaderTest {
   }
 
   @Test
-  public void empty_list_if_no_module_dependencies_found() throws Exception {
+  public void empty_list_if_no_module_dependencies_found() {
     assertThat(sut.readModuleDependencies(UNKNOWN_COMPONENT_REF)).isEmpty();
   }
 
index 470fe2fc99ae7ce2b00bbf51b297e24bb68d7644..b1d0b677efbdfcac14cbee7067ccd0c37be3dad6 100644 (file)
@@ -47,7 +47,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void create_dir_if_does_not_exist() throws Exception {
+  public void create_dir_if_does_not_exist() {
     FileUtils.deleteQuietly(dir);
     sut = new BatchReportWriter(dir);
 
@@ -55,7 +55,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_metadata() throws Exception {
+  public void write_metadata() {
     BatchReport.Metadata.Builder metadata = BatchReport.Metadata.newBuilder()
       .setAnalysisDate(15000000L)
       .setProjectKey("PROJECT_A")
@@ -69,7 +69,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_component() throws Exception {
+  public void write_component() {
     // no data yet
     assertThat(sut.hasComponentData(FileStructure.Domain.COMPONENT, 1)).isFalse();
 
@@ -97,7 +97,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_issues() throws Exception {
+  public void write_issues() {
     // no data yet
     assertThat(sut.hasComponentData(FileStructure.Domain.ISSUES, 1)).isFalse();
 
@@ -120,7 +120,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_issues_of_deleted_component() throws Exception {
+  public void write_issues_of_deleted_component() {
     // no data yet
     assertThat(sut.hasComponentData(FileStructure.Domain.ISSUES_ON_DELETED, 1)).isFalse();
 
@@ -143,7 +143,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_measures() throws Exception {
+  public void write_measures() {
     assertThat(sut.hasComponentData(FileStructure.Domain.MEASURES, 1)).isFalse();
 
     BatchReport.Measure measure = BatchReport.Measure.newBuilder()
@@ -168,7 +168,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_scm() throws Exception {
+  public void write_scm() {
     assertThat(sut.hasComponentData(FileStructure.Domain.CHANGESETS, 1)).isFalse();
 
     BatchReport.Changesets scm = BatchReport.Changesets.newBuilder()
@@ -193,7 +193,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_duplications() throws Exception {
+  public void write_duplications() {
     assertThat(sut.hasComponentData(FileStructure.Domain.DUPLICATIONS, 1)).isFalse();
 
     BatchReport.Duplication duplication = BatchReport.Duplication.newBuilder()
@@ -223,7 +223,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_symbols() throws Exception {
+  public void write_symbols() {
     // no data yet
     assertThat(sut.hasComponentData(FileStructure.Domain.SYMBOLS, 1)).isFalse();
 
@@ -257,7 +257,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_syntax_highlighting() throws Exception {
+  public void write_syntax_highlighting() {
     // no data yet
     assertThat(sut.hasComponentData(FileStructure.Domain.SYNTAX_HIGHLIGHTINGS, 1)).isFalse();
 
@@ -275,7 +275,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_coverage() throws Exception {
+  public void write_coverage() {
     // no data yet
     assertThat(sut.hasComponentData(FileStructure.Domain.COVERAGES, 1)).isFalse();
 
@@ -295,7 +295,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_tests() throws Exception {
+  public void write_tests() {
     assertThat(sut.hasComponentData(FileStructure.Domain.TESTS, 1)).isFalse();
 
     sut.writeTests(1, Arrays.asList(
@@ -307,7 +307,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_coverage_details() throws Exception {
+  public void write_coverage_details() {
     assertThat(sut.hasComponentData(FileStructure.Domain.COVERAGE_DETAILS, 1)).isFalse();
 
     sut.writeCoverageDetails(1, Arrays.asList(
@@ -318,7 +318,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_file_dependencies() throws Exception {
+  public void write_file_dependencies() {
     assertThat(sut.hasComponentData(FileStructure.Domain.FILE_DEPENDENCIES, 1)).isFalse();
 
     sut.writeFileDependencies(1, Arrays.asList(BatchReport.FileDependency.getDefaultInstance()));
@@ -327,7 +327,7 @@ public class BatchReportWriterTest {
   }
 
   @Test
-  public void write_module_dependencies() throws Exception {
+  public void write_module_dependencies() {
     assertThat(sut.hasComponentData(FileStructure.Domain.MODULE_DEPENDENCIES, 1)).isFalse();
 
     sut.writeModuleDependencies(1, Arrays.asList(BatchReport.ModuleDependencies.ModuleDependency.getDefaultInstance()));
index 86a866c271e435b343d23a66bd7d38741a9bd3be..2062e10f6b05d7307a580dd1bfdc0c7ff6d79f72 100644 (file)
@@ -40,7 +40,7 @@ public class ProjectConfiguratorTest extends AbstractDbUnitTestCase {
   System2 system2;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     system2 = mock(System2.class);
   }
 
index 97402b8a913de124d0f506cbd136ef45ab28c0a5..e0ea0d6a4407567aff42de1f41cd7e2fec27478c 100644 (file)
@@ -85,7 +85,7 @@ public class DatabaseCompatibilityTest {
   }
 
   @Test
-  public void shouldFailIfNotSameServerId() throws Exception {
+  public void shouldFailIfNotSameServerId() {
     when(propertiesDao.selectGlobalProperty(CoreProperties.SERVER_ID)).thenReturn(new PropertyDto().setValue("11111111"));
 
     thrown.expect(MessageException.class);
@@ -97,7 +97,7 @@ public class DatabaseCompatibilityTest {
   }
 
   @Test
-  public void shouldUseDefaultUserNameWhenFaillingIfNotSameServerIdAndNoUserNameFound() throws Exception {
+  public void shouldUseDefaultUserNameWhenFaillingIfNotSameServerIdAndNoUserNameFound() {
     when(propertiesDao.selectGlobalProperty(CoreProperties.SERVER_ID)).thenReturn(new PropertyDto().setValue("11111111"));
 
     settings.removeProperty(DatabaseProperties.PROP_USER);
@@ -109,7 +109,7 @@ public class DatabaseCompatibilityTest {
   }
 
   @Test
-  public void shouldFailIfCantGetServerId() throws Exception {
+  public void shouldFailIfCantGetServerId() {
     when(server.request("/api/server")).thenThrow(new IllegalStateException());
 
     thrown.expect(IllegalStateException.class);
index f03d16bbd327eb23792e2157b8564d2181b7b13a..57e940ab7aea8de72c8bb0c7ae4ca67188df7dbe 100644 (file)
@@ -77,7 +77,7 @@ public class DefaultPluginsRepositoryTest {
   }
 
   @Test
-  public void should_fail_to_get_plugin_index() throws Exception {
+  public void should_fail_to_get_plugin_index() {
     thrown.expect(IllegalStateException.class);
 
     ServerClient server = mock(ServerClient.class);
index c6bc80c9862a8c7d9fbe7f9c1f16628c994ffee7..0647b0e22ec32fa53b71b510f49326e8f5eb66a0 100644 (file)
@@ -58,7 +58,7 @@ public class ExtensionInstallerTest {
   }
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     mode = mock(DefaultAnalysisMode.class);
   }
 
index a5040b47f3568c28cbccbd33bbc76bd5179097be..e1e31dce2ad7d3d0fe056b8b48e3e747324bf820 100644 (file)
@@ -58,7 +58,7 @@ public class JdbcDriverHolderTest {
   }
 
   @Test
-  public void extend_classloader_with_jdbc_driver() throws Exception {
+  public void extend_classloader_with_jdbc_driver() {
     FileCache cache = mock(FileCache.class);
 
     File fakeDriver = new File(Resources.getResource(JdbcDriverHolderTest.class, "JdbcDriverHolderTest/jdbc-driver.jar").getFile());
@@ -84,7 +84,7 @@ public class JdbcDriverHolderTest {
   }
 
   @Test
-  public void do_nothing_when_jdbc_driver_file_is_empty() throws Exception {
+  public void do_nothing_when_jdbc_driver_file_is_empty() {
     FileCache cache = mock(FileCache.class);
 
     ServerClient server = mock(ServerClient.class);
index 1034c0209571333bca82a59cba19822715aaf5cf..2e13a5a9481f4c69ffe33d2b2f5fa9bd7cf055c6 100644 (file)
@@ -64,7 +64,7 @@ public class ServerClientTest {
   }
 
   @Test
-  public void should_remove_url_ending_slash() throws Exception {
+  public void should_remove_url_ending_slash() {
     BootstrapProperties settings = mock(BootstrapProperties.class);
     when(settings.property("sonar.host.url")).thenReturn("http://localhost:8080/sonar/");
 
index f712b04dbc4bbbe4038e768284ae69025e87311e..be6c4ab057c257bbce738bc9b150a92d9b4c0f0c 100644 (file)
@@ -151,7 +151,7 @@ public class PastSnapshotFinderTest {
   }
 
   @Test
-  public void should_find_by_previous_analysis() throws ParseException {
+  public void should_find_by_previous_analysis() {
     final Date date = DateUtils.parseDate("2010-05-18");
     Snapshot snapshot = new Snapshot();
     snapshot.setCreatedAtMs(date.getTime());
index 7cb4b47c1c58f4c562adf490fa8106f6bf532036..5ce426696d5eb11d7850fb1df57d564e08d6f69e 100644 (file)
@@ -104,7 +104,7 @@ public class DebtDecoratorTest {
   DebtDecorator decorator;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     when(perspectives.as(Issuable.class, resource)).thenReturn(issuable);
     RulesBuilder rulesBuilder = new RulesBuilder();
     rulesBuilder.add(ruleKey1).setName("rule1").setDebtSubCharacteristic("MEMORY_EFFICIENCY");
@@ -124,12 +124,12 @@ public class DebtDecoratorTest {
   }
 
   @Test
-  public void generates_metrics() throws Exception {
+  public void generates_metrics() {
     assertThat(decorator.generatesMetrics()).hasSize(1);
   }
 
   @Test
-  public void execute_on_project() throws Exception {
+  public void execute_on_project() {
     assertThat(decorator.shouldExecuteOnProject(null)).isTrue();
   }
 
@@ -143,7 +143,7 @@ public class DebtDecoratorTest {
   }
 
   @Test
-  public void add_technical_debt_from_one_issue_and_no_parent() throws Exception {
+  public void add_technical_debt_from_one_issue_and_no_parent() {
     Issue issue = createIssue("rule1", "repo1").setDebt(Duration.create(ONE_DAY_IN_MINUTES));
     when(issuable.issues()).thenReturn(newArrayList(issue));
 
@@ -154,7 +154,7 @@ public class DebtDecoratorTest {
   }
 
   @Test
-  public void add_technical_debt_from_one_issue_without_debt() throws Exception {
+  public void add_technical_debt_from_one_issue_without_debt() {
     Issue issue = createIssue("rule1", "repo1").setDebt(null);
     when(issuable.issues()).thenReturn(newArrayList(issue));
 
@@ -164,7 +164,7 @@ public class DebtDecoratorTest {
   }
 
   @Test
-  public void add_technical_debt_from_one_issue_and_propagate_to_parents() throws Exception {
+  public void add_technical_debt_from_one_issue_and_propagate_to_parents() {
     Issue issue = createIssue("rule1", "repo1").setDebt(Duration.create(ONE_DAY_IN_MINUTES));
     when(issuable.issues()).thenReturn(newArrayList(issue));
 
@@ -177,7 +177,7 @@ public class DebtDecoratorTest {
   }
 
   @Test
-  public void add_technical_debt_from_issues() throws Exception {
+  public void add_technical_debt_from_issues() {
     Long technicalDebt1 = ONE_DAY_IN_MINUTES;
     Long technicalDebt2 = 2 * ONE_DAY_IN_MINUTES;
 
@@ -195,7 +195,7 @@ public class DebtDecoratorTest {
   }
 
   @Test
-  public void add_technical_debt_from_current_and_children_measures() throws Exception {
+  public void add_technical_debt_from_current_and_children_measures() {
     Issue issue1 = createIssue("rule1", "repo1").setDebt(Duration.create(ONE_DAY_IN_MINUTES));
     Issue issue2 = createIssue("rule1", "repo1").setDebt(Duration.create(ONE_DAY_IN_MINUTES));
     when(issuable.issues()).thenReturn(newArrayList(issue1, issue2));
@@ -214,7 +214,7 @@ public class DebtDecoratorTest {
   }
 
   @Test
-  public void add_technical_debt_only_from_children_measures() throws Exception {
+  public void add_technical_debt_only_from_children_measures() {
     when(issuable.issues()).thenReturn(Collections.<Issue>emptyList());
 
     when(context.getChildrenMeasures(any(MeasuresFilter.class))).thenReturn(Lists.<Measure>newArrayList(
@@ -238,7 +238,7 @@ public class DebtDecoratorTest {
   }
 
   @Test
-  public void always_save_technical_debt_for_positive_values() throws Exception {
+  public void always_save_technical_debt_for_positive_values() {
     // for a project
     DecoratorContext context = mock(DecoratorContext.class);
     when(context.getResource()).thenReturn(new Project("foo"));
@@ -253,7 +253,7 @@ public class DebtDecoratorTest {
   }
 
   @Test
-  public void always_save_technical_debt_for_project_if_top_characteristic() throws Exception {
+  public void always_save_technical_debt_for_project_if_top_characteristic() {
     DecoratorContext context = mock(DecoratorContext.class);
     when(context.getResource()).thenReturn(new Project("foo"));
 
@@ -268,7 +268,7 @@ public class DebtDecoratorTest {
    * SQALE-147
    */
   @Test
-  public void never_save_technical_debt_for_project_if_not_top_characteristic() throws Exception {
+  public void never_save_technical_debt_for_project_if_not_top_characteristic() {
     DecoratorContext context = mock(DecoratorContext.class);
     when(context.getResource()).thenReturn(new Project("foo"));
 
@@ -280,7 +280,7 @@ public class DebtDecoratorTest {
   }
 
   @Test
-  public void not_save_technical_debt_for_file_if_zero() throws Exception {
+  public void not_save_technical_debt_for_file_if_zero() {
     DecoratorContext context = mock(DecoratorContext.class);
     when(context.getResource()).thenReturn(File.create("foo"));
 
index f233dc79bef0700ab6bbb9b2409a278c157911ed..1d434d5d2e5c310e638951c1d8386b81e31b1799 100644 (file)
@@ -48,7 +48,7 @@ public class DebtModelProviderTest {
   }
 
   @Test
-  public void provide_model() throws Exception {
+  public void provide_model() {
     CharacteristicDto rootCharacteristicDto = new CharacteristicDto()
       .setId(1)
       .setKey("MEMORY_EFFICIENCY")
index ab0e14b93a99a4adef0c852cca8eaede1f6ca86e..952075dec78a40876000f2dbba0d332871d0e41a 100644 (file)
@@ -55,12 +55,12 @@ public class IssueChangelogDebtCalculatorTest {
   Duration fiveDaysDebt = Duration.create(fiveDays);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     issueChangelogDebtCalculator = new IssueChangelogDebtCalculator();
   }
 
   @Test
-  public void calculate_new_technical_debt_with_one_diff_in_changelog() throws Exception {
+  public void calculate_new_technical_debt_with_one_diff_in_changelog() {
     Issue issue = new DefaultIssue().setKey("A").setCreationDate(tenDaysAgo).setDebt(twoDaysDebt).setChanges(
       newArrayList(
         // changelog created at is null because it has just been created on the current analysis
@@ -75,7 +75,7 @@ public class IssueChangelogDebtCalculatorTest {
   }
 
   @Test
-  public void calculate_new_technical_debt_with_many_diffs_in_changelog() throws Exception {
+  public void calculate_new_technical_debt_with_many_diffs_in_changelog() {
     Issue issue = new DefaultIssue().setKey("A").setCreationDate(tenDaysAgo).setDebt(fiveDaysDebt).setChanges(
       newArrayList(
         new FieldDiffs().setDiff("technicalDebt", twoDays, fiveDays).setCreationDate(null),
@@ -106,7 +106,7 @@ public class IssueChangelogDebtCalculatorTest {
   }
 
   @Test
-  public void calculate_new_technical_debt_with_null_date() throws Exception {
+  public void calculate_new_technical_debt_with_null_date() {
     Issue issue = new DefaultIssue().setKey("A").setCreationDate(tenDaysAgo).setDebt(twoDaysDebt).setChanges(
       newArrayList(
         new FieldDiffs().setDiff("technicalDebt", oneDay, twoDays).setCreationDate(null)
@@ -117,7 +117,7 @@ public class IssueChangelogDebtCalculatorTest {
   }
 
   @Test
-  public void calculate_new_technical_debt_when_new_debt_is_null() throws Exception {
+  public void calculate_new_technical_debt_when_new_debt_is_null() {
     Issue issue = new DefaultIssue().setKey("A").setCreationDate(tenDaysAgo).setDebt(null).setChanges(
       newArrayList(
         new FieldDiffs().setDiff("technicalDebt", oneDay, null).setCreationDate(null),
index fa7b4f9c4cbd29e6029f523bffb2fbf452c5d9f4..b5851c0884ff2982d6b80b8be09e6eb6db474509 100644 (file)
@@ -106,12 +106,12 @@ public class NewDebtDecoratorTest {
   }
 
   @Test
-  public void generates_metrics() throws Exception {
+  public void generates_metrics() {
     assertThat(decorator.generatesMetrics()).hasSize(1);
   }
 
   @Test
-  public void execute_on_project() throws Exception {
+  public void execute_on_project() {
     assertThat(decorator.shouldExecuteOnProject(null)).isTrue();
   }
 
index 79ce075a097d2334dd0ed4ece4fbe55e30cf8f63..ab599323349aa14ae308cc2525981b681f493414 100644 (file)
@@ -81,7 +81,7 @@ public class SqaleRatingDecoratorTest {
   }
 
   @Test
-  public void generates_metrics() throws Exception {
+  public void generates_metrics() {
     SqaleRatingDecorator decorator = new SqaleRatingDecorator();
     assertThat(decorator.generatesMetrics()).hasSize(3);
   }
@@ -93,13 +93,13 @@ public class SqaleRatingDecoratorTest {
   }
 
   @Test
-  public void execute_on_project() throws Exception {
+  public void execute_on_project() {
     SqaleRatingDecorator decorator = new SqaleRatingDecorator();
     assertThat(decorator.shouldExecuteOnProject(null)).isTrue();
   }
 
   @Test
-  public void not_execute_on_unit_test() throws Exception {
+  public void not_execute_on_unit_test() {
     File resource = mock(File.class);
     when(resource.getQualifier()).thenReturn(Qualifiers.UNIT_TEST_FILE);
     DecoratorContext context = mock(DecoratorContext.class);
index 830b6319e153686318d5c16fade30ea594d12c88..15ef8398d691e882d4fdab78260e1b89d8301a18 100644 (file)
@@ -41,7 +41,7 @@ public class SqaleRatingGridTest {
   }
 
   @Test
-  public void return_grade_lower_bound() throws Exception {
+  public void return_grade_lower_bound() {
     assertThat(ratingGrid.getGradeLowerBound(SqaleRatingGrid.SqaleRating.A)).isEqualTo(0);
     assertThat(ratingGrid.getGradeLowerBound(SqaleRatingGrid.SqaleRating.B)).isEqualTo(0.1);
     assertThat(ratingGrid.getGradeLowerBound(SqaleRatingGrid.SqaleRating.C)).isEqualTo(0.2);
@@ -50,7 +50,7 @@ public class SqaleRatingGridTest {
   }
 
   @Test
-  public void return_rating_matching_density() throws Exception {
+  public void return_rating_matching_density() {
     assertThat(ratingGrid.getRatingForDensity(0)).isEqualTo(1);
     assertThat(ratingGrid.getRatingForDensity(0.05)).isEqualTo(1);
     assertThat(ratingGrid.getRatingForDensity(0.1)).isEqualTo(2);
@@ -64,7 +64,7 @@ public class SqaleRatingGridTest {
   }
 
   @Test
-  public void fail_on_invalid_density() throws Exception {
+  public void fail_on_invalid_density() {
     throwable.expect(RuntimeException.class);
 
     ratingGrid.getRatingForDensity(-1);
index 157808bde5d4fa7cef29b45fbd1dfd2574707ea8..68cbfee5f51dbdda56fe136f2f7dd205a5f66c18 100644 (file)
@@ -47,7 +47,7 @@ public class SqaleRatingSettingsTest {
   }
 
   @Test
-  public void load_rating_grid() throws Exception {
+  public void load_rating_grid() {
     settings.setProperty(CoreProperties.RATING_GRID, "1,3.4,8,50");
     SqaleRatingSettings configurationLoader = new SqaleRatingSettings(settings);
 
@@ -60,7 +60,7 @@ public class SqaleRatingSettingsTest {
   }
 
   @Test
-  public void load_work_units_for_language() throws Exception {
+  public void load_work_units_for_language() {
     settings.setProperty(CoreProperties.DEVELOPMENT_COST, "50");
     SqaleRatingSettings configurationLoader = new SqaleRatingSettings(settings);
 
@@ -68,7 +68,7 @@ public class SqaleRatingSettingsTest {
   }
 
   @Test
-  public void load_size_metric_for_language() throws Exception {
+  public void load_size_metric_for_language() {
     settings.setProperty(CoreProperties.SIZE_METRIC, "complexity");
     SqaleRatingSettings configurationLoader = new SqaleRatingSettings(settings);
 
@@ -76,7 +76,7 @@ public class SqaleRatingSettingsTest {
   }
 
   @Test
-  public void load_overridden_values_for_language() throws Exception {
+  public void load_overridden_values_for_language() {
 
     String aLanguage = "aLanguage";
     String anotherLanguage = "anotherLanguage";
@@ -98,7 +98,7 @@ public class SqaleRatingSettingsTest {
   }
 
   @Test
-  public void fail_on_invalid_rating_grid_configuration() throws Exception {
+  public void fail_on_invalid_rating_grid_configuration() {
 
     throwable.expect(IllegalArgumentException.class);
     settings.setProperty(CoreProperties.RATING_GRID, "a b c");
@@ -108,7 +108,7 @@ public class SqaleRatingSettingsTest {
   }
   
   @Test
-  public void fail_on_invalid_work_unit_value() throws Exception {
+  public void fail_on_invalid_work_unit_value() {
     throwable.expect(IllegalArgumentException.class);
     settings.setProperty(CoreProperties.DEVELOPMENT_COST, "a");
     SqaleRatingSettings configurationLoader = new SqaleRatingSettings(settings);
@@ -117,7 +117,7 @@ public class SqaleRatingSettingsTest {
   }
 
   @Test
-  public void fail_on_unknown_metric_key() throws Exception {
+  public void fail_on_unknown_metric_key() {
     throwable.expect(IllegalArgumentException.class);
     settings.setProperty(CoreProperties.SIZE_METRIC, "unknown");
     SqaleRatingSettings configurationLoader = new SqaleRatingSettings(settings);
@@ -126,7 +126,7 @@ public class SqaleRatingSettingsTest {
   }
 
   @Test
-  public void use_generic_value_when_specific_setting_is_missing() throws Exception {
+  public void use_generic_value_when_specific_setting_is_missing() {
     String aLanguage = "aLanguage";
 
     settings.setProperty(CoreProperties.SIZE_METRIC, "complexity");
index c93334474b24d5387bb56514f6316043d9544ba7..0a4ad891ce7dc6eb718ed5179431549435b6366a 100644 (file)
@@ -29,7 +29,7 @@ import static org.mockito.Mockito.verify;
 
 public class ResourceFiltersTest {
   @Test
-  public void warn_on_resource_filters() throws Exception {
+  public void warn_on_resource_filters() {
     Logger logger = mock(Logger.class);
     ResourceFilter[] filters = {mock(ResourceFilter.class)};
     new ResourceFilters(logger, filters);
@@ -40,7 +40,7 @@ public class ResourceFiltersTest {
   }
 
   @Test
-  public void ok_if_no_resource_filters() throws Exception {
+  public void ok_if_no_resource_filters() {
     // just for verify that it does not fail. Should check that no warning is logged.
     new ResourceFilters();
   }
index 83c8b98a8b95cbc6961862e32d0e06fcc876ed60..bd71b0b43510850b1f0de90d17139426cdcb647d 100644 (file)
@@ -33,7 +33,7 @@ public class PastSnapshotFinderByPreviousVersionTest extends AbstractDbUnitTestC
   private PastSnapshotFinderByPreviousVersion finder;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     finder = new PastSnapshotFinderByPreviousVersion(getSession(), getMyBatis());
   }
 
index 514860bc011e2b22558cc6e15ffc147754a19d5c..14254a9d9f601fb991cf632545ff37d00b5e8ea1 100644 (file)
@@ -43,7 +43,7 @@ public class DuplicationCacheTest {
   Caches caches;
 
   @Before
-  public void start() throws Exception {
+  public void start() {
     caches = CachesTest.createCacheOnTemp(temp);
     caches.start();
   }
@@ -54,7 +54,7 @@ public class DuplicationCacheTest {
   }
 
   @Test
-  public void should_add_clone_groups() throws Exception {
+  public void should_add_clone_groups() {
     DuplicationCache cache = new DuplicationCache(caches);
 
     DefaultDuplication group1 = new DefaultDuplication()
index 0235af3dc8948273bfe1a5621662a9af7aefe54b..9c85d02c0fd2aad547b0e84d962d9fcf446336a9 100644 (file)
@@ -37,7 +37,7 @@ public class CacheTest {
   Caches caches;
 
   @Before
-  public void start() throws Exception {
+  public void start() {
     caches = CachesTest.createCacheOnTemp(temp);
     caches.start();
   }
@@ -48,7 +48,7 @@ public class CacheTest {
   }
 
   @Test
-  public void one_part_key() throws Exception {
+  public void one_part_key() {
     Cache<String> cache = caches.createCache("capitals");
 
     assertThat(cache.get("france")).isNull();
@@ -97,7 +97,7 @@ public class CacheTest {
   }
 
   @Test
-  public void two_parts_key() throws Exception {
+  public void two_parts_key() {
     Cache<String> cache = caches.createCache("capitals");
 
     assertThat(cache.get("europe", "france")).isNull();
@@ -153,7 +153,7 @@ public class CacheTest {
   }
 
   @Test
-  public void three_parts_key() throws Exception {
+  public void three_parts_key() {
     Cache<String> cache = caches.createCache("places");
     assertThat(cache.get("europe", "france", "paris")).isNull();
 
@@ -229,7 +229,7 @@ public class CacheTest {
   }
 
   @Test
-  public void remove_versus_clear() throws Exception {
+  public void remove_versus_clear() {
     Cache<String> cache = caches.createCache("capitals");
     cache.put("europe", "france", "paris");
     cache.put("europe", "italy", "rome");
@@ -244,7 +244,7 @@ public class CacheTest {
   }
 
   @Test
-  public void empty_cache() throws Exception {
+  public void empty_cache() {
     Cache<String> cache = caches.createCache("empty");
 
     assertThat(cache.get("foo")).isNull();
index 35c8ec22309d8490ac0a20a7f7f8f1aea4a31ec4..83e2a99b94888971d9c2e4416ac771412b5b9140 100644 (file)
@@ -53,7 +53,7 @@ public class CachesTest {
   Caches caches;
 
   @Before
-  public void prepare() throws Exception {
+  public void prepare() {
     caches = createCacheOnTemp(temp);
   }
 
@@ -63,7 +63,7 @@ public class CachesTest {
   }
 
   @Test
-  public void should_stop_and_clean_temp_dir() throws Exception {
+  public void should_stop_and_clean_temp_dir() {
     File tempDir = caches.tempDir();
     assertThat(tempDir).isDirectory().exists();
     assertThat(caches.persistit()).isNotNull();
@@ -77,14 +77,14 @@ public class CachesTest {
   }
 
   @Test
-  public void should_create_cache() throws Exception {
+  public void should_create_cache() {
     caches.start();
     Cache<Element> cache = caches.createCache("foo");
     assertThat(cache).isNotNull();
   }
 
   @Test
-  public void should_not_create_cache_twice() throws Exception {
+  public void should_not_create_cache_twice() {
     caches.start();
     caches.<Element>createCache("foo");
     try {
index bd250b544dd77906a13cbc7c2691793d5ed7e948..461a9a4d7f140514aa4769b525f6c0db3038b6a8 100644 (file)
@@ -28,7 +28,7 @@ import static org.junit.Assert.fail;
 
 public class ResourceCacheTest {
   @Test
-  public void should_cache_resource() throws Exception {
+  public void should_cache_resource() {
     ResourceCache cache = new ResourceCache();
     String componentKey = "struts:src/org/struts/Action.java";
     Resource resource = File.create("org/struts/Action.java").setEffectiveKey(componentKey);
@@ -39,7 +39,7 @@ public class ResourceCacheTest {
   }
 
   @Test
-  public void should_fail_if_missing_component_key() throws Exception {
+  public void should_fail_if_missing_component_key() {
     ResourceCache cache = new ResourceCache();
     Resource resource = File.create("org/struts/Action.java").setEffectiveKey(null);
     try {
index e61cb09ffec11f062bdbc2778c7a4527625b7b8a..25dc340fe3003a84c823c28cbca203ca7d78b669 100644 (file)
@@ -33,7 +33,7 @@ public class DefaultIssueFilterChainTest {
   private final Issue issue = mock(Issue.class);
 
   @Test
-  public void should_accept_when_no_filter() throws Exception {
+  public void should_accept_when_no_filter() {
     assertThat(new DefaultIssueFilterChain().accept(issue)).isTrue();
   }
 
@@ -68,7 +68,7 @@ public class DefaultIssueFilterChainTest {
   }
 
   @Test
-  public void should_accept_if_all_filters_pass() throws Exception {
+  public void should_accept_if_all_filters_pass() {
     assertThat(new DefaultIssueFilterChain(
       new PassingFilter(),
       new PassingFilter(),
@@ -77,7 +77,7 @@ public class DefaultIssueFilterChainTest {
   }
 
   @Test
-  public void should_accept_and_not_go_further_if_filter_accepts() throws Exception {
+  public void should_accept_and_not_go_further_if_filter_accepts() {
     assertThat(new DefaultIssueFilterChain(
       new PassingFilter(),
       new AcceptingFilter(),
@@ -86,7 +86,7 @@ public class DefaultIssueFilterChainTest {
   }
 
   @Test
-  public void should_refuse_and_not_go_further_if_filter_refuses() throws Exception {
+  public void should_refuse_and_not_go_further_if_filter_refuses() {
     assertThat(new DefaultIssueFilterChain(
       new PassingFilter(),
       new RefusingFilter(),
index 2cc9d8b44987d677a162edfce667b32e2a78e630..b46e3551a6da56eb38998f9238c97e6b8cfb358e 100644 (file)
@@ -41,7 +41,7 @@ public class DefaultProjectIssuesTest {
   DefaultProjectIssues projectIssues = new DefaultProjectIssues(cache);
 
   @Test
-  public void should_get_all_issues() throws Exception {
+  public void should_get_all_issues() {
     DefaultIssue issueOnModule = new DefaultIssue().setKey("1").setRuleKey(SQUID_RULE_KEY).setComponentKey("org.apache:struts-core");
     DefaultIssue issueInModule = new DefaultIssue().setKey("2").setRuleKey(SQUID_RULE_KEY).setComponentKey("org.apache:struts-core:Action");
     DefaultIssue resolvedIssueInModule = new DefaultIssue().setKey("3").setRuleKey(SQUID_RULE_KEY).setComponentKey("org.apache:struts-core:Action")
index 514a6d05a1bc91b5d584e5b1402792862baf31a1..9cac3995a5c0d279ae06d8b82ebff39c09b8a30e 100644 (file)
@@ -38,7 +38,7 @@ public class IssuableFactoryTest {
   ProjectTree projectTree = mock(ProjectTree.class);
 
   @Test
-  public void file_should_be_issuable() throws Exception {
+  public void file_should_be_issuable() {
     IssuableFactory factory = new IssuableFactory(moduleIssues, cache, projectTree);
     Component component = new ResourceComponent(File.create("foo/bar.c").setEffectiveKey("foo/bar.c"));
     Issuable issuable = factory.loadPerspective(Issuable.class, component);
@@ -49,7 +49,7 @@ public class IssuableFactoryTest {
   }
 
   @Test
-  public void project_should_be_issuable() throws Exception {
+  public void project_should_be_issuable() {
     IssuableFactory factory = new IssuableFactory(moduleIssues, cache, projectTree);
     Component component = new ResourceComponent(new Project("Foo").setEffectiveKey("foo"));
     Issuable issuable = factory.loadPerspective(Issuable.class, component);
index 2119f1c3ed9ad190abeb85ffa2d0dcd563cde990..46e297f2e4e0f644b9d1347e37b1763a8c5623ff 100644 (file)
@@ -49,7 +49,7 @@ public class IssueCacheTest {
   Caches caches;
 
   @Before
-  public void start() throws Exception {
+  public void start() {
     caches = CachesTest.createCacheOnTemp(temp);
     caches.start();
   }
@@ -60,7 +60,7 @@ public class IssueCacheTest {
   }
 
   @Test
-  public void should_add_new_issue() throws Exception {
+  public void should_add_new_issue() {
     IssueCache cache = new IssueCache(caches);
     DefaultIssue issue1 = new DefaultIssue().setKey("111").setComponentKey("org.struts.Action");
     DefaultIssue issue2 = new DefaultIssue().setKey("222").setComponentKey("org.struts.Action");
@@ -73,7 +73,7 @@ public class IssueCacheTest {
   }
 
   @Test
-  public void should_update_existing_issue() throws Exception {
+  public void should_update_existing_issue() {
     IssueCache cache = new IssueCache(caches);
     DefaultIssue issue = new DefaultIssue().setKey("111").setComponentKey("org.struts.Action").setSeverity(Severity.BLOCKER);
     cache.put(issue);
@@ -89,7 +89,7 @@ public class IssueCacheTest {
   }
 
   @Test
-  public void should_get_all_issues() throws Exception {
+  public void should_get_all_issues() {
     IssueCache cache = new IssueCache(caches);
     DefaultIssue issue1 = new DefaultIssue().setKey("111").setComponentKey("org.struts.Action").setSeverity(Severity.BLOCKER);
     DefaultIssue issue2 = new DefaultIssue().setKey("222").setComponentKey("org.struts.Filter").setSeverity(Severity.INFO);
index 4cc35d488ce3350079e8d345bc5dbd730577601f..46aea62325c282ee8d1b1f5098b6a0d36648fbea 100644 (file)
@@ -31,7 +31,7 @@ import static org.mockito.Mockito.when;
 public class IssueFiltersTest {
 
   @Test
-  public void accept_when_filter_chain_is_empty() throws Exception {
+  public void accept_when_filter_chain_is_empty() {
     org.sonar.api.issue.IssueFilter ok = mock(org.sonar.api.issue.IssueFilter.class);
     when(ok.accept(any(Issue.class))).thenReturn(true);
 
index 7ffa990572183c408ce32c438932dfba42ee507d..2577ba98a4179bb918220aab57b7050b7632fce7 100644 (file)
@@ -78,7 +78,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void fail_on_unknown_rule() throws Exception {
+  public void fail_on_unknown_rule() {
     initModuleIssues();
     DefaultIssue issue = new DefaultIssue().setRuleKey(SQUID_RULE_KEY);
 
@@ -93,7 +93,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void fail_if_rule_has_no_name_and_issue_has_no_message() throws Exception {
+  public void fail_if_rule_has_no_name_and_issue_has_no_message() {
     ruleBuilder.add(RuleKey.of("squid", "AvoidCycle"));
     initModuleIssues();
     DefaultIssue issue = new DefaultIssue().setRuleKey(SQUID_RULE_KEY).setMessage("");
@@ -109,7 +109,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void ignore_null_active_rule() throws Exception {
+  public void ignore_null_active_rule() {
     ruleBuilder.add(SQUID_RULE_KEY).setName(SQUID_RULE_NAME);
     initModuleIssues();
 
@@ -121,7 +121,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void ignore_null_rule_of_active_rule() throws Exception {
+  public void ignore_null_rule_of_active_rule() {
     ruleBuilder.add(SQUID_RULE_KEY).setName(SQUID_RULE_NAME);
     activeRulesBuilder.create(SQUID_RULE_KEY).activate();
     initModuleIssues();
@@ -134,7 +134,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void add_issue_to_cache() throws Exception {
+  public void add_issue_to_cache() {
     ruleBuilder.add(SQUID_RULE_KEY).setName(SQUID_RULE_NAME);
     activeRulesBuilder.create(SQUID_RULE_KEY).setSeverity(Severity.INFO).activate();
     initModuleIssues();
@@ -158,7 +158,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void use_severity_from_active_rule_if_no_severity_on_issue() throws Exception {
+  public void use_severity_from_active_rule_if_no_severity_on_issue() {
     ruleBuilder.add(SQUID_RULE_KEY).setName(SQUID_RULE_NAME);
     activeRulesBuilder.create(SQUID_RULE_KEY).setSeverity(Severity.INFO).activate();
     initModuleIssues();
@@ -177,7 +177,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void use_rule_name_if_no_message() throws Exception {
+  public void use_rule_name_if_no_message() {
     ruleBuilder.add(SQUID_RULE_KEY).setName(SQUID_RULE_NAME);
     activeRulesBuilder.create(SQUID_RULE_KEY).setSeverity(Severity.INFO).setName(SQUID_RULE_NAME).activate();
     initModuleIssues();
@@ -201,7 +201,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void add_deprecated_violation() throws Exception {
+  public void add_deprecated_violation() {
     ruleBuilder.add(SQUID_RULE_KEY).setName(SQUID_RULE_NAME);
     activeRulesBuilder.create(SQUID_RULE_KEY).setSeverity(Severity.INFO).activate();
     initModuleIssues();
@@ -231,7 +231,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void filter_issue() throws Exception {
+  public void filter_issue() {
     ruleBuilder.add(SQUID_RULE_KEY).setName(SQUID_RULE_NAME);
     activeRulesBuilder.create(SQUID_RULE_KEY).setSeverity(Severity.INFO).activate();
     initModuleIssues();
@@ -250,7 +250,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void set_debt_with_linear_function() throws Exception {
+  public void set_debt_with_linear_function() {
     ruleBuilder.add(SQUID_RULE_KEY)
       .setName(SQUID_RULE_NAME)
       .setDebtSubCharacteristic("COMPILER_RELATED_PORTABILITY")
@@ -276,7 +276,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void set_debt_with_linear_with_offset_function() throws Exception {
+  public void set_debt_with_linear_with_offset_function() {
     ruleBuilder.add(SQUID_RULE_KEY)
       .setName(SQUID_RULE_NAME)
       .setDebtSubCharacteristic("COMPILER_RELATED_PORTABILITY")
@@ -302,7 +302,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void set_debt_with_constant_issue_function() throws Exception {
+  public void set_debt_with_constant_issue_function() {
     ruleBuilder.add(SQUID_RULE_KEY)
       .setName(SQUID_RULE_NAME)
       .setDebtSubCharacteristic("COMPILER_RELATED_PORTABILITY")
@@ -328,7 +328,7 @@ public class ModuleIssuesTest {
   }
 
   @Test
-  public void fail_to_set_debt_with_constant_issue_function_when_effort_to_fix_is_set() throws Exception {
+  public void fail_to_set_debt_with_constant_issue_function_when_effort_to_fix_is_set() {
     ruleBuilder.add(SQUID_RULE_KEY)
       .setName(SQUID_RULE_NAME)
       .setDebtSubCharacteristic("COMPILER_RELATED_PORTABILITY")
index 57cd8cfd17e256902776c82179754b951907a766..47a2e4e19074bd30f14de9448523bc233de6fcb4 100644 (file)
@@ -78,28 +78,28 @@ public class PatternMatcherTest {
   }
 
   @Test
-  public void shouldMatchWithStandardPatterns() throws IOException {
+  public void shouldMatchWithStandardPatterns() {
     patternMatcher.addPatternForComponent(JAVA_FILE, createPattern("org.foo.Hello;checkstyle:MagicNumber;[15-200]"));
 
     assertThat(patternMatcher.getMatchingPattern(create(CHECKSTYLE_RULE, JAVA_FILE, 150))).isNotNull();
   }
 
   @Test
-  public void shouldNotMatchWithStandardPatterns() throws IOException {
+  public void shouldNotMatchWithStandardPatterns() {
     patternMatcher.addPatternForComponent(JAVA_FILE, createPattern("org.foo.Hello;checkstyle:MagicNumber;[15-200]"));
 
     assertThat(patternMatcher.getMatchingPattern(create(CHECKSTYLE_RULE, JAVA_FILE, 5))).isNull();
   }
 
   @Test
-  public void shouldMatchWithExtraPattern() throws IOException {
+  public void shouldMatchWithExtraPattern() {
     patternMatcher.addPatternForComponent(JAVA_FILE, createPattern("org.foo.Hello;*;[15-200]"));
 
     assertThat(patternMatcher.getMatchingPattern(create(CHECKSTYLE_RULE, JAVA_FILE, 150))).isNotNull();
   }
 
   @Test
-  public void shouldNotMatchWithExtraPattern() throws IOException {
+  public void shouldNotMatchWithExtraPattern() {
     patternMatcher.addPatternForComponent(JAVA_FILE, createPattern("org.foo.Hello;*;[15-200]"));
 
     assertThat(patternMatcher.getMatchingPattern(create(CHECKSTYLE_RULE, JAVA_FILE, 5))).isNull();
index 3cca58ac2b27d105c45141d606bf35aa2f5b524e..5bd352f2e623e24e52e3af0441bd9bfb3ce4628c 100644 (file)
@@ -83,7 +83,7 @@ public class IssueExclusionsLoaderTest {
   }
 
   @Test
-  public void shouldExecute() throws IOException {
+  public void shouldExecute() {
     when(exclusionPatternInitializer.hasConfiguredPatterns()).thenReturn(true);
     when(inclusionPatternInitializer.hasConfiguredPatterns()).thenReturn(true);
     assertThat(scanner.shouldExecuteOnProject(null)).isTrue();
@@ -124,7 +124,7 @@ public class IssueExclusionsLoaderTest {
   }
 
   @Test
-  public void shouldAnalyseFilesOnlyWhenRegexConfigured() throws IOException {
+  public void shouldAnalyseFilesOnlyWhenRegexConfigured() {
     File javaFile1 = new File(baseDir, "src/main/java/Foo.java");
     fs.add(new DeprecatedDefaultInputFile("polop", "src/main/java/Foo.java")
       .setType(InputFile.Type.MAIN));
index a98952d5ec9e71f1c49a3803d35ea43f67635766..046f37840f90d5977d317b42dc43f264e3d45677 100644 (file)
@@ -57,7 +57,7 @@ public class InitialOpenIssuesStackTest {
   Caches caches;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     caches = createCacheOnTemp(temp);
     caches.start();
     stack = new InitialOpenIssuesStack(caches);
index 8b210bd731dc7103e73c2c8aead1cd0b6f453460..c3d84f77c98d01a26d11c5324c84b7a5255f5742 100644 (file)
@@ -35,7 +35,7 @@ import static org.mockito.Mockito.*;
 
 public class IssueHandlersTest {
   @Test
-  public void should_execute_handlers() throws Exception {
+  public void should_execute_handlers() {
     IssueHandler h1 = mock(IssueHandler.class);
     IssueHandler h2 = mock(IssueHandler.class);
     IssueUpdater updater = mock(IssueUpdater.class);
index a0021e72025707737ab6316e87067f59b02bdd9f..dde4856d71c68943666d9da33d16dc6207b9775d 100644 (file)
@@ -104,14 +104,14 @@ public class IssueTrackingDecoratorTest {
   }
 
   @Test
-  public void should_not_be_executed_on_classes_not_methods() throws Exception {
+  public void should_not_be_executed_on_classes_not_methods() {
     DecoratorContext context = mock(DecoratorContext.class);
     decorator.decorate(JavaClass.create("org.foo.Bar"), context);
     verifyZeroInteractions(context, issueCache, tracking, handlers, workflow);
   }
 
   @Test
-  public void should_process_open_issues() throws Exception {
+  public void should_process_open_issues() {
     Resource file = File.create("Action.java").setEffectiveKey("struts:Action.java").setId(123);
     final DefaultIssue issue = new DefaultIssue();
 
@@ -136,7 +136,7 @@ public class IssueTrackingDecoratorTest {
   }
 
   @Test
-  public void should_register_unmatched_issues_as_end_of_life() throws Exception {
+  public void should_register_unmatched_issues_as_end_of_life() {
     // "Unmatched" issues existed in previous scan but not in current one -> they have to be closed
     Resource file = File.create("Action.java").setEffectiveKey("struts:Action.java").setId(123);
 
@@ -487,7 +487,7 @@ public class IssueTrackingDecoratorTest {
   }
 
   @Test
-  public void should_register_issues_on_deleted_components() throws Exception {
+  public void should_register_issues_on_deleted_components() {
     Project project = new Project("struts");
     DefaultIssue openIssue = new DefaultIssue();
     when(issueCache.byComponent("struts")).thenReturn(Arrays.asList(openIssue));
@@ -511,7 +511,7 @@ public class IssueTrackingDecoratorTest {
   }
 
   @Test
-  public void merge_matched_issue() throws Exception {
+  public void merge_matched_issue() {
     ServerIssue previousIssue = new ServerIssueFromDb(new IssueDto().setKee("ABCDE").setResolution(null).setStatus("OPEN").setRuleKey("squid", "AvoidCycle")
       .setLine(10).setSeverity("MAJOR").setMessage("Message").setEffortToFix(1.5).setDebt(1L).setProjectKey("sample"));
     DefaultIssue issue = new DefaultIssue();
@@ -530,7 +530,7 @@ public class IssueTrackingDecoratorTest {
   }
 
   @Test
-  public void merge_matched_issue_on_manual_severity() throws Exception {
+  public void merge_matched_issue_on_manual_severity() {
     ServerIssue previousIssue = new ServerIssueFromDb(new IssueDto().setKee("ABCDE").setResolution(null).setStatus("OPEN").setRuleKey("squid", "AvoidCycle")
       .setLine(10).setManualSeverity(true).setSeverity("MAJOR").setMessage("Message").setEffortToFix(1.5).setDebt(1L));
     DefaultIssue issue = new DefaultIssue();
@@ -546,7 +546,7 @@ public class IssueTrackingDecoratorTest {
   }
 
   @Test
-  public void merge_issue_changelog_with_previous_changelog() throws Exception {
+  public void merge_issue_changelog_with_previous_changelog() {
     when(initialOpenIssues.selectChangelog("ABCDE")).thenReturn(newArrayList(new IssueChangeDto().setIssueKey("ABCD").setCreatedAt(System2.INSTANCE.now())));
 
     ServerIssue previousIssue = new ServerIssueFromDb(new IssueDto().setKee("ABCDE").setResolution(null).setStatus("OPEN").setRuleKey("squid", "AvoidCycle")
index d07d08a978cc7ab1575c19cd309bd6c96f0fb99e..b716ce907d5c8b006c94a9b18170f55152c9859b 100644 (file)
@@ -334,7 +334,7 @@ public class IssueTrackingTest {
   }
 
   @Test
-  public void dont_load_checksum_if_no_new_issue() throws Exception {
+  public void dont_load_checksum_if_no_new_issue() {
     sourceHashHolder = mock(SourceHashHolder.class);
 
     ServerIssue referenceIssue = newReferenceIssue("2 branches need to be covered", null, "squid", "AvoidCycle", null);
index 155b9cd4910f85a7ca0a09f4337e989af3b93069..aa351984b5ae7d26da046068bd5eca9e0bd04b21 100644 (file)
@@ -60,7 +60,7 @@ public class LanguageDistributionDecoratorTest {
   LanguageDistributionDecorator decorator;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     decorator = new LanguageDistributionDecorator();
   }
 
index 436351982095e2fa714dcb2d1d9d4d27852a5a97..a4d344bdeceb16b7dad668d68561745441abb694 100644 (file)
@@ -41,7 +41,7 @@ public class MavenProjectBootstrapperTest {
   public ExpectedException thrown = ExpectedException.none();
 
   @Test
-  public void bootstrap() throws Exception {
+  public void bootstrap() {
     ProjectDefinition def = mock(ProjectDefinition.class);
     MavenSession session = mock(MavenSession.class);
     MavenProject rootProject = new MavenProject();
@@ -60,7 +60,7 @@ public class MavenProjectBootstrapperTest {
   }
 
   @Test
-  public void should_fail_if_no_top_level_project() throws Exception {
+  public void should_fail_if_no_top_level_project() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("Maven session does not declare a top level project");
 
index 72023e2e1809be247966ac705b2254b13bba4c23..f20786a467905e4ddedd6dadc0c5fccd4c410eaf 100644 (file)
@@ -226,7 +226,7 @@ public class FileSystemMediumTest {
 
   // SONAR-5330
   @Test
-  public void scanProjectWithSourceSymlink() throws Exception {
+  public void scanProjectWithSourceSymlink() {
     if (!System2.INSTANCE.isOsWindows()) {
       File projectDir = new File("src/test/resources/mediumtest/xoo/sample-with-symlink");
       TaskResult result = tester
index acd9ea1fdb7be2da5caf0862206d631b4b330e64..1a16a8868b94a9e2a4398eef624b5106935f4733 100644 (file)
@@ -45,21 +45,21 @@ public class PostJobOptimizerTest {
   private AnalysisMode analysisMode;
 
   @Before
-  public void prepare() throws Exception {
+  public void prepare() {
     settings = new Settings();
     analysisMode = mock(AnalysisMode.class);
     optimizer = new PostJobOptimizer(settings, analysisMode);
   }
 
   @Test
-  public void should_run_analyzer_with_no_metadata() throws Exception {
+  public void should_run_analyzer_with_no_metadata() {
     DefaultPostJobDescriptor descriptor = new DefaultPostJobDescriptor();
 
     assertThat(optimizer.shouldExecute(descriptor)).isTrue();
   }
 
   @Test
-  public void should_optimize_on_settings() throws Exception {
+  public void should_optimize_on_settings() {
     DefaultPostJobDescriptor descriptor = new DefaultPostJobDescriptor()
       .requireProperty("sonar.foo.reportPath");
     assertThat(optimizer.shouldExecute(descriptor)).isFalse();
@@ -69,7 +69,7 @@ public class PostJobOptimizerTest {
   }
 
   @Test
-  public void should_disabled_in_preview() throws Exception {
+  public void should_disabled_in_preview() {
     DefaultPostJobDescriptor descriptor = new DefaultPostJobDescriptor()
       .disabledInPreview();
     assertThat(optimizer.shouldExecute(descriptor)).isTrue();
index 704a27b04c1e068f311bb992e2000ee0541546c9..0974ac53e11f33881c3bebc4432dee2a63ed1b27 100644 (file)
@@ -145,7 +145,7 @@ public class PhasesSumUpTimeProfilerTest {
     return project;
   }
 
-  private void fakeAnalysis(PhasesSumUpTimeProfiler profiler, final Project module) throws InterruptedException {
+  private void fakeAnalysis(PhasesSumUpTimeProfiler profiler, final Project module) {
     // Start of moduleA
     profiler.onProjectAnalysis(projectEvent(module, true));
     initializerPhase(profiler);
@@ -158,7 +158,7 @@ public class PhasesSumUpTimeProfilerTest {
     profiler.onProjectAnalysis(projectEvent(module, false));
   }
 
-  private void decoratorPhase(PhasesSumUpTimeProfiler profiler) throws InterruptedException {
+  private void decoratorPhase(PhasesSumUpTimeProfiler profiler) {
     Decorator decorator1 = new FakeDecorator1();
     Decorator decorator2 = new FakeDecorator2();
     // Start of decorator phase
@@ -187,7 +187,7 @@ public class PhasesSumUpTimeProfilerTest {
     profiler.onDecoratorsPhase(decoratorsEvent(false));
   }
 
-  private void batchStep(PhasesSumUpTimeProfiler profiler) throws InterruptedException {
+  private void batchStep(PhasesSumUpTimeProfiler profiler) {
     // Start of batch step
     profiler.onBatchStep(new BatchStepEvent("Free memory", true));
     clock.sleep(9);
@@ -195,7 +195,7 @@ public class PhasesSumUpTimeProfilerTest {
     profiler.onBatchStep(new BatchStepEvent("Free memory", false));
   }
 
-  private void initializerPhase(PhasesSumUpTimeProfiler profiler) throws InterruptedException {
+  private void initializerPhase(PhasesSumUpTimeProfiler profiler) {
     Initializer initializer = new FakeInitializer();
     // Start of initializer phase
     profiler.onInitializersPhase(initializersEvent(true));
@@ -208,7 +208,7 @@ public class PhasesSumUpTimeProfilerTest {
     profiler.onInitializersPhase(initializersEvent(false));
   }
 
-  private void sensorPhase(PhasesSumUpTimeProfiler profiler) throws InterruptedException {
+  private void sensorPhase(PhasesSumUpTimeProfiler profiler) {
     Sensor sensor = new FakeSensor();
     // Start of sensor phase
     profiler.onSensorsPhase(sensorsEvent(true));
@@ -221,7 +221,7 @@ public class PhasesSumUpTimeProfilerTest {
     profiler.onSensorsPhase(sensorsEvent(false));
   }
 
-  private void persistersPhase(PhasesSumUpTimeProfiler profiler) throws InterruptedException {
+  private void persistersPhase(PhasesSumUpTimeProfiler profiler) {
     ScanPersister persister = new FakeScanPersister();
     // Start of persister phase
     profiler.onPersistersPhase(persistersEvent(true));
@@ -234,7 +234,7 @@ public class PhasesSumUpTimeProfilerTest {
     profiler.onPersistersPhase(persistersEvent(false));
   }
 
-  private void postJobPhase(PhasesSumUpTimeProfiler profiler) throws InterruptedException {
+  private void postJobPhase(PhasesSumUpTimeProfiler profiler) {
     PostJob postJob = new FakePostJob();
     // Start of sensor phase
     profiler.onPostJobsPhase(postJobsEvent(true));
index ca89fe8ccaebe52ceb897b10bf453d98a9e54f85..759471b4677162fca55bbbcfbf109d1497f91be7 100644 (file)
@@ -101,7 +101,7 @@ public class QualityGateVerifierTest {
   }
 
   @Test
-  public void should_be_executed_if_quality_gate_is_enabled() throws Exception {
+  public void should_be_executed_if_quality_gate_is_enabled() {
     assertThat(verifier.shouldExecuteOnProject((Project) project)).isTrue();
     when(qualityGate.isEnabled()).thenReturn(false);
     assertThat(verifier.shouldExecuteOnProject((Project) project)).isFalse();
index 5b9221dc92cd93b0909744775a4fcaa18d6d40c4..4a6e27960d2d9054b6bb646a20bc8847a13f05e0 100644 (file)
@@ -53,7 +53,7 @@ public class ReportPublisherTest extends AbstractDbUnitTestCase {
   }
 
   @Test
-  public void should_log_successful_analysis() throws Exception {
+  public void should_log_successful_analysis() {
     Settings settings = new Settings();
     settings.setProperty(CoreProperties.SERVER_BASE_URL, "http://myserver/");
     ReportPublisher job = new ReportPublisher(settings, mock(ServerClient.class), mock(Server.class), reactor, mode, mock(TempFolder.class), new ReportPublisherStep[0]);
@@ -66,7 +66,7 @@ public class ReportPublisherTest extends AbstractDbUnitTestCase {
   }
 
   @Test
-  public void should_log_successful_preview_analysis() throws Exception {
+  public void should_log_successful_preview_analysis() {
     Settings settings = new Settings();
     when(mode.isPreview()).thenReturn(true);
     ReportPublisher job = new ReportPublisher(settings, mock(ServerClient.class), mock(Server.class), reactor, mode, mock(TempFolder.class), new ReportPublisherStep[0]);
index c76eacef5be129d0bbe8c670987d0932c7b5df7d..c5f977c3e9c1c6f65f36fa3f61a8fd7f88e64bef 100644 (file)
@@ -47,7 +47,7 @@ public class QProfileDecoratorTest {
   DecoratorContext decoratorContext = mock(DecoratorContext.class);
 
   @Test
-  public void don_t_run_on_leaf() throws Exception {
+  public void don_t_run_on_leaf() {
     QProfileDecorator decorator = new QProfileDecorator();
     when(project.getModules()).thenReturn(Collections.<Project>emptyList());
     assertThat(decorator.shouldExecuteOnProject(project)).isFalse();
@@ -57,7 +57,7 @@ public class QProfileDecoratorTest {
   }
 
   @Test
-  public void aggregate() throws Exception {
+  public void aggregate() {
     Measure measureModuleA = new Measure(CoreMetrics.QUALITY_PROFILES, "[" + JAVA_JSON + "]");
     Measure measureModuleB = new Measure(CoreMetrics.QUALITY_PROFILES, "[" + JAVA_JSON + "]");
     Measure measureModuleC = new Measure(CoreMetrics.QUALITY_PROFILES, "[" + PHP_JSON + "]");
@@ -73,7 +73,7 @@ public class QProfileDecoratorTest {
   }
 
   @Test
-  public void aggregate_different_profiles_with_same_language() throws Exception {
+  public void aggregate_different_profiles_with_same_language() {
     Measure measureModuleA = new Measure(CoreMetrics.QUALITY_PROFILES, "[" + JAVA_JSON + "]");
     Measure measureModuleB = new Measure(CoreMetrics.QUALITY_PROFILES, "[" + JAVA2_JSON + "]");
     when(decoratorContext.getChildrenMeasures(CoreMetrics.QUALITY_PROFILES)).thenReturn(Arrays.asList(measureModuleA, measureModuleB));
index 7c83baad914f8f21bff21dfeaf3d5cae696cec14..f362690979adb091701b951304794627c5e7ce02 100644 (file)
@@ -62,13 +62,13 @@ public class QProfileSensorTest {
   }
 
   @Test
-  public void to_string() throws Exception {
+  public void to_string() {
     QProfileSensor sensor = new QProfileSensor(moduleQProfiles, fs, mock(AnalysisMode.class));
     assertThat(sensor.toString()).isEqualTo("QProfileSensor");
   }
 
   @Test
-  public void no_execution_in_preview() throws Exception {
+  public void no_execution_in_preview() {
     AnalysisMode analysisMode = mock(AnalysisMode.class);
     when(analysisMode.isPreview()).thenReturn(true);
     QProfileSensor sensor = new QProfileSensor(moduleQProfiles, fs, analysisMode);
@@ -77,7 +77,7 @@ public class QProfileSensorTest {
   }
 
   @Test
-  public void no_qprofiles() throws Exception {
+  public void no_qprofiles() {
     when(moduleQProfiles.findAll()).thenReturn(Collections.<QProfile>emptyList());
 
     QProfileSensor sensor = new QProfileSensor(moduleQProfiles, fs, mock(AnalysisMode.class));
@@ -89,7 +89,7 @@ public class QProfileSensorTest {
   }
 
   @Test
-  public void mark_profiles_as_used() throws Exception {
+  public void mark_profiles_as_used() {
     when(moduleQProfiles.findByLanguage("java")).thenReturn(JAVA_PROFILE);
     when(moduleQProfiles.findByLanguage("php")).thenReturn(PHP_PROFILE);
     when(moduleQProfiles.findByLanguage("abap")).thenReturn(null);
@@ -101,7 +101,7 @@ public class QProfileSensorTest {
   }
 
   @Test
-  public void store_measures_on_single_lang_module() throws Exception {
+  public void store_measures_on_single_lang_module() {
     when(moduleQProfiles.findByLanguage("java")).thenReturn(JAVA_PROFILE);
     when(moduleQProfiles.findByLanguage("php")).thenReturn(PHP_PROFILE);
     when(moduleQProfiles.findByLanguage("abap")).thenReturn(null);
@@ -117,7 +117,7 @@ public class QProfileSensorTest {
   }
 
   @Test
-  public void store_measures_on_multi_lang_module() throws Exception {
+  public void store_measures_on_multi_lang_module() {
     when(moduleQProfiles.findByLanguage("java")).thenReturn(JAVA_PROFILE);
     when(moduleQProfiles.findByLanguage("php")).thenReturn(PHP_PROFILE);
     when(moduleQProfiles.findByLanguage("abap")).thenReturn(null);
index e1a52981d120dcb74a2335e3586e4b2da145b06b..bfa14cf91bcc7dfc964a992459e3921e3e45dd28 100644 (file)
@@ -40,7 +40,7 @@ public class RulesProfileProviderTest {
   RulesProfileProvider provider = new RulesProfileProvider();
 
   @Test
-  public void merge_profiles() throws Exception {
+  public void merge_profiles() {
     QProfile qProfile = new QProfile().setKey("java-sw").setName("Sonar way").setLanguage("java");
     when(qProfiles.findAll()).thenReturn(Arrays.asList(qProfile));
 
@@ -60,7 +60,7 @@ public class RulesProfileProviderTest {
   }
 
   @Test
-  public void keep_compatibility_with_single_language_projects() throws Exception {
+  public void keep_compatibility_with_single_language_projects() {
     settings.setProperty("sonar.language", "java");
 
     QProfile qProfile = new QProfile().setKey("java-sw").setName("Sonar way").setLanguage("java");
index e14e9fb7fdaacedea04dc149a28761fbe97a214e..79ba7df94bcf5067e954981688dc63714f2bc267 100644 (file)
@@ -55,7 +55,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   RulesProvider provider;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     debtModel = new DefaultDebtModel()
       .addCharacteristic(new DefaultDebtCharacteristic()
         .setId(100)
@@ -86,7 +86,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void build_rules() throws Exception {
+  public void build_rules() {
     setupData("shared");
 
     Rules rules = provider.provide(ruleDao, debtModel, durations);
@@ -110,7 +110,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void build_rules_with_default_debt_definitions() throws Exception {
+  public void build_rules_with_default_debt_definitions() {
     setupData("build_rules_with_default_debt_definitions");
 
     Rules rules = provider.provide(ruleDao, debtModel, durations);
@@ -121,7 +121,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void build_rules_with_overridden_debt_definitions() throws Exception {
+  public void build_rules_with_overridden_debt_definitions() {
     setupData("build_rules_with_overridden_debt_definitions");
 
     Rules rules = provider.provide(ruleDao, debtModel, durations);
@@ -132,7 +132,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void build_rules_with_default_and_overridden_debt_definitions() throws Exception {
+  public void build_rules_with_default_and_overridden_debt_definitions() {
     setupData("build_rules_with_default_and_overridden_debt_definitions");
 
     Rules rules = provider.provide(ruleDao, debtModel, durations);
@@ -144,7 +144,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void build_rules_with_default_characteristic_and_overridden_function() throws Exception {
+  public void build_rules_with_default_characteristic_and_overridden_function() {
     setupData("build_rules_with_default_characteristic_and_overridden_function");
 
     Rules rules = provider.provide(ruleDao, debtModel, durations);
@@ -156,7 +156,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void build_rules_with_overridden_characteristic_and_default_function() throws Exception {
+  public void build_rules_with_overridden_characteristic_and_default_function() {
     setupData("build_rules_with_overridden_characteristic_and_default_function");
 
     Rules rules = provider.provide(ruleDao, debtModel, durations);
@@ -168,7 +168,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void build_rules_with_disable_characteristic() throws Exception {
+  public void build_rules_with_disable_characteristic() {
     setupData("build_rules_with_disable_characteristic");
 
     Rules rules = provider.provide(ruleDao, debtModel, durations);
@@ -179,7 +179,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void build_rules_with_default_characteristic_and_disable_characteristic() throws Exception {
+  public void build_rules_with_default_characteristic_and_disable_characteristic() {
     setupData("build_rules_with_default_characteristic_and_disable_characteristic");
 
     Rules rules = provider.provide(ruleDao, debtModel, durations);
@@ -190,7 +190,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void fail_if_characteristic_not_found() throws Exception {
+  public void fail_if_characteristic_not_found() {
     setupData("fail_if_characteristic_not_found");
 
     try {
@@ -202,7 +202,7 @@ public class RulesProviderTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void fail_if_no_function() throws Exception {
+  public void fail_if_no_function() {
     setupData("fail_if_no_function");
 
     try {
index 131f3a0b6e48785391001bc09fbbbaacb2ce4453..1a26aeba91d3c353f80800d53cedf9f8c9998ac8 100644 (file)
@@ -33,7 +33,7 @@ public class UsedQProfilesTest {
   static final String PHP_JSON = "{\"key\":\"p2\",\"language\":\"php\",\"name\":\"Sonar Way\",\"rulesUpdatedAt\":\"2014-02-20T00:00:00+0000\"}";
 
   @Test
-  public void from_and_to_json() throws Exception {
+  public void from_and_to_json() {
     QProfile java = new QProfile().setKey("p1").setName("Sonar Way").setLanguage("java")
       .setRulesUpdatedAt(UtcDateUtils.parseDateTime("2014-01-15T00:00:00+0000"));
     QProfile php = new QProfile().setKey("p2").setName("Sonar Way").setLanguage("php")
@@ -50,7 +50,7 @@ public class UsedQProfilesTest {
   }
 
   @Test
-  public void do_not_duplicate_profiles() throws Exception {
+  public void do_not_duplicate_profiles() {
     QProfile java = new QProfile().setKey("p1").setName("Sonar Way").setLanguage("java");
     QProfile php = new QProfile().setKey("p2").setName("Sonar Way").setLanguage("php");
 
@@ -59,7 +59,7 @@ public class UsedQProfilesTest {
   }
 
   @Test
-  public void group_profiles_by_key() throws Exception {
+  public void group_profiles_by_key() {
     QProfile java = new QProfile().setKey("p1").setName("Sonar Way").setLanguage("java");
     QProfile php = new QProfile().setKey("p2").setName("Sonar Way").setLanguage("php");
 
index 8aa7f9a1485b65649d1f48e90138917500db7d96..bda4e1613bc68f089a93040c307d3f93b8e54e35 100644 (file)
@@ -166,7 +166,7 @@ public class DeprecatedProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFailIfUnexistingModuleFile() throws IOException {
+  public void shouldFailIfUnexistingModuleFile() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("The properties file of the module 'module1' does not exist: "
       + TestUtils.getResource(this.getClass(), "multi-module-with-unexisting-file").getAbsolutePath() + File.separator + "any-folder"
@@ -175,7 +175,7 @@ public class DeprecatedProjectReactorBuilderTest {
     loadProjectDefinition("multi-module-with-unexisting-file");
   }
 
-  private ProjectDefinition loadProjectDefinition(String projectFolder) throws IOException {
+  private ProjectDefinition loadProjectDefinition(String projectFolder) {
     Map<String, String> props = Maps.<String, String>newHashMap();
     Properties runnerProps = ProjectReactorBuilder.toProperties(TestUtils.getResource(this.getClass(), projectFolder + "/sonar-project.properties"));
     for (final String name : runnerProps.stringPropertyNames()) {
index 420d0641c36fc3063106a5a7eae9ac4656409927..dc6e6f3afb6a4c348f9affafa991d0d27706e117 100644 (file)
@@ -52,7 +52,7 @@ public class LanguageVerifierTest {
   }
 
   @Test
-  public void language_is_not_set() throws Exception {
+  public void language_is_not_set() {
     LanguageVerifier verifier = new LanguageVerifier(settings, languages, fs);
     verifier.start();
 
@@ -63,7 +63,7 @@ public class LanguageVerifierTest {
   }
 
   @Test
-  public void language_is_valid() throws Exception {
+  public void language_is_valid() {
     settings.setProperty("sonar.language", "java");
 
     LanguageVerifier verifier = new LanguageVerifier(settings, languages, fs);
@@ -76,7 +76,7 @@ public class LanguageVerifierTest {
   }
 
   @Test
-  public void language_is_not_valid() throws Exception {
+  public void language_is_not_valid() {
     thrown.expect(MessageException.class);
     thrown.expectMessage("You must install a plugin that supports the language 'php'");
 
index efc81035a6d22eb61221855f2babd5e29cf1c648..617149c60ecb4458dc19a67482b743e8a9f6034b 100644 (file)
@@ -44,7 +44,7 @@ public class ProjectReactorBuilderTest {
   public ExpectedException thrown = ExpectedException.none();
 
   @Test
-  public void shouldDefineSimpleProject() throws IOException {
+  public void shouldDefineSimpleProject() {
     ProjectDefinition projectDefinition = loadProjectDefinition("simple-project");
 
     assertThat(projectDefinition.getKey()).isEqualTo("com.foo.project");
@@ -57,7 +57,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFailIfUnexistingSourceDirectory() throws IOException {
+  public void shouldFailIfUnexistingSourceDirectory() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("The folder 'unexisting-source-dir' does not exist for 'com.foo.project' (base directory = "
       + TestUtils.getResource(this.getClass(), "simple-project-with-unexisting-source-dir") + ")");
@@ -66,14 +66,14 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void fail_if_sources_not_set() throws IOException {
+  public void fail_if_sources_not_set() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("You must define the following mandatory properties for 'com.foo.project': sonar.sources");
     loadProjectDefinition("simple-project-with-missing-source-dir");
   }
 
   @Test
-  public void shouldNotFailIfBlankSourceDirectory() throws IOException {
+  public void shouldNotFailIfBlankSourceDirectory() {
     loadProjectDefinition("simple-project-with-blank-source-dir");
   }
 
@@ -145,7 +145,7 @@ public class ProjectReactorBuilderTest {
 
   // SONAR-4876
   @Test
-  public void shouldDefineMultiModuleProjectWithModuleKey() throws IOException {
+  public void shouldDefineMultiModuleProjectWithModuleKey() {
     ProjectDefinition rootProject = loadProjectDefinition("multi-module-definitions-moduleKey");
 
     // CHECK ROOT
@@ -194,7 +194,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldDefineMultiModuleProjectWithBaseDir() throws IOException {
+  public void shouldDefineMultiModuleProjectWithBaseDir() {
     ProjectDefinition rootProject = loadProjectDefinition("multi-module-with-basedir");
     List<ProjectDefinition> modules = rootProject.getSubProjects();
     assertThat(modules.size()).isEqualTo(1);
@@ -202,7 +202,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFailIfUnexistingModuleBaseDir() throws IOException {
+  public void shouldFailIfUnexistingModuleBaseDir() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("The base directory of the module 'module1' does not exist: "
       + TestUtils.getResource(this.getClass(), "multi-module-with-unexisting-basedir").getAbsolutePath() + File.separator + "module1");
@@ -211,7 +211,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFailIfUnexistingSourceFolderInheritedInMultimodule() throws IOException {
+  public void shouldFailIfUnexistingSourceFolderInheritedInMultimodule() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("The folder 'unexisting-source-dir' does not exist for 'com.foo.project:module1' (base directory = "
       + TestUtils.getResource(this.getClass(), "multi-module-with-unexisting-source-dir").getAbsolutePath() + File.separator + "module1)");
@@ -220,12 +220,12 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldNotFailIfUnexistingTestBinLibFolderInheritedInMultimodule() throws IOException {
+  public void shouldNotFailIfUnexistingTestBinLibFolderInheritedInMultimodule() {
     loadProjectDefinition("multi-module-with-unexisting-test-bin-lib-dir");
   }
 
   @Test
-  public void shouldFailIfExplicitUnexistingTestFolder() throws IOException {
+  public void shouldFailIfExplicitUnexistingTestFolder() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("The folder 'tests' does not exist for 'com.foo.project' (base directory = "
       + TestUtils.getResource(this.getClass(), "simple-project-with-unexisting-test-dir").getAbsolutePath());
@@ -234,7 +234,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFailIfExplicitUnexistingBinaryFolder() throws IOException {
+  public void shouldFailIfExplicitUnexistingBinaryFolder() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("The folder 'bin' does not exist for 'com.foo.project' (base directory = "
       + TestUtils.getResource(this.getClass(), "simple-project-with-unexisting-binary").getAbsolutePath());
@@ -243,7 +243,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFailIfExplicitUnmatchingLibFolder() throws IOException {
+  public void shouldFailIfExplicitUnmatchingLibFolder() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("No files nor directories matching 'libs/*.txt' in directory "
       + TestUtils.getResource(this.getClass(), "simple-project-with-unexisting-lib").getAbsolutePath());
@@ -252,7 +252,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldGetLibDirectory() throws IOException {
+  public void shouldGetLibDirectory() {
     ProjectDefinition def = loadProjectDefinition("simple-project-with-lib-dir");
     assertThat(def.getLibraries()).hasSize(1);
     File libDir = new File(def.getLibraries().get(0));
@@ -261,7 +261,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFailIfExplicitUnexistingTestFolderOnModule() throws IOException {
+  public void shouldFailIfExplicitUnexistingTestFolderOnModule() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("The folder 'tests' does not exist for 'module1' (base directory = "
       + TestUtils.getResource(this.getClass(), "multi-module-with-explicit-unexisting-test-dir").getAbsolutePath() + File.separator + "module1)");
@@ -270,7 +270,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFailIfExplicitUnexistingBinaryFolderOnModule() throws IOException {
+  public void shouldFailIfExplicitUnexistingBinaryFolderOnModule() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("The folder 'bin' does not exist for 'module1' (base directory = "
       + TestUtils.getResource(this.getClass(), "multi-module-with-explicit-unexisting-binary-dir").getAbsolutePath() + File.separator + "module1)");
@@ -279,7 +279,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFailIfExplicitUnmatchingLibFolderOnModule() throws IOException {
+  public void shouldFailIfExplicitUnmatchingLibFolderOnModule() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("No files nor directories matching 'lib/*.jar' in directory "
       + TestUtils.getResource(this.getClass(), "multi-module-with-explicit-unexisting-lib").getAbsolutePath() + File.separator + "module1");
@@ -288,7 +288,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void multiModuleProperties() throws IOException {
+  public void multiModuleProperties() {
     ProjectDefinition projectDefinition = loadProjectDefinition("big-multi-module-definitions-all-in-root");
 
     assertThat(projectDefinition.getProperties().getProperty("module11.property")).isNull();
@@ -375,7 +375,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFilterFiles() throws Exception {
+  public void shouldFilterFiles() {
     File baseDir = TestUtils.getResource(this.getClass(), "shouldFilterFiles");
     assertThat(ProjectReactorBuilder.getLibraries(baseDir, "in*.txt")).hasSize(1);
     assertThat(ProjectReactorBuilder.getLibraries(baseDir, "*.txt")).hasSize(2);
@@ -384,7 +384,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldWorkWithAbsolutePath() throws Exception {
+  public void shouldWorkWithAbsolutePath() {
     File baseDir = new File("not-exists");
     String absolutePattern = TestUtils.getResource(this.getClass(), "shouldFilterFiles").getAbsolutePath() + "/in*.txt";
     assertThat(ProjectReactorBuilder.getLibraries(baseDir.getParentFile(), absolutePattern)).hasSize(1);
@@ -507,14 +507,14 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldFailToLoadPropertiesFile() throws Exception {
+  public void shouldFailToLoadPropertiesFile() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("Impossible to read the property file");
 
     ProjectReactorBuilder.toProperties(new File("foo.properties"));
   }
 
-  private ProjectDefinition loadProjectDefinition(String projectFolder) throws IOException {
+  private ProjectDefinition loadProjectDefinition(String projectFolder) {
     Map<String, String> props = loadProps(projectFolder);
     TaskProperties bootstrapProps = new TaskProperties(props, null);
     ProjectReactor projectReactor = new ProjectReactorBuilder(bootstrapProps).execute();
@@ -556,7 +556,7 @@ public class ProjectReactorBuilderTest {
   }
 
   @Test
-  public void shouldDefineProjectWithBuildDir() throws IOException {
+  public void shouldDefineProjectWithBuildDir() {
     ProjectDefinition rootProject = loadProjectDefinition("simple-project-with-build-dir");
     File buildDir = rootProject.getBuildDir();
     assertThat(buildDir).isDirectory().exists();
index c32b7b5cf0c4e60878acba746fdaab889a8223c4..504a734ff7f79218c861a5b0f7bb104c11f8140a 100644 (file)
@@ -52,7 +52,7 @@ public class ProjectReactorValidatorTest {
   }
 
   @Test
-  public void not_fail_if_provisioning_enforced_and_project_exists() throws Exception {
+  public void not_fail_if_provisioning_enforced_and_project_exists() {
     String key = "project-key";
     settings.setProperty(CoreProperties.CORE_PREVENT_AUTOMATIC_PROJECT_CREATION, true);
     when(resourceDao.findByKey(key)).thenReturn(mock(Component.class));
@@ -61,7 +61,7 @@ public class ProjectReactorValidatorTest {
   }
 
   @Test
-  public void not_fail_if_provisioning_enforced_and_project_with_branch_exists() throws Exception {
+  public void not_fail_if_provisioning_enforced_and_project_with_branch_exists() {
     String key = "project-key";
     settings.setProperty(CoreProperties.CORE_PREVENT_AUTOMATIC_PROJECT_CREATION, true);
     when(resourceDao.findByKey(key + ":branch")).thenReturn(mock(Component.class));
@@ -70,7 +70,7 @@ public class ProjectReactorValidatorTest {
   }
 
   @Test(expected = SonarException.class)
-  public void fail_if_provisioning_enforced_and_project_not_provisioned() throws Exception {
+  public void fail_if_provisioning_enforced_and_project_not_provisioned() {
     String key = "project-key";
     settings.setProperty(CoreProperties.CORE_PREVENT_AUTOMATIC_PROJECT_CREATION, true);
     when(resourceDao.findByKey(key)).thenReturn(null);
@@ -80,7 +80,7 @@ public class ProjectReactorValidatorTest {
 
   // SONAR-4692
   @Test(expected = SonarException.class)
-  public void fail_if_module_part_of_another_project() throws Exception {
+  public void fail_if_module_part_of_another_project() {
     String rootProjectKey = "project-key";
     String moduleKey = "module-key";
     ResourceDto rootResource = mock(ResourceDto.class);
@@ -95,7 +95,7 @@ public class ProjectReactorValidatorTest {
 
   // SONAR-4692
   @Test
-  public void not_fail_if_module_part_of_same_project() throws Exception {
+  public void not_fail_if_module_part_of_same_project() {
     String rootProjectKey = "project-key";
     String moduleKey = "module-key";
     ResourceDto rootResource = mock(ResourceDto.class);
@@ -110,7 +110,7 @@ public class ProjectReactorValidatorTest {
 
   // SONAR-4692
   @Test
-  public void not_fail_if_new_module() throws Exception {
+  public void not_fail_if_new_module() {
     String rootProjectKey = "project-key";
     String moduleKey = "module-key";
 
index ad3dfffc4915dc551c0c8465db3b913f12f612c7..a2ce7e460b3d9d1e524a30d89e9e9821219379c3 100644 (file)
@@ -34,7 +34,7 @@ public class AdditionalFilePredicatesTest {
   public TemporaryFolder temp = new TemporaryFolder();
 
   @Test
-  public void key() throws Exception {
+  public void key() {
     FilePredicate predicate = new AdditionalFilePredicates.KeyPredicate("struts:Action.java");
 
     DefaultInputFile inputFile = new DeprecatedDefaultInputFile("struts", "Action.java");
index 7f954c405a2faaa0bb522283b05d0bc5ced11124..c33afe1f59fd512dace3653ca71a6a938720b366 100644 (file)
@@ -149,7 +149,7 @@ public class DefaultModuleFileSystemTest {
   }
 
   @Test
-  public void should_index() throws Exception {
+  public void should_index() {
     DefaultModuleFileSystem fs = new DefaultModuleFileSystem(moduleInputFileCache,
       new Project("foo"), settings, fileIndexer, initializer, componentIndexer);
 
index 3235301f031251105ccf13c314bb1ced6ce805a3..2797d65ea20d3183e54c7f944797a9ee65f37bcd 100644 (file)
@@ -46,7 +46,7 @@ public class DeprecatedFileFiltersTest {
   FileSystemFilter filter = mock(FileSystemFilter.class);
 
   @Test
-  public void no_filters() throws Exception {
+  public void no_filters() {
     DeprecatedFileFilters filters = new DeprecatedFileFilters();
 
     InputFile inputFile = new DeprecatedDefaultInputFile("foo", "src/main/java/Foo.java");
index c5bd36cddf5a9f95b331b08d8698f79b2929301e..e638bd42efb02f7beb538e8559ab2a2d847753c0 100644 (file)
@@ -123,7 +123,7 @@ public class ExclusionFiltersTest {
   }
 
   @Test
-  public void trim_pattern() throws IOException {
+  public void trim_pattern() {
     Settings settings = new Settings();
     settings.setProperty(CoreProperties.PROJECT_EXCLUSIONS_PROPERTY, "   **/*Dao.java   ");
     ExclusionFilters filter = new ExclusionFilters(new FileExclusions(settings));
index 0c83abfa01e0a4e94073e310d5e8ae6895a60c3a..60f85a52e173f8bcf7c4d357c4fee54968a0b204 100644 (file)
@@ -32,7 +32,7 @@ import static org.mockito.Mockito.mock;
 
 public class InputFileBuilderFactoryTest {
   @Test
-  public void create_builder() throws Exception {
+  public void create_builder() {
     PathResolver pathResolver = new PathResolver();
     LanguageDetectionFactory langDetectionFactory = mock(LanguageDetectionFactory.class, Mockito.RETURNS_MOCKS);
     StatusDetectionFactory statusDetectionFactory = mock(StatusDetectionFactory.class, Mockito.RETURNS_MOCKS);
index f14e2a9b957822bf0858d10eff377d17789ed5cf..84b24fa9355b14bc383ceeabe40d4560145a4e0f 100644 (file)
@@ -39,7 +39,7 @@ public class InputPathCacheTest {
   public TemporaryFolder temp = new TemporaryFolder();
 
   @Before
-  public void start() throws Exception {
+  public void start() {
   }
 
   @After
index 95d3631eaa57faa4020d7e4243223392b1149b04..65ae7125c60b4870877cd051265d6b0e6d4a9ad5 100644 (file)
@@ -122,7 +122,7 @@ public class LanguageDetectionTest {
   }
 
   @Test
-  public void fail_if_invalid_language() throws Exception {
+  public void fail_if_invalid_language() {
     thrown.expect(MessageException.class);
     thrown.expectMessage("No language is installed with key 'unknown'. Please update property 'sonar.language'");
 
index cc5feed7883e2a31e46a99fba7d28d0c6dd76cb0..c8db34b45428022c626b7dc00544e979d4ef287a 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 public class StatusDetectionTest {
   @Test
-  public void detect_status() throws Exception {
+  public void detect_status() {
     ProjectRepositories ref = new ProjectRepositories();
     ref.addFileData("foo", "src/Foo.java", new FileData("ABCDE", true));
     ref.addFileData("foo", "src/Bar.java", new FileData("FGHIJ", true));
index fce979b23c409af1d8e0a6c41b0418c845eebc40..598f2a5ce2e8acf1afdf0ce0795ba1e23342b656 100644 (file)
@@ -69,7 +69,7 @@ public class MeasureCacheTest {
   private MeasureCache cache;
 
   @Before
-  public void start() throws Exception {
+  public void start() {
     caches = CachesTest.createCacheOnTemp(temp);
     caches.start();
     metricFinder = mock(MetricFinder.class);
@@ -84,7 +84,7 @@ public class MeasureCacheTest {
   }
 
   @Test
-  public void should_add_measure() throws Exception {
+  public void should_add_measure() {
     Project p = new Project("struts");
 
     assertThat(cache.entries()).hasSize(0);
@@ -114,7 +114,7 @@ public class MeasureCacheTest {
   }
 
   @Test
-  public void should_add_measure_with_big_data() throws Exception {
+  public void should_add_measure_with_big_data() {
     Project p = new Project("struts");
 
     assertThat(cache.entries()).hasSize(0);
@@ -153,7 +153,7 @@ public class MeasureCacheTest {
    * This test fails with stock PersisitIt.
    */
   @Test
-  public void should_add_measure_with_too_big_data_for_persistit_pre_patch() throws Exception {
+  public void should_add_measure_with_too_big_data_for_persistit_pre_patch() {
     Project p = new Project("struts");
 
     assertThat(cache.entries()).hasSize(0);
@@ -188,7 +188,7 @@ public class MeasureCacheTest {
   }
 
   @Test
-  public void should_add_measure_with_too_big_data_for_persistit() throws Exception {
+  public void should_add_measure_with_too_big_data_for_persistit() {
     Project p = new Project("struts");
 
     assertThat(cache.entries()).hasSize(0);
@@ -210,7 +210,7 @@ public class MeasureCacheTest {
   }
 
   @Test
-  public void should_add_measure_with_same_metric() throws Exception {
+  public void should_add_measure_with_same_metric() {
     Project p = new Project("struts");
 
     assertThat(cache.entries()).hasSize(0);
@@ -231,7 +231,7 @@ public class MeasureCacheTest {
   }
 
   @Test
-  public void should_get_measures() throws Exception {
+  public void should_get_measures() {
     Project p = new Project("struts");
     Resource dir = Directory.create("foo/bar").setEffectiveKey("struts:foo/bar");
     Resource file1 = Directory.create("foo/bar/File1.txt").setEffectiveKey("struts:foo/bar/File1.txt");
index 12d5e00dc0cd6b4eeecec654eab3d8d2ba7bdc81..968544e84facb48f92b787dfff5781833a639b7d 100644 (file)
@@ -60,14 +60,14 @@ public class SensorOptimizerTest {
   }
 
   @Test
-  public void should_run_analyzer_with_no_metadata() throws Exception {
+  public void should_run_analyzer_with_no_metadata() {
     DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor();
 
     assertThat(optimizer.shouldExecute(descriptor)).isTrue();
   }
 
   @Test
-  public void should_optimize_on_language() throws Exception {
+  public void should_optimize_on_language() {
     DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor()
       .onlyOnLanguages("java", "php");
     assertThat(optimizer.shouldExecute(descriptor)).isFalse();
@@ -77,7 +77,7 @@ public class SensorOptimizerTest {
   }
 
   @Test
-  public void should_optimize_on_type() throws Exception {
+  public void should_optimize_on_type() {
     DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor()
       .onlyOnFileType(InputFile.Type.MAIN);
     assertThat(optimizer.shouldExecute(descriptor)).isFalse();
@@ -90,7 +90,7 @@ public class SensorOptimizerTest {
   }
 
   @Test
-  public void should_optimize_on_both_type_and_language() throws Exception {
+  public void should_optimize_on_both_type_and_language() {
     DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor()
       .onlyOnLanguages("java", "php")
       .onlyOnFileType(InputFile.Type.MAIN);
@@ -105,7 +105,7 @@ public class SensorOptimizerTest {
   }
 
   @Test
-  public void should_optimize_on_repository() throws Exception {
+  public void should_optimize_on_repository() {
     DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor()
       .createIssuesForRuleRepositories("squid");
     assertThat(optimizer.shouldExecute(descriptor)).isFalse();
@@ -129,7 +129,7 @@ public class SensorOptimizerTest {
   }
 
   @Test
-  public void should_optimize_on_settings() throws Exception {
+  public void should_optimize_on_settings() {
     DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor()
       .requireProperty("sonar.foo.reportPath");
     assertThat(optimizer.shouldExecute(descriptor)).isFalse();
@@ -139,7 +139,7 @@ public class SensorOptimizerTest {
   }
 
   @Test
-  public void should_disabled_in_preview() throws Exception {
+  public void should_disabled_in_preview() {
     DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor()
       .disabledInPreview();
     assertThat(optimizer.shouldExecute(descriptor)).isTrue();
index 7b3d3987bf34ecdadff32455019090234231fbd1..4ef06e4a0e5a10a3f15ac7ae65eaf35818327c83 100644 (file)
@@ -40,7 +40,7 @@ public class DefaultHighlightableTest {
   public ExpectedException throwable = ExpectedException.none();
 
   @Test
-  public void should_store_highlighting_rules() throws Exception {
+  public void should_store_highlighting_rules() {
     SensorStorage sensorStorage = mock(SensorStorage.class);
     DefaultInputFile inputFile = new DefaultInputFile("foo", "src/Foo.php")
       .initMetadata(new FileMetadata().readMetadata(new StringReader("azerty\nbla bla")));
index a0489a7c2098c1c0f537454a60376a71bffd588d..385ce1bbd6a89f2f0a2055343a435b2d9c452e7f 100644 (file)
@@ -47,7 +47,7 @@ public class DefaultSymbolTableTest {
   }
 
   @Test
-  public void should_order_symbol_and_references() throws Exception {
+  public void should_order_symbol_and_references() {
 
     Symbolizable.SymbolTableBuilder symbolTableBuilder = new DefaultSymbolTable.Builder(inputFile);
     Symbol firstSymbol = symbolTableBuilder.newSymbol(10, 20);
@@ -62,7 +62,7 @@ public class DefaultSymbolTableTest {
   }
 
   @Test
-  public void should_reject_reference_conflicting_with_declaration() throws Exception {
+  public void should_reject_reference_conflicting_with_declaration() {
     throwable.expect(UnsupportedOperationException.class);
 
     Symbolizable.SymbolTableBuilder symbolTableBuilder = new DefaultSymbolTable.Builder(inputFile);
index d3b1018ace578768f3d990341a669c25330f1fe7..21803da6c85bead1e8c379ceb6fa634d094f013c 100644 (file)
@@ -40,7 +40,7 @@ import static org.mockito.Mockito.verify;
 public class DefaultSymbolizableTest {
 
   @Test
-  public void should_update_cache_when_done() throws Exception {
+  public void should_update_cache_when_done() {
 
     DefaultSensorStorage sensorStorage = mock(DefaultSensorStorage.class);
     DefaultInputFile inputFile = new DefaultInputFile("foo", "src/Foo.php")
index 893957a80a5760ee219ea0bf699b1296a0c1b2c9..e98f3bad906ed4aecbcca059ed7b12389fd22900 100644 (file)
@@ -38,7 +38,7 @@ import static org.mockito.Mockito.when;
 public class HighlightableBuilderTest {
 
   @Test
-  public void should_load_default_perspective() throws Exception {
+  public void should_load_default_perspective() {
     Resource file = File.create("foo.c").setEffectiveKey("myproject:path/to/foo.c");
     Component component = new ResourceComponent(file);
 
index 16c4fe669a76ef035531996937c4a0e689a16a2f..8a1d3cbe580e5766482107879418eedfd5941cbf 100644 (file)
@@ -40,7 +40,7 @@ import static org.mockito.Mockito.when;
 public class SymbolizableBuilderTest {
 
   @Test
-  public void should_load_perspective() throws Exception {
+  public void should_load_perspective() {
     Resource file = File.create("foo.c").setEffectiveKey("myproject:path/to/foo.c");
     Component component = new ResourceComponent(file);
 
index 40c9df1e3f9d60881850596d663c7f43ded4a439..ce1dc931ff60cdbf301dc0fdaa1ae84dd6d50aba 100644 (file)
@@ -29,13 +29,13 @@ import static org.junit.Assert.fail;
 public class UtcDateUtilsTest {
 
   @Test
-  public void parse_then_format() throws Exception {
+  public void parse_then_format() {
     Date date = UtcDateUtils.parseDateTime("2014-01-14T14:00:00+0200");
     assertThat(UtcDateUtils.formatDateTime(date)).isEqualTo("2014-01-14T12:00:00+0000");
   }
 
   @Test
-  public void fail_if_bad_format() throws Exception {
+  public void fail_if_bad_format() {
     try {
       UtcDateUtils.parseDateTime("2014-01-14");
       fail();
index ddc26aaa064464d5e2851ab37f174048aff97243..5383b6472d16259ddd58bd27dc4b5f07e1e243f7 100644 (file)
@@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ComponentDtoTest {
 
   @Test
-  public void setters_and_getters() throws Exception {
+  public void setters_and_getters() {
     ComponentDto componentDto = new ComponentDto()
       .setId(1L)
       .setKey("org.struts:struts-core:src/org/struts/RequestContext.java")
@@ -59,7 +59,7 @@ public class ComponentDtoTest {
   }
 
   @Test
-  public void equals_and_hashcode() throws Exception {
+  public void equals_and_hashcode() {
     ComponentDto dto = new ComponentDto().setId(1L);
     ComponentDto dtoWithSameId = new ComponentDto().setId(1L);
     ComponentDto dtoWithDifferentId = new ComponentDto().setId(2L);
@@ -74,13 +74,13 @@ public class ComponentDtoTest {
   }
 
   @Test
-  public void toString_does_not_fail_if_empty() throws Exception {
+  public void toString_does_not_fail_if_empty() {
     ComponentDto dto = new ComponentDto();
     assertThat(dto.toString()).isNotEmpty();
   }
 
   @Test
-  public void is_root_project() throws Exception {
+  public void is_root_project() {
     assertThat(new ComponentDto().setModuleUuid("ABCD").isRootProject()).isFalse();
     assertThat(new ComponentDto().setModuleUuid("ABCD").setScope(Scopes.DIRECTORY).isRootProject()).isFalse();
     assertThat(new ComponentDto().setModuleUuid(null).setScope(Scopes.PROJECT).setQualifier(Qualifiers.PROJECT).isRootProject()).isTrue();
index 2de2110104f2c2175bee53d8bc2b9695bca370f4..d699dc6a30e0e9f1cf3edcbb64b784eebfee9dba 100644 (file)
@@ -34,7 +34,7 @@ import static org.mockito.Mockito.when;
 public class GraphPerspectiveBuilderTest {
 
   @Test
-  public void should_return_null_on_null_component() throws Exception {
+  public void should_return_null_on_null_component() {
 
     String componentKey = "org.foo.Bar";
 
@@ -55,7 +55,7 @@ public class GraphPerspectiveBuilderTest {
   }
 
   @Test
-  public void should_load_perspective() throws Exception {
+  public void should_load_perspective() {
 
     ScanGraph graph = ScanGraph.create();
     MutablePerspective expectedPerspective = mock(MutablePerspective.class);
@@ -73,7 +73,7 @@ public class GraphPerspectiveBuilderTest {
   }
 
   @Test
-  public void should_create_perspective_when_loaded_one_is_null() throws Exception {
+  public void should_create_perspective_when_loaded_one_is_null() {
 
     String perspectiveKey = "perspectiveKey";
 
index 35d53aba1bfd01155578b52a56f1c8b3204547f0..bdd39ad8b6193ae815a3f0fc72643afea9ac3dc9 100644 (file)
@@ -54,7 +54,7 @@ public class DefaultPurgeTaskTest {
   private PurgeProfiler profiler;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     this.purgeDao = mock(PurgeDao.class);
     this.resourceDao = mock(ResourceDao.class);
     when(resourceDao.getResource(anyLong())).thenReturn(new ResourceDto().setQualifier(Qualifiers.PROJECT).setUuid("1").setId(1L));
@@ -140,7 +140,7 @@ public class DefaultPurgeTaskTest {
   }
 
   @Test
-  public void call_dao_delete_when_deleting() throws Exception {
+  public void call_dao_delete_when_deleting() {
     when(resourceDao.getResource(123L)).thenReturn(new ResourceDto().setId(123L).setUuid("A"));
 
     sut.delete(123L);
index 4f3ec24bae7291bf1c3cb5e56d29b385bd840dff..1d03f781ffb2b7a7ca8fe6f66de95b417de3319e 100644 (file)
@@ -37,13 +37,13 @@ public class ActiveDashboardDaoTest {
   private ActiveDashboardDao dao;
 
   @Before
-  public void createDao() throws Exception {
+  public void createDao() {
     dbTester.truncateTables();
     dao = new ActiveDashboardDao(dbTester.myBatis());
   }
 
   @Test
-  public void shouldInsert() throws Exception {
+  public void shouldInsert() {
     dbTester.prepareDbUnit(getClass(), "shouldInsert.xml");
 
     ActiveDashboardDto dashboard = new ActiveDashboardDto();
@@ -56,7 +56,7 @@ public class ActiveDashboardDaoTest {
   }
 
   @Test
-  public void shouldInsertWithNoUser() throws Exception {
+  public void shouldInsertWithNoUser() {
     dbTester.prepareDbUnit(getClass(), "shouldInsert.xml");
 
     ActiveDashboardDto dashboard = new ActiveDashboardDto();
@@ -68,7 +68,7 @@ public class ActiveDashboardDaoTest {
   }
 
   @Test
-  public void shouldGetMaxOrderIndexForNullUser() throws Exception {
+  public void shouldGetMaxOrderIndexForNullUser() {
     dbTester.prepareDbUnit(getClass(), "shouldGetMaxOrderIndexForNullUser.xml");
 
     int index = dao.selectMaxOrderIndexForNullUser();
@@ -77,7 +77,7 @@ public class ActiveDashboardDaoTest {
   }
 
   @Test
-  public void shouldGetZeroMaxOrderIndex() throws Exception {
+  public void shouldGetZeroMaxOrderIndex() {
     dbTester.prepareDbUnit(getClass(), "empty.xml");
 
     int index = dao.selectMaxOrderIndexForNullUser();
@@ -86,28 +86,28 @@ public class ActiveDashboardDaoTest {
   }
 
   @Test
-  public void should_get_dashboards_for_anonymous() throws Exception {
+  public void should_get_dashboards_for_anonymous() {
     dbTester.prepareDbUnit(getClass(), "shouldSelectDashboardsForAnonymous.xml");
 
     assertThat(dao.selectGlobalDashboardsForUserLogin(null)).hasSize(2).extracting("id").containsExactly(2L, 1L);
   }
 
   @Test
-  public void should_get_dashboards_for_user() throws Exception {
+  public void should_get_dashboards_for_user() {
     dbTester.prepareDbUnit(getClass(), "shouldSelectDashboardsForUser.xml");
 
     assertThat(dao.selectGlobalDashboardsForUserLogin("obiwan")).hasSize(2).extracting("id").containsExactly(2L, 1L);
   }
 
   @Test
-  public void should_get_project_dashboards_for_anonymous() throws Exception {
+  public void should_get_project_dashboards_for_anonymous() {
     dbTester.prepareDbUnit(getClass(), "shouldSelectProjectDashboardsForAnonymous.xml");
 
     assertThat(dao.selectProjectDashboardsForUserLogin(null)).hasSize(2).extracting("id").containsExactly(2L, 1L);
   }
 
   @Test
-  public void should_get_project_dashboards_for_user() throws Exception {
+  public void should_get_project_dashboards_for_user() {
     dbTester.prepareDbUnit(getClass(), "shouldSelectProjectDashboardsForUser.xml");
 
     assertThat(dao.selectProjectDashboardsForUserLogin("obiwan")).hasSize(2).extracting("id").containsExactly(2L, 1L);
index f4a76577d5d2ec71e0379ad70262bfa1741a1488..f7ddd44cbf2e7a3625116317e3b04ed0126db7e1 100644 (file)
@@ -94,7 +94,7 @@ public class DashboardDaoTest {
   }
 
   @Test
-  public void shouldInsertWithNullableColumns() throws Exception {
+  public void shouldInsertWithNullableColumns() {
     dbTester.prepareDbUnit(getClass(), "shouldInsert.xml");
 
     DashboardDto dashboardDto = new DashboardDto();
index 90bb71c54dd67d47588ca2775a7fc07b0757545e..ba7a89ce431dd13ba009060c9cbae9b41144978f 100644 (file)
@@ -34,12 +34,12 @@ public class DuplicationDaoTest extends AbstractDaoTestCase {
   private DuplicationDao dao;
 
   @Before
-  public void createDao() throws Exception {
+  public void createDao() {
     dao = new DuplicationDao(getMyBatis());
   }
 
   @Test
-  public void shouldGetByHash() throws Exception {
+  public void shouldGetByHash() {
     setupData("shouldGetByHash");
 
     List<DuplicationUnitDto> blocks = dao.selectCandidates(10, 7, "java");
@@ -58,7 +58,7 @@ public class DuplicationDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void shouldInsert() throws Exception {
+  public void shouldInsert() {
     setupData("shouldInsert");
 
     dao.insert(Arrays.asList(new DuplicationUnitDto(1, 2, "bb", 0, 1, 2)));
index 233f086e9768587dce96675dc790e024ea332c26..c877a1493bcda6c2f5dded680b74edceec74257c 100644 (file)
@@ -39,7 +39,7 @@ import java.util.Set;
 public class GraphsonReaderTest {
 
   @Test
-  public void inputGraphModeExtended() throws Exception {
+  public void inputGraphModeExtended() {
     TinkerGraph graph = new TinkerGraph();
 
     String json = "{ \"mode\":\"EXTENDED\", \"vertices\": [ {\"_id\":1, \"_type\":\"vertex\", \"test\": { \"type\":\"string\", \"value\":\"please work\"}, \"testlist\":{\"type\":\"list\", \"value\":[{\"type\":\"int\", \"value\":1}, {\"type\":\"int\",\"value\":2}, {\"type\":\"int\",\"value\":3}, {\"type\":\"unknown\",\"value\":null}]}, \"testmap\":{\"type\":\"map\", \"value\":{\"big\":{\"type\":\"long\", \"value\":10000000000}, \"small\":{\"type\":\"double\", \"value\":0.4954959595959}, \"nullKey\":{\"type\":\"unknown\", \"value\":null}}}}, {\"_id\":2, \"_type\":\"vertex\", \"testagain\":{\"type\":\"string\", \"value\":\"please work again\"}}], \"edges\":[{\"_id\":100, \"_type\":\"edge\", \"_outV\":1, \"_inV\":2, \"_label\":\"works\", \"teste\": {\"type\":\"string\", \"value\":\"please worke\"}, \"keyNull\":{\"type\":\"unknown\", \"value\":null}}]}";
@@ -88,7 +88,7 @@ public class GraphsonReaderTest {
   }
 
   @Test
-  public void inputGraphModeNormal() throws Exception {
+  public void inputGraphModeNormal() {
     TinkerGraph graph = new TinkerGraph();
 
     String json = "{ \"mode\":\"NORMAL\",\"vertices\": [ {\"_id\":1, \"_type\":\"vertex\", \"test\": \"please work\", \"testlist\":[1, 2, 3, null], \"testmap\":{\"big\":10000000000, \"small\":0.4954959595959, \"nullKey\":null}}, {\"_id\":2, \"_type\":\"vertex\", \"testagain\":\"please work again\"}], \"edges\":[{\"_id\":100, \"_type\":\"edge\", \"_outV\":1, \"_inV\":2, \"_label\":\"works\", \"teste\": \"please worke\", \"keyNull\":null}]}";
@@ -137,7 +137,7 @@ public class GraphsonReaderTest {
   }
 
   @Test
-  public void inputGraphModeCompact() throws Exception {
+  public void inputGraphModeCompact() {
     TinkerGraph graph = new TinkerGraph();
 
     String json = "{ \"mode\":\"COMPACT\",\"vertices\": [ {\"_id\":1, \"test\": \"please work\", \"testlist\":[1, 2, 3, null], \"testmap\":{\"big\":10000000000, \"small\":0.4954959595959, \"nullKey\":null}}, {\"_id\":2, \"testagain\":\"please work again\"}], \"edges\":[{\"_id\":100, \"_outV\":1, \"_inV\":2, \"_label\":\"works\", \"teste\": \"please worke\", \"keyNull\":null}]}";
index 607ffc3d0a00094591cdbf9930e07390074f9e6f..6fb3611a9ef55e358e4531a41a4f299a81c2bb2e 100644 (file)
@@ -994,7 +994,7 @@ public class GraphsonUtilTest {
   }
 
   @Test
-  public void vertexFromJsonIgnoreKeyValid() throws Exception {
+  public void vertexFromJsonIgnoreKeyValid() {
     Graph g = new TinkerGraph();
     ElementFactory factory = new ElementFactory(g);
 
index 57db8e33aef84297158aa56b150a10a9472a9b12..971a7573965b15e6e2a1f650061b03c8cbba5e5a 100644 (file)
@@ -69,7 +69,7 @@ public class I18nClassloaderTest {
   }
 
   @Test
-  public void override_toString() throws ClassNotFoundException {
+  public void override_toString() {
     assertThat(i18nClassloader.toString()).isEqualTo("i18n-classloader");
   }
 
index 2132f0b32fe0d40209b543396724af79c667a3c7..9950e249cb6f9faaa6c2b3572386d41588882a72 100644 (file)
@@ -36,7 +36,7 @@ public class ActionPlanDeadlineComparatorTest {
   ActionPlan noDeadline = new DefaultActionPlan().setDeadLine(null);
 
   @Test
-  public void compare_plans_with_deadlines() throws Exception {
+  public void compare_plans_with_deadlines() {
     List<ActionPlan> plans = Arrays.asList(shortTerm, longTerm);
     Collections.sort(plans, new ActionPlanDeadlineComparator());
     assertThat(plans).containsSequence(shortTerm, longTerm);
@@ -47,7 +47,7 @@ public class ActionPlanDeadlineComparatorTest {
   }
 
   @Test
-  public void end_with_plans_without_deadline() throws Exception {
+  public void end_with_plans_without_deadline() {
     List<ActionPlan> plans = Arrays.asList(noDeadline, longTerm, shortTerm);
     Collections.sort(plans, new ActionPlanDeadlineComparator());
     assertThat(plans).containsSequence(shortTerm, longTerm, noDeadline);
index d3475234280295a5e51ced59a874a402ba79d070..a84e111183615267265dee715e88e9ba3767f22b 100644 (file)
@@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class DefaultIssueBuilderTest {
 
   @Test
-  public void build_new_issue() throws Exception {
+  public void build_new_issue() {
     String componentKey = "org.apache.struts:struts-core:Action.java";
     String projectKey = "org.apache.struts";
     DefaultIssue issue = (DefaultIssue) new DefaultIssueBuilder()
index 0ff082750e315ce34b5b753b5734320a9cced8e9..8a4181f47b5391f04a8c49ab9d40250a6d2ff339 100644 (file)
@@ -42,12 +42,12 @@ public class IssueUpdaterTest {
   IssueUpdater updater;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     updater = new IssueUpdater();
   }
 
   @Test
-  public void assign() throws Exception {
+  public void assign() {
     User user = new DefaultUser().setLogin("emmerik").setName("Emmerik");
 
     boolean updated = updater.assign(issue, user, context);
@@ -60,7 +60,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void unassign() throws Exception {
+  public void unassign() {
     issue.setAssignee("morgan");
     boolean updated = updater.assign(issue, null, context);
     assertThat(updated).isTrue();
@@ -72,7 +72,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void change_assignee() throws Exception {
+  public void change_assignee() {
     User user = new DefaultUser().setLogin("emmerik").setName("Emmerik");
 
     issue.setAssignee("morgan");
@@ -86,7 +86,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_change_assignee() throws Exception {
+  public void not_change_assignee() {
     User user = new DefaultUser().setLogin("morgan").setName("Morgan");
 
     issue.setAssignee("morgan");
@@ -97,7 +97,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_severity() throws Exception {
+  public void set_severity() {
     boolean updated = updater.setSeverity(issue, "BLOCKER", context);
     assertThat(updated).isTrue();
     assertThat(issue.severity()).isEqualTo("BLOCKER");
@@ -110,7 +110,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_past_severity() throws Exception {
+  public void set_past_severity() {
     issue.setSeverity("BLOCKER");
     boolean updated = updater.setPastSeverity(issue, "INFO", context);
     assertThat(updated).isTrue();
@@ -123,7 +123,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void update_severity() throws Exception {
+  public void update_severity() {
     issue.setSeverity("BLOCKER");
     boolean updated = updater.setSeverity(issue, "MINOR", context);
 
@@ -136,7 +136,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_change_severity() throws Exception {
+  public void not_change_severity() {
     issue.setSeverity("MINOR");
     boolean updated = updater.setSeverity(issue, "MINOR", context);
     assertThat(updated).isFalse();
@@ -145,7 +145,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_revert_manual_severity() throws Exception {
+  public void not_revert_manual_severity() {
     issue.setSeverity("MINOR").setManualSeverity(true);
     try {
       updater.setSeverity(issue, "MAJOR", context);
@@ -155,7 +155,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_manual_severity() throws Exception {
+  public void set_manual_severity() {
     issue.setSeverity("BLOCKER");
     boolean updated = updater.setManualSeverity(issue, "MINOR", context);
 
@@ -169,7 +169,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_change_manual_severity() throws Exception {
+  public void not_change_manual_severity() {
     issue.setSeverity("MINOR").setManualSeverity(true);
     boolean updated = updater.setManualSeverity(issue, "MINOR", context);
     assertThat(updated).isFalse();
@@ -178,7 +178,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_line() throws Exception {
+  public void set_line() {
     boolean updated = updater.setLine(issue, 123);
     assertThat(updated).isTrue();
     assertThat(issue.line()).isEqualTo(123);
@@ -188,7 +188,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_past_line() throws Exception {
+  public void set_past_line() {
     issue.setLine(42);
     boolean updated = updater.setPastLine(issue, 123);
     assertThat(updated).isTrue();
@@ -200,7 +200,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_change_line() throws Exception {
+  public void not_change_line() {
     issue.setLine(123);
     boolean updated = updater.setLine(issue, 123);
     assertThat(updated).isFalse();
@@ -210,7 +210,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_resolution() throws Exception {
+  public void set_resolution() {
     boolean updated = updater.setResolution(issue, "OPEN", context);
     assertThat(updated).isTrue();
     assertThat(issue.resolution()).isEqualTo("OPEN");
@@ -222,7 +222,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_change_resolution() throws Exception {
+  public void not_change_resolution() {
     issue.setResolution("FIXED");
     boolean updated = updater.setResolution(issue, "FIXED", context);
     assertThat(updated).isFalse();
@@ -232,7 +232,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_status() throws Exception {
+  public void set_status() {
     boolean updated = updater.setStatus(issue, "OPEN", context);
     assertThat(updated).isTrue();
     assertThat(issue.status()).isEqualTo("OPEN");
@@ -244,7 +244,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_change_status() throws Exception {
+  public void not_change_status() {
     issue.setStatus("CLOSED");
     boolean updated = updater.setStatus(issue, "CLOSED", context);
     assertThat(updated).isFalse();
@@ -254,7 +254,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_new_attribute_value() throws Exception {
+  public void set_new_attribute_value() {
     boolean updated = updater.setAttribute(issue, "JIRA", "FOO-123", context);
     assertThat(updated).isTrue();
     assertThat(issue.attribute("JIRA")).isEqualTo("FOO-123");
@@ -265,7 +265,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void unset_attribute() throws Exception {
+  public void unset_attribute() {
     issue.setAttribute("JIRA", "FOO-123");
     boolean updated = updater.setAttribute(issue, "JIRA", null, context);
     assertThat(updated).isTrue();
@@ -277,7 +277,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_update_attribute() throws Exception {
+  public void not_update_attribute() {
     issue.setAttribute("JIRA", "FOO-123");
     boolean updated = updater.setAttribute(issue, "JIRA", "FOO-123", context);
     assertThat(updated).isFalse();
@@ -285,7 +285,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void plan_with_no_existing_plan() throws Exception {
+  public void plan_with_no_existing_plan() {
     ActionPlan newActionPlan = DefaultActionPlan.create("newName");
 
     boolean updated = updater.plan(issue, newActionPlan, context);
@@ -299,7 +299,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void plan_with_existing_plan() throws Exception {
+  public void plan_with_existing_plan() {
     issue.setActionPlanKey("formerActionPlan");
 
     ActionPlan newActionPlan = DefaultActionPlan.create("newName").setKey("newKey");
@@ -315,7 +315,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void unplan() throws Exception {
+  public void unplan() {
     issue.setActionPlanKey("formerActionPlan");
 
     boolean updated = updater.plan(issue, null, context);
@@ -329,7 +329,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_plan_again() throws Exception {
+  public void not_plan_again() {
     issue.setActionPlanKey("existingActionPlan");
 
     ActionPlan newActionPlan = DefaultActionPlan.create("existingActionPlan").setKey("existingActionPlan");
@@ -341,7 +341,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_effort_to_fix() throws Exception {
+  public void set_effort_to_fix() {
     boolean updated = updater.setEffortToFix(issue, 3.14, context);
     assertThat(updated).isTrue();
     assertThat(issue.isChanged()).isTrue();
@@ -350,7 +350,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_set_effort_to_fix_if_unchanged() throws Exception {
+  public void not_set_effort_to_fix_if_unchanged() {
     issue.setEffortToFix(3.14);
     boolean updated = updater.setEffortToFix(issue, 3.14, context);
     assertThat(updated).isFalse();
@@ -360,7 +360,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_past_effort() throws Exception {
+  public void set_past_effort() {
     issue.setEffortToFix(3.14);
     boolean updated = updater.setPastEffortToFix(issue, 1.0, context);
     assertThat(updated).isTrue();
@@ -372,7 +372,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_past_technical_debt() throws Exception {
+  public void set_past_technical_debt() {
     Duration newDebt = Duration.create(15 * 8 * 60);
     Duration previousDebt = Duration.create(10 * 8 * 60);
     issue.setDebt(newDebt);
@@ -387,7 +387,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_past_technical_debt_without_previous_value() throws Exception {
+  public void set_past_technical_debt_without_previous_value() {
     Duration newDebt = Duration.create(15 * 8 * 60);
     issue.setDebt(newDebt);
     boolean updated = updater.setPastTechnicalDebt(issue, null, context);
@@ -401,7 +401,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_past_technical_debt_with_null_new_value() throws Exception {
+  public void set_past_technical_debt_with_null_new_value() {
     issue.setDebt(null);
     Duration previousDebt = Duration.create(10 * 8 * 60);
     boolean updated = updater.setPastTechnicalDebt(issue, previousDebt, context);
@@ -415,7 +415,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_message() throws Exception {
+  public void set_message() {
     boolean updated = updater.setMessage(issue, "the message", context);
     assertThat(updated).isTrue();
     assertThat(issue.isChanged()).isTrue();
@@ -424,7 +424,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_past_message() throws Exception {
+  public void set_past_message() {
     issue.setMessage("new message");
     boolean updated = updater.setPastMessage(issue, "past message", context);
     assertThat(updated).isTrue();
@@ -436,7 +436,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_author() throws Exception {
+  public void set_author() {
     boolean updated = updater.setAuthorLogin(issue, "eric", context);
     assertThat(updated).isTrue();
     assertThat(issue.authorLogin()).isEqualTo("eric");
@@ -448,7 +448,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_project() throws Exception {
+  public void set_project() {
     boolean updated = updater.setProject(issue, "sample", context);
     assertThat(updated).isTrue();
     assertThat(issue.projectKey()).isEqualTo("sample");
@@ -459,7 +459,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void set_past_project() throws Exception {
+  public void set_past_project() {
     issue.setProjectKey("new project key");
     boolean updated = updater.setPastProject(issue, "past project key", context);
     assertThat(updated).isTrue();
@@ -471,7 +471,7 @@ public class IssueUpdaterTest {
   }
 
   @Test
-  public void not_set_past_project_if_no_change() throws Exception {
+  public void not_set_past_project_if_no_change() {
     issue.setProjectKey("key");
     boolean updated = updater.setPastProject(issue, "key", context);
     assertThat(updated).isFalse();
index c6d5d6219bf2b131659a3439c3dcc7da9ec075f6..d9de4aa528f348babc73d08453f3a85961309784 100644 (file)
@@ -51,7 +51,7 @@ public class IssueChangeDaoTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index 3ae8f107ba08f05835fe54c3cea5a87765f8f890..3b383c1c974bb19faa81b14b96f91d2d2a0149d6 100644 (file)
@@ -30,7 +30,7 @@ import static org.sonar.api.utils.DateUtils.parseDate;
 public class IssueChangeDtoTest {
 
   @Test
-  public void create_from_comment() throws Exception {
+  public void create_from_comment() {
     DefaultIssueComment comment = DefaultIssueComment.create("ABCDE", "emmerik", "the comment");
 
     IssueChangeDto dto = IssueChangeDto.of(comment);
@@ -45,7 +45,7 @@ public class IssueChangeDtoTest {
   }
 
   @Test
-  public void create_from_comment_with_created_at() throws Exception {
+  public void create_from_comment_with_created_at() {
     DefaultIssueComment comment = DefaultIssueComment.create("ABCDE", "emmerik", "the comment");
     comment.setCreatedAt(parseDate("2015-01-13"));
 
@@ -55,7 +55,7 @@ public class IssueChangeDtoTest {
   }
 
   @Test
-  public void create_from_diff() throws Exception {
+  public void create_from_diff() {
     FieldDiffs diffs = new FieldDiffs();
     diffs.setDiff("severity", "INFO", "BLOCKER");
     diffs.setUserLogin("emmerik");
@@ -72,7 +72,7 @@ public class IssueChangeDtoTest {
   }
 
   @Test
-  public void create_from_diff_with_created_at() throws Exception {
+  public void create_from_diff_with_created_at() {
     FieldDiffs diffs = new FieldDiffs();
     diffs.setDiff("severity", "INFO", "BLOCKER");
     diffs.setUserLogin("emmerik");
@@ -84,7 +84,7 @@ public class IssueChangeDtoTest {
   }
 
   @Test
-  public void to_comment() throws Exception {
+  public void to_comment() {
     IssueChangeDto changeDto = new IssueChangeDto()
       .setKey("EFGH")
       .setUserLogin("emmerik")
@@ -103,7 +103,7 @@ public class IssueChangeDtoTest {
   }
 
   @Test
-  public void to_field_diffs_with_issue_creation_date() throws Exception {
+  public void to_field_diffs_with_issue_creation_date() {
     IssueChangeDto changeDto = new IssueChangeDto()
       .setKey("EFGH")
       .setUserLogin("emmerik")
@@ -118,7 +118,7 @@ public class IssueChangeDtoTest {
   }
 
   @Test
-  public void to_field_diffs_with_create_at() throws Exception {
+  public void to_field_diffs_with_create_at() {
     IssueChangeDto changeDto = new IssueChangeDto()
       .setKey("EFGH")
       .setUserLogin("emmerik")
@@ -133,7 +133,7 @@ public class IssueChangeDtoTest {
   }
 
   @Test
-  public void to_string() throws Exception {
+  public void to_string() {
     DefaultIssueComment comment = DefaultIssueComment.create("ABCDE", "emmerik", "the comment");
     IssueChangeDto dto = IssueChangeDto.of(comment);
     assertThat(dto.toString()).contains("ABCDE");
index 070cd2641d8b2b1a5fedcbcca66abc35b048d2c3..f9d51c39c3761d7f3c0098cd267c3a680782d7b5 100644 (file)
@@ -42,7 +42,7 @@ public class IssueChangeMapperTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void insert_diff() throws Exception {
+  public void insert_diff() {
     IssueChangeDto dto = new IssueChangeDto();
     dto.setKey(null /* no key on field changes */);
     dto.setUserLogin("emmerik");
@@ -59,7 +59,7 @@ public class IssueChangeMapperTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void insert_comment() throws Exception {
+  public void insert_comment() {
     IssueChangeDto dto = new IssueChangeDto();
     dto.setKey("COMMENT-1234");
     dto.setUserLogin("emmerik");
index d8495ccb6d2f22787f0591abbfb73d407feb65ab..7958aa266746150fc4b720c8c64a70f7189b64f8 100644 (file)
@@ -42,7 +42,7 @@ public class IssueDaoTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index d9561829aa7ba97084224d7f256713abbfa2b08a..9e81671a8998254bbe596569c0de9745efc07b81 100644 (file)
@@ -46,7 +46,7 @@ public class IssueMapperTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void insert() throws Exception {
+  public void insert() {
     IssueDto dto = new IssueDto();
     dto.setComponentUuid("uuid-123");
     dto.setProjectUuid("uuid-100");
@@ -79,7 +79,7 @@ public class IssueMapperTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void update() throws Exception {
+  public void update() {
     setupData("testUpdate");
 
     IssueDto dto = new IssueDto();
@@ -114,7 +114,7 @@ public class IssueMapperTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void updateBeforeSelectedDate_without_conflict() throws Exception {
+  public void updateBeforeSelectedDate_without_conflict() {
     setupData("testUpdate");
 
     IssueDto dto = new IssueDto();
@@ -152,7 +152,7 @@ public class IssueMapperTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void updateBeforeSelectedDate_with_conflict() throws Exception {
+  public void updateBeforeSelectedDate_with_conflict() {
     setupData("updateBeforeSelectedDate_with_conflict");
 
     IssueDto dto = new IssueDto();
index bdda38311e9f69fdb5c4a0408e6220d952f08c5c..62e100596297295ca880fc46d1dcbc40dde02606 100644 (file)
@@ -51,12 +51,12 @@ public class IssueStorageTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void after() throws Exception {
+  public void after() {
     session.close();
   }
 
   @Test
-  public void batch_insert_new_issues() throws Exception {
+  public void batch_insert_new_issues() {
     FakeBatchSaver saver = new FakeBatchSaver(getMyBatis(), new FakeRuleFinder());
 
     DefaultIssueComment comment = DefaultIssueComment.create("ABCDE", "emmerik", "the comment");
@@ -91,7 +91,7 @@ public class IssueStorageTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void batch_insert_new_issues_with_session() throws Exception {
+  public void batch_insert_new_issues_with_session() {
     FakeBatchSaver saver = new FakeBatchSaver(getMyBatis(), new FakeRuleFinder());
 
     DefaultIssueComment comment = DefaultIssueComment.create("ABCDE", "emmerik", "the comment");
@@ -127,7 +127,7 @@ public class IssueStorageTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void server_insert_new_issues_with_session() throws Exception {
+  public void server_insert_new_issues_with_session() {
     ComponentDto project = new ComponentDto().setId(10L).setUuid("uuid-10");
     ComponentDto component = new ComponentDto().setId(100L).setUuid("uuid-100");
     FakeServerSaver saver = new FakeServerSaver(getMyBatis(), new FakeRuleFinder(), component, project);
@@ -165,7 +165,7 @@ public class IssueStorageTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void batch_update_issues() throws Exception {
+  public void batch_update_issues() {
     setupData("should_update_issues");
 
     FakeBatchSaver saver = new FakeBatchSaver(getMyBatis(), new FakeRuleFinder());
@@ -209,7 +209,7 @@ public class IssueStorageTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void server_update_issues() throws Exception {
+  public void server_update_issues() {
     setupData("should_update_issues");
 
     ComponentDto project = new ComponentDto().setId(10L).setUuid("whatever-uuid");
index ba6599d789dae9596ae490b14c21249b621a02b6..2dc79d30b8dd477c418765dc8d5705339eb853f4 100644 (file)
@@ -33,7 +33,7 @@ import static org.mockito.Mockito.*;
 public class UpdateConflictResolverTest {
 
   @Test
-  public void should_reload_issue_and_resolve_conflict() throws Exception {
+  public void should_reload_issue_and_resolve_conflict() {
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCDE")
       .setRuleKey(RuleKey.of("squid", "AvoidCycles"))
@@ -66,7 +66,7 @@ public class UpdateConflictResolverTest {
   }
 
   @Test
-  public void should_keep_changes_made_by_user() throws Exception {
+  public void should_keep_changes_made_by_user() {
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCDE")
       .setRuleKey(RuleKey.of("squid", "AvoidCycles"))
@@ -121,7 +121,7 @@ public class UpdateConflictResolverTest {
   }
 
   @Test
-  public void severity_changed_by_user_should_be_kept() throws Exception {
+  public void severity_changed_by_user_should_be_kept() {
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCDE")
       .setRuleKey(RuleKey.of("squid", "AvoidCycles"))
index 57823a87d7b3bfd3b98a25bb05ed43b25680d6f4..47ca6b3d526738c09f7ddf282ded7751f92d87c1 100644 (file)
@@ -28,14 +28,14 @@ public class IsEndOfLifeTest {
   DefaultIssue issue = new DefaultIssue();
 
   @Test
-  public void should_be_end_of_life() throws Exception {
+  public void should_be_end_of_life() {
     IsEndOfLife condition = new IsEndOfLife(true);
     assertThat(condition.matches(issue.setEndOfLife(true))).isTrue();
     assertThat(condition.matches(issue.setEndOfLife(false))).isFalse();
   }
 
   @Test
-  public void should_not_be_end_of_life() throws Exception {
+  public void should_not_be_end_of_life() {
     IsEndOfLife condition = new IsEndOfLife(false);
     assertThat(condition.matches(issue.setEndOfLife(true))).isFalse();
     assertThat(condition.matches(issue.setEndOfLife(false))).isTrue();
index 7deaf627aa69ce14af0e858f395a4401c1eaf4ca..16a82274f04839eeaa5eba844642de5e5c5d9adb 100644 (file)
@@ -28,14 +28,14 @@ public class IsManualTest {
   DefaultIssue issue = new DefaultIssue();
 
   @Test
-  public void should_match() throws Exception {
+  public void should_match() {
     IsManual condition = new IsManual(true);
     assertThat(condition.matches(issue.setReporter("you"))).isTrue();
     assertThat(condition.matches(issue.setReporter(null))).isFalse();
   }
 
   @Test
-  public void should_match_dead() throws Exception {
+  public void should_match_dead() {
     IsManual condition = new IsManual(false);
     assertThat(condition.matches(issue.setReporter("you"))).isFalse();
     assertThat(condition.matches(issue.setReporter(null))).isTrue();
index 1eb2430420a8c5705aff1f4751ecaefb5035d0d2..8cc01a72189191087939e02033031de536511608 100644 (file)
@@ -47,7 +47,7 @@ public class IssueWorkflowTest {
   IssueWorkflow workflow = new IssueWorkflow(new FunctionExecutor(updater), updater);
 
   @Test
-  public void init_state_machine() throws Exception {
+  public void init_state_machine() {
     assertThat(workflow.machine()).isNull();
     workflow.start();
     assertThat(workflow.machine()).isNotNull();
@@ -60,14 +60,14 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void list_statuses() throws Exception {
+  public void list_statuses() {
     workflow.start();
     // order is important for UI
     assertThat(workflow.statusKeys()).containsSequence(Issue.STATUS_OPEN, Issue.STATUS_CONFIRMED, Issue.STATUS_REOPENED, Issue.STATUS_RESOLVED, Issue.STATUS_CLOSED);
   }
 
   @Test
-  public void list_out_transitions_from_status_open() throws Exception {
+  public void list_out_transitions_from_status_open() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_OPEN);
@@ -76,7 +76,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void list_out_transitions_from_status_confirmed() throws Exception {
+  public void list_out_transitions_from_status_confirmed() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_CONFIRMED);
@@ -85,7 +85,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void list_out_transitions_from_status_resolved() throws Exception {
+  public void list_out_transitions_from_status_resolved() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_RESOLVED);
@@ -94,7 +94,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void list_out_transitions_from_status_reopen() throws Exception {
+  public void list_out_transitions_from_status_reopen() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_REOPENED);
@@ -103,7 +103,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void list_no_out_transition_from_status_closed() throws Exception {
+  public void list_no_out_transition_from_status_closed() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_CLOSED);
@@ -112,7 +112,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void list_out_transitions_from_status_closed_on_manual_issue() throws Exception {
+  public void list_out_transitions_from_status_closed_on_manual_issue() {
     workflow.start();
 
     // Manual issue because of reporter
@@ -127,7 +127,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void fail_if_unknown_status_when_listing_transitions() throws Exception {
+  public void fail_if_unknown_status_when_listing_transitions() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue().setStatus("xxx");
@@ -141,7 +141,7 @@ public class IssueWorkflowTest {
 
 
   @Test
-  public void do_automatic_transition() throws Exception {
+  public void do_automatic_transition() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue()
@@ -159,7 +159,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void close_open_dead_issue() throws Exception {
+  public void close_open_dead_issue() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue()
@@ -177,7 +177,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void close_reopened_dead_issue() throws Exception {
+  public void close_reopened_dead_issue() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue()
@@ -195,7 +195,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void close_confirmed_dead_issue() throws Exception {
+  public void close_confirmed_dead_issue() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue()
@@ -214,7 +214,7 @@ public class IssueWorkflowTest {
 
 
   @Test
-  public void fail_if_unknown_status_on_automatic_trans() throws Exception {
+  public void fail_if_unknown_status_on_automatic_trans() {
     workflow.start();
 
     DefaultIssue issue = new DefaultIssue()
@@ -232,7 +232,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void flag_as_false_positive() throws Exception {
+  public void flag_as_false_positive() {
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCDE")
       .setStatus(Issue.STATUS_OPEN)
@@ -250,7 +250,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void wont_fix() throws Exception {
+  public void wont_fix() {
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCDE")
       .setStatus(Issue.STATUS_OPEN)
@@ -268,7 +268,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void manual_issues_be_resolved_then_closed() throws Exception {
+  public void manual_issues_be_resolved_then_closed() {
     // Manual issue because of reporter
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCDE")
@@ -299,7 +299,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void manual_issues_be_confirmed_then_kept_open() throws Exception {
+  public void manual_issues_be_confirmed_then_kept_open() {
     // Manual issue because of reporter
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCDE")
@@ -339,7 +339,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void manual_issue_on_removed_rule_be_closed() throws Exception {
+  public void manual_issue_on_removed_rule_be_closed() {
     // Manual issue because of reporter
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCDE")
@@ -357,7 +357,7 @@ public class IssueWorkflowTest {
   }
 
   @Test
-  public void manual_issue_on_removed_component_be_closed() throws Exception {
+  public void manual_issue_on_removed_component_be_closed() {
     // Manual issue because of reporter
     DefaultIssue issue = new DefaultIssue()
       .setKey("ABCDE")
index 1e12908b4c4986a0b0f8671eef85f3505330d5b0..ebadb4bccd94282a7a3fb2902d465a135c7d34b1 100644 (file)
@@ -28,7 +28,7 @@ import static org.mockito.Mockito.*;
 
 public class SetAssigneeTest {
   @Test
-  public void assign() throws Exception {
+  public void assign() {
     User user = new DefaultUser().setLogin("eric").setName("eric");
     SetAssignee function = new SetAssignee(user);
     Function.Context context = mock(Function.Context.class);
@@ -37,7 +37,7 @@ public class SetAssigneeTest {
   }
 
   @Test
-  public void unassign() throws Exception {
+  public void unassign() {
     Function.Context context = mock(Function.Context.class);
     SetAssignee.UNASSIGN.execute(context);
     verify(context, times(1)).setAssignee(null);
index 21e8a2c72a1580651c04eb07d36c925cf4fbf6e1..e4cb9f59783a56b4b0ca6fa4f31c6cc97a9b4a41 100644 (file)
@@ -27,7 +27,7 @@ import static org.mockito.Mockito.verify;
 
 public class SetCloseDateTest {
   @Test
-  public void should_set_close_date() throws Exception {
+  public void should_set_close_date() {
     SetCloseDate function = new SetCloseDate(true);
     Function.Context context = mock(Function.Context.class);
     function.execute(context);
index a05e9d0e056b94836c10ab4ae04f02302a1f9302..014a8c2d08737ac0d405885354d79ffe36ff21df 100644 (file)
@@ -33,7 +33,7 @@ public class SetEndOfLifeTest {
   SetEndOfLife function = new SetEndOfLife();
 
   @Test
-  public void should_resolve_as_fixed() throws Exception {
+  public void should_resolve_as_fixed() {
     Issue issue = new DefaultIssue().setEndOfLife(true).setOnDisabledRule(false);
     when(context.issue()).thenReturn(issue);
     function.execute(context);
@@ -41,7 +41,7 @@ public class SetEndOfLifeTest {
   }
 
   @Test
-  public void should_resolve_as_removed_when_rule_is_disabled() throws Exception {
+  public void should_resolve_as_removed_when_rule_is_disabled() {
     Issue issue = new DefaultIssue().setEndOfLife(true).setOnDisabledRule(true);
     when(context.issue()).thenReturn(issue);
     function.execute(context);
@@ -49,7 +49,7 @@ public class SetEndOfLifeTest {
   }
 
   @Test
-  public void should_fail_if_issue_is_not_resolved() throws Exception {
+  public void should_fail_if_issue_is_not_resolved() {
     Issue issue = new DefaultIssue().setEndOfLife(false);
     when(context.issue()).thenReturn(issue);
     try {
@@ -62,7 +62,7 @@ public class SetEndOfLifeTest {
   }
 
   @Test
-  public void line_number_must_be_unset() throws Exception {
+  public void line_number_must_be_unset() {
     Issue issue = new DefaultIssue().setEndOfLife(true).setLine(10);
     when(context.issue()).thenReturn(issue);
     function.execute(context);
index db88e155ff4fefffb585877da36c6c85e9384858..0ef18d3ab5dd1f2b84949f816883ff5731cb4439 100644 (file)
@@ -27,7 +27,7 @@ import static org.mockito.Mockito.verify;
 
 public class SetResolutionTest {
   @Test
-  public void execute() throws Exception {
+  public void execute() {
     SetResolution function = new SetResolution("FIXED");
     Function.Context context = mock(Function.Context.class);
     function.execute(context);
index 0f4640fc583daeba45ac965ebd4a896f946b019e..db598bc805ad993fb4686fc235c2fc0830730186 100644 (file)
@@ -25,14 +25,14 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 public class StateMachineTest {
   @Test
-  public void keep_order_of_state_keys() throws Exception {
+  public void keep_order_of_state_keys() {
     StateMachine machine = StateMachine.builder().states("OPEN", "RESOLVED", "CLOSED").build();
 
     assertThat(machine.stateKeys()).containsSequence("OPEN", "RESOLVED", "CLOSED");
   }
 
   @Test
-  public void stateKey() throws Exception {
+  public void stateKey() {
     StateMachine machine = StateMachine.builder()
       .states("OPEN", "RESOLVED", "CLOSED")
       .transition(Transition.builder("resolve").from("OPEN").to("RESOLVED").build())
index 4845435612c4e91dfd583e43215dacc958b1ae94..c9ad378df484b2af747b46a734f043c68e10042b 100644 (file)
@@ -29,7 +29,7 @@ public class StateTest {
   Transition t1 = Transition.builder("close").from("OPEN").to("CLOSED").build();
 
   @Test
-  public void key_should_be_set() throws Exception {
+  public void key_should_be_set() {
     try {
       new State("", new Transition[0]);
       fail();
@@ -39,7 +39,7 @@ public class StateTest {
   }
 
   @Test
-  public void key_should_be_upper_case() throws Exception {
+  public void key_should_be_upper_case() {
     try {
       new State("close", new Transition[0]);
       fail();
@@ -49,7 +49,7 @@ public class StateTest {
   }
 
   @Test
-  public void no_duplicated_out_transitions() throws Exception {
+  public void no_duplicated_out_transitions() {
     try {
       new State("CLOSE", new Transition[]{t1, t1});
       fail();
index 0ac9809fdece36240c21e376cc5f4ccbd03e941d..4c680c54ec10d6fa72467de5b44e22d8b20074a2 100644 (file)
@@ -63,7 +63,7 @@ public class TransitionTest {
   }
 
   @Test
-  public void key_should_be_set() throws Exception {
+  public void key_should_be_set() {
     try {
       Transition.builder("").from("OPEN").to("CLOSED").build();
       fail();
@@ -73,7 +73,7 @@ public class TransitionTest {
   }
 
   @Test
-  public void key_should_be_lower_case() throws Exception {
+  public void key_should_be_lower_case() {
     try {
       Transition.builder("CLOSE").from("OPEN").to("CLOSED").build();
       fail();
@@ -83,7 +83,7 @@ public class TransitionTest {
   }
 
   @Test
-  public void originating_status_should_be_set() throws Exception {
+  public void originating_status_should_be_set() {
     try {
       Transition.builder("close").from("").to("CLOSED").build();
       fail();
@@ -93,7 +93,7 @@ public class TransitionTest {
   }
 
   @Test
-  public void destination_status_should_be_set() throws Exception {
+  public void destination_status_should_be_set() {
     try {
       Transition.builder("close").from("OPEN").to("").build();
       fail();
@@ -103,7 +103,7 @@ public class TransitionTest {
   }
 
   @Test
-  public void should_verify_conditions() throws Exception {
+  public void should_verify_conditions() {
     DefaultIssue issue = new DefaultIssue();
     Transition transition = Transition.builder("close")
       .from("OPEN").to("CLOSED")
index e75676287e87088414876a050a55020da5828002..c3f3dd852f3f07e0ae6fd5990bdd086c2f9cccd6 100644 (file)
@@ -55,32 +55,32 @@ public class MeasureDtoTest {
   }
 
   @Test
-  public void value_with_text_over_4000_characters() throws Exception {
+  public void value_with_text_over_4000_characters() {
     assertThat(sut.setData(Strings.repeat("1", 4001)).getData()).isNotNull();
   }
 
   @Test
-  public void text_value_under_4000_characters() throws Exception {
+  public void text_value_under_4000_characters() {
     assertThat(sut.setData("text value").getData()).isEqualTo("text value");
   }
 
   @Test(expected = IndexOutOfBoundsException.class)
-  public void fail_to_set_out_of_bounds_variation() throws Exception {
+  public void fail_to_set_out_of_bounds_variation() {
     sut.setVariation(6, 1d);
   }
 
   @Test(expected = IndexOutOfBoundsException.class)
-  public void fail_to_get_out_of_bounds_variation() throws Exception {
+  public void fail_to_get_out_of_bounds_variation() {
     sut.getVariation(6);
   }
 
   @Test(expected = IllegalArgumentException.class)
-  public void fail_if_non_existent_severity() throws Exception {
+  public void fail_if_non_existent_severity() {
     sut.setSeverity("MAYOR");
   }
 
   @Test
-  public void severity_values_are_retrieved() throws Exception {
+  public void severity_values_are_retrieved() {
     assertThat(sut.getSeverity()).isNull();
 
     for (String severity : Severity.ALL) {
index 19641d6c94a94b672b4b123019f3af2aa38864f9..93ce3e3716391f651fc20581abf7168b79aea06a 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class MetricDtoTest {
 
   @Test
-  public void getters_and_setters() throws Exception {
+  public void getters_and_setters() {
     MetricDto metricDto = new MetricDto()
       .setId(1)
       .setKey("coverage")
index 015b2e72e46ada5c46def821ab9a9ceacef33c91..9e1dae9de30c7f1502b3c3993f165b580273cdb5 100644 (file)
@@ -88,7 +88,7 @@ public class DefaultNotificationManagerTest extends AbstractDbUnitTestCase {
   }
 
   @Test
-  public void shouldPersist() throws Exception {
+  public void shouldPersist() {
     Notification notification = new Notification("test");
     manager.scheduleForSending(notification);
 
@@ -96,7 +96,7 @@ public class DefaultNotificationManagerTest extends AbstractDbUnitTestCase {
   }
 
   @Test
-  public void shouldGetFromQueueAndDelete() throws Exception {
+  public void shouldGetFromQueueAndDelete() {
     Notification notification = new Notification("test");
     NotificationQueueDto dto = NotificationQueueDto.toNotificationQueueDto(notification);
     List<NotificationQueueDto> dtos = Arrays.asList(dto);
index 7a054560f481c8bdee46bf6eb2e3f6d27bb5f67d..7b79f0f1600ac52408fa6749659361d34986297b 100644 (file)
@@ -40,7 +40,7 @@ public class GroupWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_groups_for_project_permission() throws Exception {
+  public void select_groups_for_project_permission() {
     setupData("groups_with_permissions");
 
     PermissionQuery query = PermissionQuery.builder().permission("user").build();
@@ -69,7 +69,7 @@ public class GroupWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void anyone_group_is_not_returned_when_it_has_no_permission() throws Exception {
+  public void anyone_group_is_not_returned_when_it_has_no_permission() {
     setupData("groups_with_permissions");
 
     // Anyone group has not the permission 'admin', so it's not returned
@@ -91,7 +91,7 @@ public class GroupWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_groups_for_global_permission() throws Exception {
+  public void select_groups_for_global_permission() {
     setupData("groups_with_permissions");
 
     PermissionQuery query = PermissionQuery.builder().permission("admin").build();
@@ -112,7 +112,7 @@ public class GroupWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void search_by_groups_name() throws Exception {
+  public void search_by_groups_name() {
     setupData("groups_with_permissions");
 
     List<GroupWithPermissionDto> result = dao.selectGroups(PermissionQuery.builder().permission("user").search("aDMini").build(), COMPONENT_ID);
@@ -124,7 +124,7 @@ public class GroupWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void search_groups_should_be_sorted_by_group_name() throws Exception {
+  public void search_groups_should_be_sorted_by_group_name() {
     setupData("groups_with_permissions_should_be_sorted_by_group_name");
 
     List<GroupWithPermissionDto> result = dao.selectGroups(PermissionQuery.builder().permission("user").build(), COMPONENT_ID);
index bbff4ba4c58224d37d015e830f1940aa2aec0491..ef4a30aef47e1a84d1c6ea17473a24401d5ffc07 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class GroupWithPermissionDtoTest {
 
   @Test
-  public void to_group_with_permission_having_permission() throws Exception {
+  public void to_group_with_permission_having_permission() {
     GroupWithPermission group = new GroupWithPermissionDto()
       .setName("users")
       .setDescription("desc")
@@ -40,7 +40,7 @@ public class GroupWithPermissionDtoTest {
   }
 
   @Test
-  public void to_group_with_permission_not_having_permission() throws Exception {
+  public void to_group_with_permission_not_having_permission() {
     GroupWithPermission group = new GroupWithPermissionDto()
       .setName("users")
       .setPermission(null)
index 6ab511947d38ed77535193533930fb9d2aab882b..28ff2c3ed32744a19aa028741906646869afb9ea 100644 (file)
@@ -41,7 +41,7 @@ public class GroupWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_groups() throws Exception {
+  public void select_groups() {
     setupData("groups_with_permissions");
 
     PermissionQuery query = PermissionQuery.builder().permission("user").build();
@@ -71,7 +71,7 @@ public class GroupWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void anyone_group_is_not_returned_when_it_has_no_permission() throws Exception {
+  public void anyone_group_is_not_returned_when_it_has_no_permission() {
     setupData("groups_with_permissions");
 
     // Anyone group has not the permission 'admin', so it's not returned
@@ -93,7 +93,7 @@ public class GroupWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void search_by_groups_name() throws Exception {
+  public void search_by_groups_name() {
     setupData("groups_with_permissions");
 
     List<GroupWithPermissionDto> result = dao.selectGroups(PermissionQuery.builder().permission("user").search("aDMini").build(), TEMPLATE_ID);
@@ -105,7 +105,7 @@ public class GroupWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void search_groups_should_be_sorted_by_group_name() throws Exception {
+  public void search_groups_should_be_sorted_by_group_name() {
     setupData("groups_with_permissions_should_be_sorted_by_group_name");
 
     List<GroupWithPermissionDto> result = dao.selectGroups(PermissionQuery.builder().permission("user").build(), TEMPLATE_ID);
index 324bcb6199584f5aaa233933979a62ecd093d875..8eafb61e80c05171e31f352e6fe40519f7a8a9d0 100644 (file)
@@ -64,12 +64,12 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void should_apply_permission_template() throws Exception {
+  public void should_apply_permission_template() {
     setupData("should_apply_permission_template");
 
     assertThat(permissionFacade.selectGroupPermissions(session, "sonar-administrators", 123L)).isEmpty();
@@ -89,14 +89,14 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_count_component_permissions() throws Exception {
+  public void should_count_component_permissions() {
     setupData("should_count_component_permissions");
 
     assertThat(permissionFacade.countComponentPermissions(session, 123L)).isEqualTo(2);
   }
 
   @Test
-  public void should_add_user_permission() throws Exception {
+  public void should_add_user_permission() {
     setupData("should_add_user_permission");
 
     permissionFacade.insertUserPermission(123L, 200L, UserRole.ADMIN, session);
@@ -107,7 +107,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_delete_user_permission() throws Exception {
+  public void should_delete_user_permission() {
     setupData("should_delete_user_permission");
 
     permissionFacade.deleteUserPermission(123L, 200L, UserRole.ADMIN, session);
@@ -118,7 +118,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_insert_group_permission() throws Exception {
+  public void should_insert_group_permission() {
     setupData("should_insert_group_permission");
 
     permissionFacade.insertGroupPermission(123L, 100L, UserRole.USER, session);
@@ -129,7 +129,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_insert_group_name_permission() throws Exception {
+  public void should_insert_group_name_permission() {
     setupData("should_insert_group_permission");
 
     permissionFacade.insertGroupPermission(123L, "devs", UserRole.USER, session);
@@ -140,7 +140,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_insert_anyone_group_permission() throws Exception {
+  public void should_insert_anyone_group_permission() {
     setupData("should_insert_anyone_group_permission");
 
     permissionFacade.insertGroupPermission(123L, "Anyone", UserRole.USER, session);
@@ -151,7 +151,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_delete_group_permission() throws Exception {
+  public void should_delete_group_permission() {
     setupData("should_delete_group_permission");
 
     permissionFacade.deleteGroupPermission(123L, 100L, UserRole.USER, session);
@@ -162,7 +162,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_delete_group_name_permission() throws Exception {
+  public void should_delete_group_name_permission() {
     setupData("should_delete_group_permission");
 
     permissionFacade.deleteGroupPermission(123L, "devs", UserRole.USER, session);
@@ -173,7 +173,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_retrieve_permission_template() throws Exception {
+  public void should_retrieve_permission_template() {
     PermissionTemplateDto permissionTemplateDto = new PermissionTemplateDto().setName("Test template").setKee("test_template");
     PermissionTemplateDto templateWithPermissions = new PermissionTemplateDto().setKee("test_template");
     permissionTemplateDao = mock(PermissionTemplateDao.class);
@@ -188,7 +188,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_fail_on_unmatched_template() throws Exception {
+  public void should_fail_on_unmatched_template() {
     throwable.expect(IllegalArgumentException.class);
 
     permissionTemplateDao = mock(PermissionTemplateDao.class);
@@ -198,7 +198,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_remove_all_permissions() throws Exception {
+  public void should_remove_all_permissions() {
     setupData("should_remove_all_permissions");
 
     assertThat(permissionFacade.selectGroupPermissions(session, "devs", 123L)).hasSize(1);
index e4c5b8de4ec46a6209926ab0e8dde0e06370aadc..c3bfc1fa0007fcb75152ca3529d330fd7ec09e7b 100644 (file)
@@ -57,7 +57,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_create_permission_template() throws Exception {
+  public void should_create_permission_template() {
     setupData("createPermissionTemplate");
     PermissionTemplateDto permissionTemplate = permissionTemplateDao.createPermissionTemplate("my template", "my description", "myregexp");
     assertThat(permissionTemplate).isNotNull();
@@ -66,7 +66,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_normalize_kee_on_template_creation() throws Exception {
+  public void should_normalize_kee_on_template_creation() {
     setupData("createNonAsciiPermissionTemplate");
     PermissionTemplateDto permissionTemplate = permissionTemplateDao.createPermissionTemplate("Môü Gnô Gnèçàß", "my description", null);
     assertThat(permissionTemplate).isNotNull();
@@ -75,7 +75,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_skip_key_normalization_on_default_template() throws Exception {
+  public void should_skip_key_normalization_on_default_template() {
 
     PermissionTemplateMapper mapper = mock(PermissionTemplateMapper.class);
 
@@ -95,7 +95,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_select_permission_template() throws Exception {
+  public void should_select_permission_template() {
     setupData("selectPermissionTemplate");
     PermissionTemplateDto permissionTemplate = permissionTemplateDao.selectPermissionTemplate("my_template_20130102_030405");
 
@@ -115,7 +115,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_select_empty_permission_template() throws Exception {
+  public void should_select_empty_permission_template() {
     setupData("selectEmptyPermissionTemplate");
     PermissionTemplateDto permissionTemplate = permissionTemplateDao.selectPermissionTemplate("my_template_20130102_030405");
 
@@ -127,7 +127,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_select_permission_template_by_key() throws Exception {
+  public void should_select_permission_template_by_key() {
     setupData("selectPermissionTemplate");
 
     PermissionTemplateDto permissionTemplate = permissionTemplateDao.selectTemplateByKey("my_template_20130102_030405");
@@ -140,7 +140,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_select_all_permission_templates() throws Exception {
+  public void should_select_all_permission_templates() {
     setupData("selectAllPermissionTemplates");
 
     List<PermissionTemplateDto> permissionTemplates = permissionTemplateDao.selectAllPermissionTemplates();
@@ -153,7 +153,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_update_permission_template() throws Exception {
+  public void should_update_permission_template() {
     setupData("updatePermissionTemplate");
 
     permissionTemplateDao.updatePermissionTemplate(1L, "new_name", "new_description", "new_regexp");
@@ -162,7 +162,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_delete_permission_template() throws Exception {
+  public void should_delete_permission_template() {
     setupData("deletePermissionTemplate");
 
     permissionTemplateDao.deletePermissionTemplate(1L);
@@ -173,7 +173,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_add_user_permission_to_template() throws Exception {
+  public void should_add_user_permission_to_template() {
     setupData("addUserPermissionToTemplate");
     permissionTemplateDao.addUserPermission(1L, 1L, "new_permission");
 
@@ -183,7 +183,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_remove_user_permission_from_template() throws Exception {
+  public void should_remove_user_permission_from_template() {
     setupData("removeUserPermissionFromTemplate");
     permissionTemplateDao.removeUserPermission(1L, 2L, "permission_to_remove");
 
@@ -193,7 +193,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_add_group_permission_to_template() throws Exception {
+  public void should_add_group_permission_to_template() {
     setupData("addGroupPermissionToTemplate");
     permissionTemplateDao.addGroupPermission(1L, 1L, "new_permission");
 
@@ -203,7 +203,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_remove_group_permission_from_template() throws Exception {
+  public void should_remove_group_permission_from_template() {
     setupData("removeGroupPermissionFromTemplate");
     permissionTemplateDao.removeGroupPermission(1L, 2L, "permission_to_remove");
 
@@ -213,7 +213,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void remove_by_group() throws Exception {
+  public void remove_by_group() {
     setupData("remove_by_group");
     permissionTemplateDao.removeByGroup(2L, session);
     session.commit();
@@ -222,7 +222,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_add_group_permission_with_null_name() throws Exception {
+  public void should_add_group_permission_with_null_name() {
     setupData("addNullGroupPermissionToTemplate");
     permissionTemplateDao.addGroupPermission(1L, null, "new_permission");
 
@@ -232,7 +232,7 @@ public class PermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_remove_group_permission_with_null_name() throws Exception {
+  public void should_remove_group_permission_with_null_name() {
     setupData("removeNullGroupPermissionFromTemplate");
     permissionTemplateDao.removeGroupPermission(1L, null, "permission_to_remove");
 
index 44d365c61dfe4261bf14ed4c30f4fd7b9299663b..852915106cd67e11b97796c939e95d7afeaf48eb 100644 (file)
@@ -44,7 +44,7 @@ public class UserWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_all_users_for_project_permission() throws Exception {
+  public void select_all_users_for_project_permission() {
     setupData("users_with_permissions");
 
     PermissionQuery query = PermissionQuery.builder().permission("user").build();
@@ -68,7 +68,7 @@ public class UserWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_all_users_for_global_permission() throws Exception {
+  public void select_all_users_for_global_permission() {
     setupData("users_with_permissions");
 
     PermissionQuery query = PermissionQuery.builder().permission("admin").build();
@@ -89,7 +89,7 @@ public class UserWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_only_user_with_permission() throws Exception {
+  public void select_only_user_with_permission() {
     setupData("users_with_permissions");
 
     // user1 and user2 have permission user
@@ -97,7 +97,7 @@ public class UserWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_only_user_without_permission() throws Exception {
+  public void select_only_user_without_permission() {
     setupData("users_with_permissions");
 
     // Only user3 has not the user permission
@@ -105,7 +105,7 @@ public class UserWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void search_by_user_name() throws Exception {
+  public void search_by_user_name() {
     setupData("users_with_permissions");
 
     List<UserWithPermissionDto> result = dao.selectUsers(PermissionQuery.builder().permission("user").search("SEr1").build(), COMPONENT_ID);
@@ -117,7 +117,7 @@ public class UserWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_only_enable_users() throws Exception {
+  public void select_only_enable_users() {
     setupData("select_only_enable_users");
 
     PermissionQuery query = PermissionQuery.builder().permission("user").build();
@@ -134,7 +134,7 @@ public class UserWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_be_sorted_by_user_name() throws Exception {
+  public void should_be_sorted_by_user_name() {
     setupData("users_with_permissions_should_be_sorted_by_user_name");
 
     List<UserWithPermissionDto> result = dao.selectUsers(PermissionQuery.builder().permission("user").build(), COMPONENT_ID);
@@ -145,7 +145,7 @@ public class UserWithPermissionDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_be_paginated() throws Exception {
+  public void should_be_paginated() {
     setupData("users_with_permissions");
 
     List<UserWithPermissionDto> result = dao.selectUsers(PermissionQuery.builder().permission("user").build(), COMPONENT_ID, 0, 2);
index 665d6e6401a03c86ff76162c507429fff1061a0e..ab1f38990f7d18e4e599a69dc83ab746b2669ca6 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class UserWithPermissionDtoTest {
 
   @Test
-  public void to_user_with_permission_having_permission() throws Exception {
+  public void to_user_with_permission_having_permission() {
     UserWithPermission user = new UserWithPermissionDto()
       .setName("Arthur")
       .setLogin("arthur")
@@ -40,7 +40,7 @@ public class UserWithPermissionDtoTest {
   }
 
   @Test
-  public void to_user_with_permission_not_having_permission() throws Exception {
+  public void to_user_with_permission_not_having_permission() {
     UserWithPermission user = new UserWithPermissionDto()
       .setName("Arthur")
       .setLogin("arthur")
index 5cfa6fd43c1a8a8a68184f4d285f30b69ef68377..61d1f4f9479d393742653a7d97b1d270b9cd09a2 100644 (file)
@@ -45,7 +45,7 @@ public class UserWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_all_users() throws Exception {
+  public void select_all_users() {
     setupData("users_with_permissions");
 
     PermissionQuery query = PermissionQuery.builder().permission("user").build();
@@ -69,7 +69,7 @@ public class UserWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void return_nothing_on_unknown_template_key() throws Exception {
+  public void return_nothing_on_unknown_template_key() {
     setupData("users_with_permissions");
 
     PermissionQuery query = PermissionQuery.builder().permission("user").build();
@@ -87,7 +87,7 @@ public class UserWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_only_user_with_permission() throws Exception {
+  public void select_only_user_with_permission() {
     setupData("users_with_permissions");
 
     // user1 and user2 have permission user
@@ -95,7 +95,7 @@ public class UserWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_only_user_without_permission() throws Exception {
+  public void select_only_user_without_permission() {
     setupData("users_with_permissions");
 
     // Only user3 has not the user permission
@@ -103,7 +103,7 @@ public class UserWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_only_enable_users() throws Exception {
+  public void select_only_enable_users() {
     setupData("select_only_enable_users");
 
     PermissionQuery query = PermissionQuery.builder().permission("user").build();
@@ -120,7 +120,7 @@ public class UserWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void search_by_user_name() throws Exception {
+  public void search_by_user_name() {
     setupData("users_with_permissions");
 
     List<UserWithPermissionDto> result = dao.selectUsers(PermissionQuery.builder().permission("user").search("SEr1").build(), TEMPLATE_ID);
@@ -132,7 +132,7 @@ public class UserWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_be_sorted_by_user_name() throws Exception {
+  public void should_be_sorted_by_user_name() {
     setupData("users_with_permissions_should_be_sorted_by_user_name");
 
     List<UserWithPermissionDto> result = dao.selectUsers(PermissionQuery.builder().permission("user").build(), TEMPLATE_ID);
@@ -143,7 +143,7 @@ public class UserWithPermissionTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_be_paginated() throws Exception {
+  public void should_be_paginated() {
     setupData("users_with_permissions");
 
     List<UserWithPermissionDto> result = dao.selectUsers(PermissionQuery.builder().permission("user").build(), TEMPLATE_ID, 0, 2);
index 03e1d41d380c984de8bc5d74cffb782e6d0ea194..4715e7f4a2c2d81baf0e3cb6bf2eb42e35add70d 100644 (file)
@@ -40,13 +40,13 @@ public class DaoUtilsTest {
   }
 
   @Test
-  public void repeatCondition() throws Exception {
+  public void repeatCondition() {
     assertThat(DaoUtils.repeatCondition("uuid=?", 1, "or")).isEqualTo("uuid=?");
     assertThat(DaoUtils.repeatCondition("uuid=?", 3, "or")).isEqualTo("uuid=? or uuid=? or uuid=?");
   }
 
   @Test
-  public void execute_large_inputs() throws Exception {
+  public void execute_large_inputs() {
     List<Integer> inputs = newArrayList();
     List<String> expectedOutputs = newArrayList();
     for (int i = 0; i < 2010; i++) {
@@ -72,7 +72,7 @@ public class DaoUtilsTest {
   }
 
   @Test
-  public void execute_large_inputs_on_empty_list() throws Exception {
+  public void execute_large_inputs_on_empty_list() {
     List<String> outputs = DaoUtils.executeLargeInputs(Collections.<Integer>emptyList(), new Function<List<Integer>, List<String>>() {
       @Override
       public List<String> apply(List<Integer> input) {
index 6d9c6d74eb1d332e28c4c3d10c2cb0084fa2a52d..b12abc5da36ab3bed7a78d1148d59400401f36f5 100644 (file)
@@ -83,7 +83,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void create_and_acquire_semaphore() throws Exception {
+  public void create_and_acquire_semaphore() {
     Semaphores.Semaphore lock = dao.acquire("foo", 60);
     assertThat(lock.isLocked()).isTrue();
     assertThat(lock.getDurationSinceLocked()).isNull();
@@ -120,7 +120,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void fail_to_update_null_semaphore() throws Exception {
+  public void fail_to_update_null_semaphore() {
     thrown.expect(IllegalArgumentException.class);
     thrown.expectMessage("Semaphore must not be null");
 
@@ -128,7 +128,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void create_and_acquire_semaphore_when_maxage_is_zeo() throws Exception {
+  public void create_and_acquire_semaphore_when_maxage_is_zeo() {
     Semaphores.Semaphore lock = dao.acquire("foo", 0);
     assertThat(lock.isLocked()).isTrue();
     assertThat(lock.getDurationSinceLocked()).isNull();
@@ -145,7 +145,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void create_and_acquire_semaphore_when_no_timeout() throws Exception {
+  public void create_and_acquire_semaphore_when_no_timeout() {
     Semaphores.Semaphore lock = dao.acquire("foo");
     assertThat(lock.isLocked()).isTrue();
     assertThat(lock.getDurationSinceLocked()).isNull();
@@ -162,7 +162,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void fail_to_acquire_locked_semaphore() throws Exception {
+  public void fail_to_acquire_locked_semaphore() {
     setupData("old_semaphore");
     Semaphores.Semaphore lock = dao.acquire("foo", Integer.MAX_VALUE);
     assertThat(lock.isLocked()).isFalse();
@@ -177,7 +177,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void acquire_long_locked_semaphore() throws Exception {
+  public void acquire_long_locked_semaphore() {
     setupData("old_semaphore");
     Semaphores.Semaphore lock = dao.acquire("foo", 60);
     assertThat(lock.isLocked()).isTrue();
@@ -192,7 +192,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void acquire_locked_semaphore_when_timeout_is_zero() throws Exception {
+  public void acquire_locked_semaphore_when_timeout_is_zero() {
     setupData("old_semaphore");
     Semaphores.Semaphore lock = dao.acquire("foo", 0);
     assertThat(lock.isLocked()).isTrue();
@@ -210,7 +210,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void fail_to_acquire_locked_semaphore_when_no_timeout() throws Exception {
+  public void fail_to_acquire_locked_semaphore_when_no_timeout() {
     setupData("old_semaphore");
     Semaphores.Semaphore lock = dao.acquire("foo");
     assertThat(lock.isLocked()).isFalse();
@@ -225,7 +225,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_select_semaphore_return_current_semaphore_when_acquiring() throws Exception {
+  public void should_select_semaphore_return_current_semaphore_when_acquiring() {
     dao.acquire("foo");
 
     SemaphoreDto semaphore = selectSemaphore("foo");
@@ -255,7 +255,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
     }
   }
 
-  private SemaphoreDto selectSemaphore(String name) throws Exception {
+  private SemaphoreDto selectSemaphore(String name) {
     SqlSession session = getMyBatis().openSession();
     try {
       return dao.selectSemaphore(name, session);
index d6f36fcc77c525e3de1e5d085067dc38eb6db376..170d5d59c2e1b6bce78aa2a6d252b97eaa911481 100644 (file)
@@ -66,7 +66,7 @@ public class SemaphoreUpdaterTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void shouldNotFailWhenCancelNotExistingSemaphore() throws Exception {
+  public void shouldNotFailWhenCancelNotExistingSemaphore() {
     updater.stopUpdate("foo");
   }
 
index ae6f853a60bb9af1be9dc7cd1696b320e2313068..e187c55b4b8f622aec7345a65219946918589089 100644 (file)
@@ -53,7 +53,7 @@ public class H2Test {
   }
 
   @Test
-  public void h2_does_not_supportMigration() throws Exception {
+  public void h2_does_not_supportMigration() {
     assertThat(dialect.supportsMigration()).isFalse();
   }
 }
index 33c92f224eb6fbf531884ed11c4c0cf89d6c5784..8719be31490d32564b1141f05968d5cb7cc38f5f 100644 (file)
@@ -51,7 +51,7 @@ public class MsSqlTest {
   }
 
   @Test
-  public void msSql_does_supportMigration() throws Exception {
+  public void msSql_does_supportMigration() {
     assertThat(msSql.supportsMigration()).isTrue();
   }
 }
index 6694d035f684894e6f60da8fdb4b181251d88de7..b9d9990f8e87228ff2a5e9b44c2b836dc06925a5 100644 (file)
@@ -57,7 +57,7 @@ public class MySqlTest {
   }
 
   @Test
-  public void mysql_does_supportMigration() throws Exception {
+  public void mysql_does_supportMigration() {
     assertThat(mySql.supportsMigration()).isTrue();
   }
 }
index b3710e9f27eb49e1b75596db29bd0d105d6bba76..4b91a15a0409c24b1bceec324eb271138d5a9b48 100644 (file)
@@ -54,7 +54,7 @@ public class OracleTest {
   }
 
   @Test
-  public void oracle_does_supportMigration() throws Exception {
+  public void oracle_does_supportMigration() {
     assertThat(dialect.supportsMigration()).isTrue();
   }
 }
index 61a71212ac10b0ed0db5ff7a6ba5493f67b42c89..c6b437dc3bf630577c02e3f6271828735108b540 100644 (file)
@@ -59,7 +59,7 @@ public class PostgreSqlTest {
   }
 
   @Test
-  public void postgres_does_supportMigration() throws Exception {
+  public void postgres_does_supportMigration() {
     assertThat(dialect.supportsMigration()).isTrue();
   }
 }
index 9fbdfbd7845d4affc81441c7742eb8ebb3f3109f..16f58339d03927628853ca85ff942f29de84e53a 100644 (file)
@@ -70,7 +70,7 @@ public class InvocationUtilsTest {
   }
 
   @Test
-  public void only_static_methods() throws Exception {
+  public void only_static_methods() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(InvocationUtils.class)).isTrue();
 
   }
index bbf913777978a2fd66e2cc2b38d635f94a284ee2..d9b3ada4254b55510f8fda397e5db6dfc1a46767 100644 (file)
@@ -61,7 +61,7 @@ public class PluginClassloadersTest {
   }
 
   @Test
-  public void shouldImport() throws Exception {
+  public void shouldImport() {
     classloaders.add(DefaultPluginMetadata.create("foo").addDeployedFile(getFile("PluginClassloadersTest/foo.jar")));
     classloaders.add(DefaultPluginMetadata.create("bar").addDeployedFile(getFile("PluginClassloadersTest/bar.jar")));
     classloaders.done();
index 3b20680b2dc92cb2a4706cdd69e784a8ad41f1b5..908003b855e258109bc967c51d70932c5234ce4f 100644 (file)
@@ -51,7 +51,7 @@ public class PropertiesDaoTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
@@ -106,7 +106,7 @@ public class PropertiesDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void hasNotificationSubscribers() throws Exception {
+  public void hasNotificationSubscribers() {
     setupData("findNotificationSubscribers");
 
     // Nobody is subscribed
@@ -175,7 +175,7 @@ public class PropertiesDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_module_properties_tree() throws Exception {
+  public void select_module_properties_tree() {
     setupData("select_module_properties_tree");
 
     List<PropertyDto> properties = dao.selectEnabledDescendantModuleProperties("ABCD", session);
index c4ce1c89af738bb7611298a7752a99b6c6229d54..9a0605a2ee9e5a5aff2b9025b412602d0287e63d 100644 (file)
@@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 public class IdUuidPairsTest {
   @Test
-  public void extract_ids() throws Exception {
+  public void extract_ids() {
     List<IdUuidPair> idUuidPairList = Lists.newArrayList(new IdUuidPair(1L, "ABCD"), new IdUuidPair(2L, "EFGH"));
 
     List<Long> ids = IdUuidPairs.ids(idUuidPairList);
@@ -39,7 +39,7 @@ public class IdUuidPairsTest {
   }
 
   @Test
-  public void is_non_instantiable() throws Exception {
+  public void is_non_instantiable() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(IdUuidPairs.class)).isTrue();
   }
 
index 71dc8567ba1a3bd4e22b490cd825929162f38c0a..b78687ff1d04b63fb4cf7745fac53884687f1f9f 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 public class PurgeConfigurationTest {
   @Test
-  public void should_delete_all_closed_issues() throws Exception {
+  public void should_delete_all_closed_issues() {
     PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 0);
     assertThat(conf.maxLiveDateOfClosedIssues()).isNull();
 
@@ -37,7 +37,7 @@ public class PurgeConfigurationTest {
   }
 
   @Test
-  public void should_delete_only_old_closed_issues() throws Exception {
+  public void should_delete_only_old_closed_issues() {
     Date now = DateUtils.parseDate("2013-05-18");
 
     PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 30);
index 2ca41dc05c52b193422e47f084d1ef6901ddf02f..1be6ad63dd31315ccfcf2e8a03a2199ed38ebeca 100644 (file)
@@ -38,7 +38,7 @@ public class ProjectQgateAssociationDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_all_projects_by_query() throws Exception {
+  public void select_all_projects_by_query() {
     setupData("shared");
 
     ProjectQgateAssociationQuery query = ProjectQgateAssociationQuery.builder().gateId("42").build();
@@ -47,7 +47,7 @@ public class ProjectQgateAssociationDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_projects_by_query() throws Exception {
+  public void select_projects_by_query() {
     setupData("shared");
 
     assertThat(dao.selectProjects(ProjectQgateAssociationQuery.builder().gateId("42").membership(ProjectQgateAssociationQuery.IN).build(), 42L)).hasSize(3);
@@ -55,7 +55,7 @@ public class ProjectQgateAssociationDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void search_by_project_name() throws Exception {
+  public void search_by_project_name() {
     setupData("shared");
 
     List<ProjectQgateAssociationDto> result = dao.selectProjects(ProjectQgateAssociationQuery.builder().gateId("42").projectSearch("one").build(), 42L);
@@ -70,7 +70,7 @@ public class ProjectQgateAssociationDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_be_sorted_by_project_name() throws Exception {
+  public void should_be_sorted_by_project_name() {
     setupData("shared");
 
     List<ProjectQgateAssociationDto> result = dao.selectProjects(ProjectQgateAssociationQuery.builder().gateId("42").build(), 42L);
index 98cd26c18744c90570d563bf86641dea96249b75..e5213a74319468d85ae62b281c4eba00e66d8528 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ProjectQgateAssociationDtoTest {
 
   @Test
-  public void to_assoc_with_project_having_assoc() throws Exception {
+  public void to_assoc_with_project_having_assoc() {
     ProjectQgateAssociation project = new ProjectQgateAssociationDto()
       .setId(1L)
       .setName("polop")
@@ -40,7 +40,7 @@ public class ProjectQgateAssociationDtoTest {
   }
 
   @Test
-  public void to_assoc_with_project_not_having_assoc() throws Exception {
+  public void to_assoc_with_project_not_having_assoc() {
     ProjectQgateAssociation project = new ProjectQgateAssociationDto()
       .setId(1L)
       .setName("polop")
index 6269c92139c4d8cf3ceba75a4ae2ad0a217b5df9..0a08efecac9ef1e7fc0b7295bc0a5e52a25b983e 100644 (file)
@@ -28,7 +28,7 @@ import static org.junit.Assert.fail;
 public class ProjectQgateAssociationQueryTest {
 
   @Test
-  public void fail_on_null_login() throws Exception {
+  public void fail_on_null_login() {
     ProjectQgateAssociationQuery.Builder builder = ProjectQgateAssociationQuery.builder();
     builder.gateId(null);
 
@@ -41,7 +41,7 @@ public class ProjectQgateAssociationQueryTest {
   }
 
   @Test
-  public void fail_on_invalid_membership() throws Exception {
+  public void fail_on_invalid_membership() {
     ProjectQgateAssociationQuery.Builder builder = ProjectQgateAssociationQuery.builder();
     builder.gateId("nelson");
     builder.membership("unknwown");
index 6ca42061c5b7f261d5a6a301c6f6ebe1623ea890..7402e5c3456dc51ccdb19eb474518720ea12c362 100644 (file)
@@ -34,7 +34,7 @@ public class QualityGateConditionDaoTest extends AbstractDaoTestCase {
   private static QualityGateConditionDao dao;
 
   @Before
-  public void createDao() throws Exception {
+  public void createDao() {
     dao = new QualityGateConditionDao(getMyBatis());
   }
 
@@ -84,7 +84,7 @@ public class QualityGateConditionDaoTest extends AbstractDaoTestCase {
     checkTable("update", "quality_gate_conditions", COLUMNS_WITHOUT_TIMESTAMPS);
   }
 
-  public void shouldCleanConditions() throws Exception {
+  public void shouldCleanConditions() {
     setupData("shouldCleanConditions");
     dao.deleteConditionsWithInvalidMetrics();
     checkTables("shouldCleanConditions", "quality_gate_conditions");
index e5dd4364e5877a1062221cf547bdc0ccaeb5c73a..a7ac27d528685a81616482671dd8d997be2f2eb0 100644 (file)
@@ -33,7 +33,7 @@ public class QualityGateDaoTest extends AbstractDaoTestCase {
   private static QualityGateDao dao;
 
   @Before
-  public void createDao() throws Exception {
+  public void createDao() {
     dao = new QualityGateDao(getMyBatis());
   }
 
index 89c2970dba1b0a705641d4b0dee221f99e00cd8e..f2c1ddbf51b200d503f20033bf899c0d6781d518 100644 (file)
@@ -28,7 +28,7 @@ import static org.junit.Assert.fail;
 public class ActiveRuleKeyTest {
 
   @Test
-  public void of() throws Exception {
+  public void of() {
     RuleKey ruleKey = RuleKey.of("xoo", "R1");
     ActiveRuleKey key = ActiveRuleKey.of("P1", ruleKey);
     assertThat(key.qProfile()).isEqualTo("P1");
@@ -37,7 +37,7 @@ public class ActiveRuleKeyTest {
   }
 
   @Test
-  public void rule_key_can_contain_colons() throws Exception {
+  public void rule_key_can_contain_colons() {
     RuleKey ruleKey = RuleKey.of("squid", "Key:With:Some::Colons");
     ActiveRuleKey key = ActiveRuleKey.of("P1", ruleKey);
     assertThat(key.qProfile()).isEqualTo("P1");
@@ -46,7 +46,7 @@ public class ActiveRuleKeyTest {
   }
 
   @Test
-  public void profile_must_not_be_null() throws Exception {
+  public void profile_must_not_be_null() {
     try {
       ActiveRuleKey.of(null, RuleKey.of("xoo", "R1"));
       fail();
@@ -56,7 +56,7 @@ public class ActiveRuleKeyTest {
   }
 
   @Test
-  public void rule_key_must_not_be_null() throws Exception {
+  public void rule_key_must_not_be_null() {
     try {
       ActiveRuleKey.of("P1", null);
       fail();
@@ -66,7 +66,7 @@ public class ActiveRuleKeyTest {
   }
 
   @Test
-  public void parse() throws Exception {
+  public void parse() {
     ActiveRuleKey key = ActiveRuleKey.parse("P1:xoo:R1");
     assertThat(key.qProfile()).isEqualTo("P1");
     assertThat(key.ruleKey().repository()).isEqualTo("xoo");
@@ -74,7 +74,7 @@ public class ActiveRuleKeyTest {
   }
 
   @Test
-  public void parse_fail_when_less_than_three_colons() throws Exception {
+  public void parse_fail_when_less_than_three_colons() {
     try {
       ActiveRuleKey.parse("P1:xoo");
       fail();
@@ -84,7 +84,7 @@ public class ActiveRuleKeyTest {
   }
 
   @Test
-  public void equals_and_hashcode() throws Exception {
+  public void equals_and_hashcode() {
     ActiveRuleKey key1 = ActiveRuleKey.parse("P1:xoo:R1");
     ActiveRuleKey key1b = ActiveRuleKey.parse("P1:xoo:R1");
     ActiveRuleKey key2 = ActiveRuleKey.parse("P1:xoo:R2");
index c8238bb774041b8b652ac4aec142a2322e2c98ac..d930967fd12ab25381f9935712372f0ec574662a 100644 (file)
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ActiveRuleParamDtoTest {
 
   @Test
-  public void groupByKey() throws Exception {
+  public void groupByKey() {
     assertThat(ActiveRuleParamDto.groupByKey(Collections.<ActiveRuleParamDto>emptyList())).isEmpty();
 
     Collection<ActiveRuleParamDto> dtos = Arrays.asList(
index 2a8c5bcbcccbcff545bb05cb9935c5735b979f85..a3f75efac0bf1f64083563044d653575b0d9a86d 100644 (file)
@@ -62,7 +62,7 @@ public class DefaultResourcePermissionsTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
@@ -224,7 +224,7 @@ public class DefaultResourcePermissionsTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_fail_when_no_default_template_is_defined() throws Exception {
+  public void should_fail_when_no_default_template_is_defined() {
     throwable.expect(IllegalStateException.class);
 
     permissions.grantDefaultRoles(project);
index cb3f32dff329126c68b8b4d9af05167f9525b7cb..c154a7c0e80dcb1691f9726bb2bf9dc4aba92044 100644 (file)
@@ -59,7 +59,7 @@ public class ResourceDaoTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
@@ -291,7 +291,7 @@ public class ResourceDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_insert_using_existing_session() throws Exception {
+  public void should_insert_using_existing_session() {
     setupData("insert");
 
     ResourceDto file1 = new ResourceDto().setUuid("ABCD")
index fe0d55bd0402a1c86a8353f80b083ec7f1e81a31..227d0925cbb7dde2856145f1af113c5e0a212fbb 100644 (file)
@@ -89,7 +89,7 @@ public class ResourceKeyUpdaterDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void shouldNotUpdateAllSubmodules() throws Exception {
+  public void shouldNotUpdateAllSubmodules() {
     setupData("shouldNotUpdateAllSubmodules");
 
     dao.bulkUpdateKey(1, "org.struts", "org.apache.struts");
index 6794e0e47f11ab1cb506f950aed0cb19a04a6da6..b6e59773e8c4c59e573d20ed62495171f50850c0 100644 (file)
@@ -33,12 +33,12 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   private static RuleDao dao;
 
   @Before
-  public void createDao() throws Exception {
+  public void createDao() {
     dao = new RuleDao(getMyBatis());
   }
 
   @Test
-  public void select_enables_and_non_manual() throws Exception {
+  public void select_enables_and_non_manual() {
     setupData("select_enables_and_non_manual");
     List<RuleDto> ruleDtos = dao.selectEnablesAndNonManual();
 
@@ -63,7 +63,7 @@ public class RuleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void select_parameters() throws Exception {
+  public void select_parameters() {
     setupData("selectParameters");
     List<RuleParamDto> ruleDtos = dao.selectParameters();
 
index 4c35513a2945d01c5aa384fbde2ced23b1fdbd95..a9c08b44a17c6c734d1960f0c4b7a8e74cdb3007 100644 (file)
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class FileSourceDtoTest {
 
   @Test
-  public void encode_and_decode_test_data() throws Exception {
+  public void encode_and_decode_test_data() {
     List<FileSourceDb.Test> tests = Arrays.asList(
       FileSourceDb.Test.newBuilder()
         .setName("name#1")
index f0a97767e0e0100f51deeb31d66317de87113a03..3ea3a311fda2fd404157acffa7268a2dfe8df134 100644 (file)
@@ -34,7 +34,7 @@ public class DefaultTechnicalDebtModelTest {
   private DefaultTechnicalDebtModel sqaleModel;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     DefaultDebtModel debtModel = new DefaultDebtModel();
     debtModel.addCharacteristic(
       new DefaultDebtCharacteristic().setId(1)
@@ -53,7 +53,7 @@ public class DefaultTechnicalDebtModelTest {
   }
 
   @Test
-  public void get_characteristics() throws Exception {
+  public void get_characteristics() {
     assertThat(sqaleModel.rootCharacteristics()).hasSize(1);
 
     DefaultCharacteristic resultRootCharacteristic = sqaleModel.rootCharacteristics().get(0);
@@ -67,7 +67,7 @@ public class DefaultTechnicalDebtModelTest {
   }
 
   @Test
-  public void get_characteristic_by_key() throws Exception {
+  public void get_characteristic_by_key() {
     assertThat(sqaleModel.characteristicByKey("MEMORY_EFFICIENCY")).isNotNull();
     assertThat(sqaleModel.characteristicByKey("EFFICIENCY")).isNotNull();
     assertThat(sqaleModel.characteristicByKey("EFFICIENCY").parent()).isNotNull();
@@ -76,24 +76,24 @@ public class DefaultTechnicalDebtModelTest {
   }
 
   @Test
-  public void characteristic_by_id() throws Exception {
+  public void characteristic_by_id() {
     assertThat(sqaleModel.characteristicById(1)).isNotNull();
     assertThat(sqaleModel.characteristicById(2)).isNotNull();
     assertThat(sqaleModel.characteristicById(123)).isNull();
   }
 
   @Test
-  public void get_requirement_by_rule_key_always_return_null() throws Exception {
+  public void get_requirement_by_rule_key_always_return_null() {
     assertThat(sqaleModel.requirementsByRule(RuleKey.of("checkstyle", "Regexp"))).isNull();
   }
 
   @Test
-  public void get_requirement_by_id_always_return_null() throws Exception {
+  public void get_requirement_by_id_always_return_null() {
     assertThat(sqaleModel.requirementsById(1)).isNull();
   }
 
   @Test
-  public void get_requirements_always_return_empty_list() throws Exception {
+  public void get_requirements_always_return_empty_list() {
     assertThat(sqaleModel.requirements()).isEmpty();
   }
 
index fa86283adf7538b57ec228adccec9438a5c2f57a..1289e38132cd1938da30ef1ddf844176922dbb00 100644 (file)
@@ -172,7 +172,7 @@ public class CharacteristicDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void insert_characteristic() throws Exception {
+  public void insert_characteristic() {
     CharacteristicDto dto = new CharacteristicDto()
       .setKey("COMPILER_RELATED_PORTABILITY")
       .setName("Compiler related portability")
@@ -186,7 +186,7 @@ public class CharacteristicDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void update_characteristic() throws Exception {
+  public void update_characteristic() {
     setupData("update_characteristic");
 
     CharacteristicDto dto = new CharacteristicDto()
index 28b278d2e0bf3976bba6cd4d93fd68445cb0a111..8d66dd657bc7d8d1b939195f643cb05a9108a97a 100644 (file)
@@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class CharacteristicDtoTest {
 
   @Test
-  public void to_dto_from_characteristic() throws Exception {
+  public void to_dto_from_characteristic() {
     DefaultCharacteristic rootCharacteristic = new DefaultCharacteristic()
       .setId(1)
       .setKey("MEMORY_EFFICIENCY")
@@ -57,7 +57,7 @@ public class CharacteristicDtoTest {
   }
 
   @Test
-  public void to_characteristic() throws Exception {
+  public void to_characteristic() {
     DefaultCharacteristic rootCharacteristic = new DefaultCharacteristic()
       .setId(1)
       .setKey("MEMORY_EFFICIENCY")
index 63050f1e1a2f2a1ec2b353687145ec54bc16f424..c4ecf345a32e8b55df301b003b272fd27ac8873c 100644 (file)
@@ -31,12 +31,12 @@ public class LoadedTemplateDaoTest extends AbstractDaoTestCase {
   private LoadedTemplateDao dao;
 
   @Before
-  public void createDao() throws Exception {
+  public void createDao() {
     dao = new LoadedTemplateDao(getMyBatis());
   }
 
   @Test
-  public void shouldCountByTypeAndKey() throws Exception {
+  public void shouldCountByTypeAndKey() {
     setupData("shouldCountByTypeAndKey");
     assertThat(dao.countByTypeAndKey("DASHBOARD", "HOTSPOTS"), is(1));
     assertThat(dao.countByTypeAndKey("DASHBOARD", "UNKNOWN"), is(0));
@@ -44,7 +44,7 @@ public class LoadedTemplateDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void shouldInsert() throws Exception {
+  public void shouldInsert() {
     setupData("shouldInsert");
 
     LoadedTemplateDto template = new LoadedTemplateDto("SQALE", "DASHBOARD");
index 8b547471fe20ac32233c8d84d55915572a21c450..3d9fe278bb30093e73d1851c6415f672dd0157d4 100644 (file)
@@ -68,7 +68,7 @@ public class AuthorDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void shouldInsertAuthorAndDeveloper() throws Exception {
+  public void shouldInsertAuthorAndDeveloper() {
     setupData("shouldInsertAuthorAndDeveloper");
 
     String login = "developer@company.net";
@@ -82,7 +82,7 @@ public class AuthorDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void add_missing_module_uuid_path() throws Exception {
+  public void add_missing_module_uuid_path() {
     setupData("add_missing_module_uuid_path");
 
     dao.insertAuthorAndDeveloper("developer@company.net", new ResourceDto().setName("developer@company.net").setQualifier("DEV").setUuid("ABCD").setProjectUuid("ABCD")
@@ -109,7 +109,7 @@ public class AuthorDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void shouldPreventAuthorsAndDevelopersDuplication() throws Exception {
+  public void shouldPreventAuthorsAndDevelopersDuplication() {
     setupData("shouldPreventAuthorsAndDevelopersDuplication");
 
     String login = "developer@company.net";
index 3389d1f6204a833b35eb9759f7f3a1c6fe2851b2..1390d638c0ba83ddbfa2801e474a24c258f21bdb 100644 (file)
@@ -43,13 +43,13 @@ public class AuthorizationDaoTest extends AbstractDaoTestCase {
   AuthorizationDao authorization;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     session = getMyBatis().openSession(false);
     authorization = new AuthorizationDao(getMyBatis());
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
@@ -286,7 +286,7 @@ public class AuthorizationDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void should_return_global_permissions_for_group_anyone() throws Exception {
+  public void should_return_global_permissions_for_group_anyone() {
     setupData("should_return_global_permissions_for_group_anyone");
 
     assertThat(authorization.selectGlobalPermissions("anyone_user")).containsOnly("user", "profileadmin");
index 55da48e5823d40149f1b4949cb45d964fdb3253a..125f6e2d7e1b7648bef3def34dd74b9af73e8865 100644 (file)
@@ -34,7 +34,7 @@ public class DefaultUserFinderTest {
   DefaultUserFinder finder = new DefaultUserFinder(dao);
 
   @Test
-  public void findByLogin() throws Exception {
+  public void findByLogin() {
     UserDto dto = new UserDto().setLogin("david").setName("David").setEmail("dav@id.com");
     when(dao.selectActiveUserByLogin("david")).thenReturn(dto);
 
@@ -42,7 +42,7 @@ public class DefaultUserFinderTest {
   }
 
   @Test
-  public void findByLogins() throws Exception {
+  public void findByLogins() {
     UserDto david = new UserDto().setLogin("david").setName("David").setEmail("dav@id.com");
     UserDto john = new UserDto().setLogin("john").setName("John").setEmail("jo@hn.com");
     when(dao.selectUsersByLogins(Arrays.asList("david", "john"))).thenReturn(Arrays.asList(david, john));
@@ -55,7 +55,7 @@ public class DefaultUserFinderTest {
   }
 
   @Test
-  public void findByQuery() throws Exception {
+  public void findByQuery() {
     UserQuery query = UserQuery.builder().logins("simon").build();
     finder.find(query);
     verify(dao).selectUsers(query);
index 47f9fbd71aaf42c5db58bf4c7b3193938aae71a2..41434d92e6c8e7720d91a246c6bc4f18d39bbc25 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class GroupDtoTest {
 
   @Test
-  public void getter_and_setter() throws Exception {
+  public void getter_and_setter() {
     GroupDto dto = new GroupDto()
       .setId(1L)
       .setName("sonar-users")
index ea1fd3bdd5a87d577c41826362f8e5678bc5bbbc..d6cb76d9dcfe1d9aea124cb0d32cf14c82e644d8 100644 (file)
@@ -47,7 +47,7 @@ public class GroupMembershipDaoTest {
   }
 
   @Test
-  public void select_all_groups_by_query() throws Exception {
+  public void select_all_groups_by_query() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     GroupMembershipQuery query = GroupMembershipQuery.builder().login("arthur").build();
@@ -56,7 +56,7 @@ public class GroupMembershipDaoTest {
   }
 
   @Test
-  public void select_user_group() throws Exception {
+  public void select_user_group() {
     dbTester.prepareDbUnit(getClass(), "select_user_group.xml");
 
     GroupMembershipQuery query = GroupMembershipQuery.builder().login("arthur").build();
@@ -71,7 +71,7 @@ public class GroupMembershipDaoTest {
   }
 
   @Test
-  public void select_user_groups_by_query() throws Exception {
+  public void select_user_groups_by_query() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     // 200 is member of 3 groups
@@ -83,7 +83,7 @@ public class GroupMembershipDaoTest {
   }
 
   @Test
-  public void select_groups_not_affected_to_a_user_by_query() throws Exception {
+  public void select_groups_not_affected_to_a_user_by_query() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     // 200 is member of 3 groups
@@ -95,7 +95,7 @@ public class GroupMembershipDaoTest {
   }
 
   @Test
-  public void search_by_group_name() throws Exception {
+  public void search_by_group_name() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     List<GroupMembershipDto> result = dao.selectGroups(GroupMembershipQuery.builder().login("arthur").groupSearch("user").build(), 200L);
@@ -108,7 +108,7 @@ public class GroupMembershipDaoTest {
   }
 
   @Test
-  public void search_by_group_name_with_capitalization() throws Exception {
+  public void search_by_group_name_with_capitalization() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     List<GroupMembershipDto> result = dao.selectGroups(GroupMembershipQuery.builder().login("arthur").groupSearch("UsER").build(), 200L);
@@ -121,7 +121,7 @@ public class GroupMembershipDaoTest {
   }
 
   @Test
-  public void should_be_sorted_by_group_name() throws Exception {
+  public void should_be_sorted_by_group_name() {
     dbTester.prepareDbUnit(getClass(), "should_be_sorted_by_group_name.xml");
 
     List<GroupMembershipDto> result = dao.selectGroups(GroupMembershipQuery.builder().login("arthur").build(), 200L);
@@ -132,7 +132,7 @@ public class GroupMembershipDaoTest {
   }
 
   @Test
-  public void should_be_paginated() throws Exception {
+  public void should_be_paginated() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
 
     List<GroupMembershipDto> result = dao.selectGroups(GroupMembershipQuery.builder().login("arthur").build(), 200L, 0, 2);
@@ -151,7 +151,7 @@ public class GroupMembershipDaoTest {
   }
 
   @Test
-  public void count_groups() throws Exception {
+  public void count_groups() {
     dbTester.prepareDbUnit(getClass(), "shared.xml");
     DbSession session = dbTester.myBatis().openSession(false);
 
index f4825d7441e33d50d7ba91b1abd754fdc8b2e82d..a5148779db06a823a87fe5f2f3d3f7d2dbac2c6f 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class GroupMembershipDtoTest {
 
   @Test
-  public void to_group_with_permission_having_permission() throws Exception {
+  public void to_group_with_permission_having_permission() {
     GroupMembership group = new GroupMembershipDto()
       .setId(1L)
       .setName("users")
@@ -42,7 +42,7 @@ public class GroupMembershipDtoTest {
   }
 
   @Test
-  public void to_group_with_permission_not_having_permission() throws Exception {
+  public void to_group_with_permission_not_having_permission() {
     GroupMembership group = new GroupMembershipDto()
       .setId(1L)
       .setName("users")
index 393e9288fb5ba2b7165b5657890a3dd9f0624941..8478c83c10b873763195c9ab1adf3813f0d4e822 100644 (file)
@@ -28,7 +28,7 @@ import static org.junit.Assert.fail;
 public class GroupMembershipQueryTest {
 
   @Test
-  public void fail_on_null_login() throws Exception {
+  public void fail_on_null_login() {
     GroupMembershipQuery.Builder builder = GroupMembershipQuery.builder();
     builder.login(null);
 
@@ -41,7 +41,7 @@ public class GroupMembershipQueryTest {
   }
 
   @Test
-  public void fail_on_invalid_membership() throws Exception {
+  public void fail_on_invalid_membership() {
     GroupMembershipQuery.Builder builder = GroupMembershipQuery.builder();
     builder.login("nelson");
     builder.membership("unknwown");
index d3f0051d8eededf404ead2001c99c177ec072112..932f25c874ab135f3bfd1516923a25ed183d47ba 100644 (file)
@@ -38,18 +38,18 @@ public class RoleDaoTest extends AbstractDaoTestCase {
   RoleDao dao;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     session = getMyBatis().openSession(false);
     dao = new RoleDao();
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
   @Test
-  public void retrieve_global_user_permissions() throws Exception {
+  public void retrieve_global_user_permissions() {
     setupData("globalUserPermissions");
 
     assertThat(dao.selectUserPermissions(session, "admin_user", null)).containsOnly(GlobalPermissions.SYSTEM_ADMIN, GlobalPermissions.QUALITY_PROFILE_ADMIN);
@@ -57,7 +57,7 @@ public class RoleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void retrieve_resource_user_permissions() throws Exception {
+  public void retrieve_resource_user_permissions() {
     setupData("resourceUserPermissions");
 
     assertThat(dao.selectUserPermissions(session, "admin_user", 1L)).containsOnly(UserRole.ADMIN, UserRole.USER);
@@ -65,7 +65,7 @@ public class RoleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void retrieve_global_group_permissions() throws Exception {
+  public void retrieve_global_group_permissions() {
     setupData("globalGroupPermissions");
 
     assertThat(dao.selectGroupPermissions(session, "sonar-administrators", null)).containsOnly(GlobalPermissions.SYSTEM_ADMIN, GlobalPermissions.QUALITY_PROFILE_ADMIN,
@@ -77,7 +77,7 @@ public class RoleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void retrieve_resource_group_permissions() throws Exception {
+  public void retrieve_resource_group_permissions() {
     setupData("resourceGroupPermissions");
 
     assertThat(dao.selectGroupPermissions(session, "sonar-administrators", 1L)).containsOnly(UserRole.ADMIN, UserRole.CODEVIEWER);
@@ -85,7 +85,7 @@ public class RoleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void delete_global_user_permission() throws Exception {
+  public void delete_global_user_permission() {
     setupData("globalUserPermissions");
 
     UserRoleDto userRoleToDelete = new UserRoleDto().setUserId(200L).setRole(GlobalPermissions.QUALITY_PROFILE_ADMIN);
@@ -97,7 +97,7 @@ public class RoleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void delete_resource_user_permission() throws Exception {
+  public void delete_resource_user_permission() {
     setupData("resourceUserPermissions");
 
     UserRoleDto userRoleToDelete = new UserRoleDto().setUserId(200L).setRole(UserRole.USER).setResourceId(1L);
@@ -109,7 +109,7 @@ public class RoleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void delete_global_group_permission() throws Exception {
+  public void delete_global_group_permission() {
     setupData("globalGroupPermissions");
 
     GroupRoleDto groupRoleToDelete = new GroupRoleDto().setGroupId(100L).setRole(GlobalPermissions.QUALITY_PROFILE_ADMIN);
@@ -121,7 +121,7 @@ public class RoleDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void delete_resource_group_permission() throws Exception {
+  public void delete_resource_group_permission() {
     setupData("resourceGroupPermissions");
 
     GroupRoleDto groupRoleToDelete = new GroupRoleDto().setGroupId(100L).setRole(UserRole.CODEVIEWER).setResourceId(1L);
index 921502788698c4b163188b000a925162e0dd1b8a..c1d92ffd452a55ebfbabfe4b85afd80ac53849b4 100644 (file)
@@ -53,7 +53,7 @@ public class UserDaoTest extends AbstractDaoTestCase {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
@@ -77,7 +77,7 @@ public class UserDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void selectUsersByLogins() throws Exception {
+  public void selectUsersByLogins() {
     setupData("selectUsersByLogins");
 
     Collection<UserDto> users = dao.selectUsersByLogins(Arrays.asList("marius", "inactive_user", "other"));
@@ -86,14 +86,14 @@ public class UserDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void selectUsersByLogins_empty_logins() throws Exception {
+  public void selectUsersByLogins_empty_logins() {
     // no need to access db
     Collection<UserDto> users = dao.selectUsersByLogins(Collections.<String>emptyList());
     assertThat(users).isEmpty();
   }
 
   @Test
-  public void selectUsersByQuery_all() throws Exception {
+  public void selectUsersByQuery_all() {
     setupData("selectUsersByQuery");
 
     UserQuery query = UserQuery.builder().includeDeactivated().build();
@@ -102,7 +102,7 @@ public class UserDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void selectUsersByQuery_only_actives() throws Exception {
+  public void selectUsersByQuery_only_actives() {
     setupData("selectUsersByQuery");
 
     UserQuery query = UserQuery.ALL_ACTIVES;
@@ -112,7 +112,7 @@ public class UserDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void selectUsersByQuery_filter_by_login() throws Exception {
+  public void selectUsersByQuery_filter_by_login() {
     setupData("selectUsersByQuery");
 
     UserQuery query = UserQuery.builder().logins("marius", "john").build();
@@ -122,7 +122,7 @@ public class UserDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void selectUsersByQuery_search_by_login_text() throws Exception {
+  public void selectUsersByQuery_search_by_login_text() {
     setupData("selectUsersByText");
 
     UserQuery query = UserQuery.builder().searchText("sbr").build();
@@ -132,7 +132,7 @@ public class UserDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void selectUsersByQuery_search_by_name_text() throws Exception {
+  public void selectUsersByQuery_search_by_name_text() {
     setupData("selectUsersByText");
 
     UserQuery query = UserQuery.builder().searchText("Simon").build();
@@ -142,7 +142,7 @@ public class UserDaoTest extends AbstractDaoTestCase {
   }
 
   @Test
-  public void selectUsersByQuery_escape_special_characters_in_like() throws Exception {
+  public void selectUsersByQuery_escape_special_characters_in_like() {
     setupData("selectUsersByText");
 
     UserQuery query = UserQuery.builder().searchText("%s%").build();
index 23150850e60ec054e2b544dcaa3a877ed900dafd..ca2ce0601bd4515f1080b06192f86af14c023280 100644 (file)
@@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class UserDtoTest {
 
   @Test
-  public void encode_scm_accounts() throws Exception {
+  public void encode_scm_accounts() {
     assertThat(UserDto.encodeScmAccounts(null)).isNull();
     assertThat(UserDto.encodeScmAccounts(Collections.<String>emptyList())).isNull();
     assertThat(UserDto.encodeScmAccounts(Arrays.asList("foo"))).isEqualTo("\nfoo\n");
@@ -37,7 +37,7 @@ public class UserDtoTest {
   }
 
   @Test
-  public void decode_scm_accounts() throws Exception {
+  public void decode_scm_accounts() {
     assertThat(UserDto.decodeScmAccounts(null)).isEmpty();
     assertThat(UserDto.decodeScmAccounts("\nfoo\n")).containsOnly("foo");
     assertThat(UserDto.decodeScmAccounts("\nfoo\nbar\n")).containsOnly("foo", "bar");
index c7f40b0c83b9812c608cb18408e116ce1de22981..9f5109a36b3429382eb0fa9debbec2f2de4c1c22 100644 (file)
@@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 public class MultiSetsTest {
   @Test
-  public void order_with_highest_count_first() throws Exception {
+  public void order_with_highest_count_first() {
     Multiset<String> multiset = HashMultiset.create();
     add(multiset, "seneca", 10);
     add(multiset, "plato", 5);
index 45f4ae03548ee03ab4a21d5275b6350ccf09d061..100ab15cce337e1977b4c77005a619baee285666 100644 (file)
@@ -29,7 +29,7 @@ public class NonNullInputFunctionTest {
   NonNullInputFunction<String, Integer> sut = new TestFunction();
 
   @Test
-  public void fail_if_null_input() throws Exception {
+  public void fail_if_null_input() {
     try {
       sut.apply(null);
       fail();
@@ -39,7 +39,7 @@ public class NonNullInputFunctionTest {
   }
 
   @Test
-  public void apply() throws Exception {
+  public void apply() {
     assertThat(sut.apply("foo")).isEqualTo(3);
   }
 
index b9a58a2605b18ab9f2db3198434fe2cac55d8dfb..d525fe3c7c6f782aeb44d8e2d1735dfd741580ac 100644 (file)
@@ -38,7 +38,7 @@ public class MeasuresDaoTest extends AbstractDbUnitTestCase {
   private ResourceModel project;
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     service = new MeasuresDao(getSession());
     project = new ResourceModel(ResourceModel.SCOPE_PROJECT, "foo:bar", ResourceModel.QUALIFIER_PROJECT_TRUNK, null, "Foo");
     project.setName("project name");
index af7ba9655af552ecd531f6ad45e0003046c640d3..b3d0c14da46a9999eadabe9d3a53b60647df88c9 100644 (file)
@@ -50,7 +50,7 @@ public class DatabaseSessionTest extends AbstractDbUnitTestCase {
   }
 
   @Test
-  public void performanceTestOnBatchInserts() throws Exception {
+  public void performanceTestOnBatchInserts() {
     getSession().save(project1);
     Snapshot snapshot = new Snapshot(project1, true, "", new Date(1));
     getSession().save(snapshot);
index 4cc3bda88721264695e476838ccf936e5ddfff2e..d2d098b9402bdfcc60fbe7be89c4f2358507e941 100644 (file)
@@ -72,7 +72,7 @@ public class NoSonarFilterTest {
   }
 
   @Test
-  public void should_accept_violations_from_no_sonar_rules() throws Exception {
+  public void should_accept_violations_from_no_sonar_rules() {
     // The "No Sonar" rule logs violations on the lines that are flagged with "NOSONAR" !!
 
     Set<Integer> noSonarLines = new HashSet<Integer>();
index 22af2e52a7327ed92c4e09733a01fc45b1b73efc..59125570012bbb03174a20ddccea50d585d11cbd 100644 (file)
@@ -42,7 +42,7 @@ public class FileCacheBuilderTest {
   }
 
   @Test
-  public void user_home_property_can_be_null() throws Exception {
+  public void user_home_property_can_be_null() {
     FileCache cache = new FileCacheBuilder().setUserHome((String) null).build();
 
     // does not fail. It uses default path or env variable
@@ -51,7 +51,7 @@ public class FileCacheBuilderTest {
   }
 
   @Test
-  public void use_default_path_or_env_variable() throws Exception {
+  public void use_default_path_or_env_variable() {
     FileCache cache = new FileCacheBuilder().build();
 
     assertThat(cache.getDir()).isDirectory().exists();
index 2387a796ab7983cccc94d429e69da8617e4bb8e6..c831e5af598404557002118adddb63a763fcb90c 100644 (file)
@@ -122,7 +122,7 @@ public class FileCacheTest {
   }
 
   @Test
-  public void unzip_from_cache() throws IOException, URISyntaxException, InterruptedException, ExecutionException {
+  public void unzip_from_cache() throws IOException, URISyntaxException {
     final File samplePlugin = new File(this.getClass().getResource("/sonar-checkstyle-plugin-2.8.jar").toURI());
     FileHashes hashes = mock(FileHashes.class);
     final FileCache cache = new FileCache(tempFolder.newFolder(), log, hashes);
index d81198ba11d227cfb4ada57526434c48ea8611f6..09c65ee553d4b08e3c249cafcf9d5f768890917e 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class DebtRemediationFunctionTest {
 
   @Test
-  public void create_linear() throws Exception {
+  public void create_linear() {
     DebtRemediationFunction function = DebtRemediationFunction.createLinear(Duration.create(10));
     assertThat(function.type()).isEqualTo(DebtRemediationFunction.Type.LINEAR);
     assertThat(function.coefficient()).isEqualTo(Duration.create(10));
@@ -36,7 +36,7 @@ public class DebtRemediationFunctionTest {
   }
 
   @Test
-  public void create_linear_with_offset() throws Exception {
+  public void create_linear_with_offset() {
     DebtRemediationFunction function = DebtRemediationFunction.createLinearWithOffset(Duration.create(10), Duration.create(5));
     assertThat(function.type()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET);
     assertThat(function.coefficient()).isEqualTo(Duration.create(10));
@@ -44,7 +44,7 @@ public class DebtRemediationFunctionTest {
   }
 
   @Test
-  public void create_constant_per_issue() throws Exception {
+  public void create_constant_per_issue() {
     DebtRemediationFunction function = DebtRemediationFunction.createConstantPerIssue(Duration.create(10));
     assertThat(function.type()).isEqualTo(DebtRemediationFunction.Type.CONSTANT_ISSUE);
     assertThat(function.coefficient()).isNull();
index 0dd4dca7531edbcd8260683937cbbe9e176850e7..932e7d22d0ad01ad3ef1a64fb6e49ff094c730f7 100644 (file)
@@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class DefaultDebtCharacteristicTest {
 
   @Test
-  public void setter_and_getter_on_characteristic() throws Exception {
+  public void setter_and_getter_on_characteristic() {
     DefaultDebtCharacteristic debtCharacteristic = new DefaultDebtCharacteristic()
       .setId(1)
       .setKey("PORTABILITY")
@@ -49,7 +49,7 @@ public class DefaultDebtCharacteristicTest {
   }
 
   @Test
-  public void setter_and_getter_on_sub_characteristic() throws Exception {
+  public void setter_and_getter_on_sub_characteristic() {
     DefaultDebtCharacteristic debtCharacteristic = new DefaultDebtCharacteristic()
       .setId(1)
       .setKey("COMPILER")
@@ -69,7 +69,7 @@ public class DefaultDebtCharacteristicTest {
   }
 
   @Test
-  public void to_string() throws Exception {
+  public void to_string() {
     assertThat(new DefaultDebtCharacteristic()
       .setId(1)
       .setKey("PORTABILITY")
index 944c892ca722db5d8ea0e567266808251c33f4f7..6840f37d57605e93fd953db6bf0131662be727e4 100644 (file)
@@ -30,7 +30,7 @@ public class DefaultDebtModelTest {
   private DefaultDebtModel debtModel;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     debtModel = new DefaultDebtModel()
       .addCharacteristic(
         new DefaultDebtCharacteristic().setId(1)
@@ -48,22 +48,22 @@ public class DefaultDebtModelTest {
   }
 
   @Test
-  public void all_characteristics() throws Exception {
+  public void all_characteristics() {
     assertThat(debtModel.allCharacteristics()).hasSize(2);
   }
 
   @Test
-  public void characteristics() throws Exception {
+  public void characteristics() {
     assertThat(debtModel.characteristics()).hasSize(1);
   }
 
   @Test
-  public void sub_characteristics() throws Exception {
+  public void sub_characteristics() {
     assertThat(debtModel.subCharacteristics("MEMORY_EFFICIENCY")).hasSize(1);
   }
 
   @Test
-  public void characteristic_by_id() throws Exception {
+  public void characteristic_by_id() {
     DefaultDebtCharacteristic debtCharacteristic = (DefaultDebtCharacteristic) debtModel.characteristicById(1);
     assertThat(debtCharacteristic).isNotNull();
     assertThat(debtCharacteristic.id()).isEqualTo(1);
@@ -78,7 +78,7 @@ public class DefaultDebtModelTest {
   }
 
   @Test
-  public void characteristic_by_key() throws Exception {
+  public void characteristic_by_key() {
     DefaultDebtCharacteristic debtCharacteristic = (DefaultDebtCharacteristic) debtModel.characteristicByKey("EFFICIENCY");
     assertThat(debtCharacteristic).isNotNull();
     assertThat(debtCharacteristic.id()).isEqualTo(2);
index 4fdabac2ad9ebae9b7435ab209bf7843ad4f9a27..1877b74831cc784c471f683161fd586415ad9871 100644 (file)
@@ -53,45 +53,45 @@ public class DefaultFilePredicatesTest {
   }
 
   @Test
-  public void all() throws Exception {
+  public void all() {
     Assertions.assertThat(predicates.all().apply(javaFile)).isTrue();
   }
 
   @Test
-  public void none() throws Exception {
+  public void none() {
     assertThat(predicates.none().apply(javaFile)).isFalse();
   }
 
   @Test
-  public void matches_inclusion_pattern() throws Exception {
+  public void matches_inclusion_pattern() {
     assertThat(predicates.matchesPathPattern("src/main/**/Action.java").apply(javaFile)).isTrue();
     assertThat(predicates.matchesPathPattern("Action.java").apply(javaFile)).isFalse();
     assertThat(predicates.matchesPathPattern("src/**/*.php").apply(javaFile)).isFalse();
   }
 
   @Test
-  public void matches_inclusion_patterns() throws Exception {
+  public void matches_inclusion_patterns() {
     assertThat(predicates.matchesPathPatterns(new String[] {"src/other/**.java", "src/main/**/Action.java"}).apply(javaFile)).isTrue();
     assertThat(predicates.matchesPathPatterns(new String[] {}).apply(javaFile)).isTrue();
     assertThat(predicates.matchesPathPatterns(new String[] {"src/other/**.java", "src/**/*.php"}).apply(javaFile)).isFalse();
   }
 
   @Test
-  public void does_not_match_exclusion_pattern() throws Exception {
+  public void does_not_match_exclusion_pattern() {
     assertThat(predicates.doesNotMatchPathPattern("src/main/**/Action.java").apply(javaFile)).isFalse();
     assertThat(predicates.doesNotMatchPathPattern("Action.java").apply(javaFile)).isTrue();
     assertThat(predicates.doesNotMatchPathPattern("src/**/*.php").apply(javaFile)).isTrue();
   }
 
   @Test
-  public void does_not_match_exclusion_patterns() throws Exception {
+  public void does_not_match_exclusion_patterns() {
     assertThat(predicates.doesNotMatchPathPatterns(new String[] {}).apply(javaFile)).isTrue();
     assertThat(predicates.doesNotMatchPathPatterns(new String[] {"src/other/**.java", "src/**/*.php"}).apply(javaFile)).isTrue();
     assertThat(predicates.doesNotMatchPathPatterns(new String[] {"src/other/**.java", "src/main/**/Action.java"}).apply(javaFile)).isFalse();
   }
 
   @Test
-  public void has_relative_path() throws Exception {
+  public void has_relative_path() {
     assertThat(predicates.hasRelativePath("src/main/java/struts/Action.java").apply(javaFile)).isTrue();
     assertThat(predicates.hasRelativePath("src/main/java/struts/Other.java").apply(javaFile)).isFalse();
 
@@ -139,38 +139,38 @@ public class DefaultFilePredicatesTest {
   }
 
   @Test
-  public void has_language() throws Exception {
+  public void has_language() {
     assertThat(predicates.hasLanguage("java").apply(javaFile)).isTrue();
     assertThat(predicates.hasLanguage("php").apply(javaFile)).isFalse();
   }
 
   @Test
-  public void has_languages() throws Exception {
+  public void has_languages() {
     assertThat(predicates.hasLanguages(Arrays.asList("java", "php")).apply(javaFile)).isTrue();
     assertThat(predicates.hasLanguages(Arrays.asList("cobol", "php")).apply(javaFile)).isFalse();
     assertThat(predicates.hasLanguages(Collections.<String>emptyList()).apply(javaFile)).isTrue();
   }
 
   @Test
-  public void has_status() throws Exception {
+  public void has_status() {
     assertThat(predicates.hasStatus(InputFile.Status.ADDED).apply(javaFile)).isTrue();
     assertThat(predicates.hasStatus(InputFile.Status.CHANGED).apply(javaFile)).isFalse();
   }
 
   @Test
-  public void has_type() throws Exception {
+  public void has_type() {
     assertThat(predicates.hasType(InputFile.Type.MAIN).apply(javaFile)).isTrue();
     assertThat(predicates.hasType(InputFile.Type.TEST).apply(javaFile)).isFalse();
   }
 
   @Test
-  public void not() throws Exception {
+  public void not() {
     assertThat(predicates.not(predicates.hasType(InputFile.Type.MAIN)).apply(javaFile)).isFalse();
     assertThat(predicates.not(predicates.hasType(InputFile.Type.TEST)).apply(javaFile)).isTrue();
   }
 
   @Test
-  public void and() throws Exception {
+  public void and() {
     // empty
     assertThat(predicates.and().apply(javaFile)).isTrue();
     assertThat(predicates.and(new FilePredicate[0]).apply(javaFile)).isTrue();
@@ -191,7 +191,7 @@ public class DefaultFilePredicatesTest {
   }
 
   @Test
-  public void or() throws Exception {
+  public void or() {
     // empty
     assertThat(predicates.or().apply(javaFile)).isTrue();
     assertThat(predicates.or(new FilePredicate[0]).apply(javaFile)).isTrue();
index 6c7a5bd9f0d7f86e278c583a562e7e50d3212d4e..0b9ecdeecec3f9de91f7ab368c7817f63e30e269 100644 (file)
@@ -70,7 +70,7 @@ public class DefaultFileSystemTest {
   }
 
   @Test
-  public void add_languages() throws Exception {
+  public void add_languages() {
     assertThat(fs.languages()).isEmpty();
 
     fs.addLanguages("java", "php", "cobol");
@@ -78,7 +78,7 @@ public class DefaultFileSystemTest {
   }
 
   @Test
-  public void files() throws Exception {
+  public void files() {
     assertThat(fs.inputFiles(fs.predicates().all())).isEmpty();
 
     fs.add(new DefaultInputFile("foo", "src/Foo.php").setLanguage("php"));
@@ -108,13 +108,13 @@ public class DefaultFileSystemTest {
   }
 
   @Test
-  public void input_file_returns_null_if_file_not_found() throws Exception {
+  public void input_file_returns_null_if_file_not_found() {
     assertThat(fs.inputFile(fs.predicates().hasRelativePath("src/Bar.java"))).isNull();
     assertThat(fs.inputFile(fs.predicates().hasLanguage("cobol"))).isNull();
   }
 
   @Test
-  public void input_file_fails_if_too_many_results() throws Exception {
+  public void input_file_fails_if_too_many_results() {
     thrown.expect(IllegalArgumentException.class);
     thrown.expectMessage("expected one element");
 
@@ -125,7 +125,7 @@ public class DefaultFileSystemTest {
   }
 
   @Test
-  public void input_file_supports_non_indexed_predicates() throws Exception {
+  public void input_file_supports_non_indexed_predicates() {
     fs.add(new DefaultInputFile("foo", "src/Bar.java").setLanguage("java"));
 
     // it would fail if more than one java file
index aa0e0c4abe534734ee5d9005754a81fb9c5d62a2..b1bb79fce9b470a23d6db7f7919052334198401a 100644 (file)
@@ -33,7 +33,7 @@ public class PathPatternTest {
   public TemporaryFolder temp = new TemporaryFolder();
 
   @Test
-  public void match_relative_path() throws Exception {
+  public void match_relative_path() {
     PathPattern pattern = PathPattern.create("**/*Foo.java");
     assertThat(pattern.toString()).isEqualTo("**/*Foo.java");
 
@@ -91,7 +91,7 @@ public class PathPatternTest {
   }
 
   @Test
-  public void create_array_of_patterns() throws Exception {
+  public void create_array_of_patterns() {
     PathPattern[] patterns = PathPattern.create(new String[] {
       "**/src/main/**Foo.java",
       "file:**/src/main/**Bar.java"
index b3a7c4306f9509ccace61d18420b79f157f935e8..29cfc369d0a17a99ac5fb89b4e9f44e14a4ba46d 100644 (file)
@@ -30,14 +30,14 @@ import static org.junit.Assert.fail;
 
 public class ActiveRulesBuilderTest {
   @Test
-  public void no_rules() throws Exception {
+  public void no_rules() {
     ActiveRulesBuilder builder = new ActiveRulesBuilder();
     ActiveRules rules = builder.build();
     assertThat(rules.findAll()).isEmpty();
   }
 
   @Test
-  public void build_rules() throws Exception {
+  public void build_rules() {
     ActiveRules activeRules = new ActiveRulesBuilder()
       .create(RuleKey.of("squid", "S0001"))
       .setName("My Rule")
@@ -78,7 +78,7 @@ public class ActiveRulesBuilderTest {
   }
 
   @Test
-  public void fail_to_add_twice_the_same_rule() throws Exception {
+  public void fail_to_add_twice_the_same_rule() {
     ActiveRulesBuilder builder = new ActiveRulesBuilder();
     builder.create(RuleKey.of("squid", "S0001")).activate();
     try {
index 6dcd026ef351657ad5a6712ad38ae45fdd09d8f4..95f0cea83cdc6dbbdee56dfad05f09fa2b1db266 100644 (file)
@@ -33,14 +33,14 @@ import static org.junit.Assert.fail;
 
 public class RulesBuilderTest {
   @Test
-  public void no_rules() throws Exception {
+  public void no_rules() {
     RulesBuilder builder = new RulesBuilder();
     Rules rules = builder.build();
     assertThat(rules.findAll()).isEmpty();
   }
 
   @Test
-  public void build_rules() throws Exception {
+  public void build_rules() {
     RulesBuilder builder = new RulesBuilder();
     NewRule newSquid1 = builder.add(RuleKey.of("squid", "S0001"));
     newSquid1.setName("Detect bug");
@@ -95,7 +95,7 @@ public class RulesBuilderTest {
   }
 
   @Test
-  public void fail_to_add_twice_the_same_rule() throws Exception {
+  public void fail_to_add_twice_the_same_rule() {
     RulesBuilder builder = new RulesBuilder();
     builder.add(RuleKey.of("squid", "S0001"));
     try {
@@ -107,7 +107,7 @@ public class RulesBuilderTest {
   }
 
   @Test
-  public void fail_to_add_twice_the_same_param() throws Exception {
+  public void fail_to_add_twice_the_same_param() {
     RulesBuilder builder = new RulesBuilder();
     NewRule newRule = builder.add(RuleKey.of("squid", "S0001"));
     newRule.addParam("min");
index 03726d4d74aaa5c9bf8db6b67ef973108937c662..acd24d674cb10ded14389dd9f5f9c00ed07feb7b 100644 (file)
@@ -67,7 +67,7 @@ public class DefaultHighlightingTest {
   }
 
   @Test
-  public void should_register_highlighting_rule() throws Exception {
+  public void should_register_highlighting_rule() {
     assertThat(highlightingRules).hasSize(6);
   }
 
@@ -76,7 +76,7 @@ public class DefaultHighlightingTest {
   }
 
   @Test
-  public void should_order_by_start_then_end_offset() throws Exception {
+  public void should_order_by_start_then_end_offset() {
     assertThat(highlightingRules).extracting("range", TextRange.class).containsExactly(rangeOf(1, 0, 1, 10),
       rangeOf(1, 10, 1, 12),
       rangeOf(1, 12, 1, 20),
@@ -87,7 +87,7 @@ public class DefaultHighlightingTest {
   }
 
   @Test
-  public void should_suport_overlapping() throws Exception {
+  public void should_suport_overlapping() {
     new DefaultHighlighting(mock(SensorStorage.class))
       .onFile(INPUT_FILE)
       .highlight(0, 15, KEYWORD)
@@ -96,7 +96,7 @@ public class DefaultHighlightingTest {
   }
 
   @Test
-  public void should_prevent_boudaries_overlapping() throws Exception {
+  public void should_prevent_boudaries_overlapping() {
     throwable.expect(IllegalStateException.class);
     throwable
       .expectMessage("Cannot register highlighting rule for characters at Range[from [line=1, lineOffset=8] to [line=1, lineOffset=15]] as it overlaps at least one existing rule");
index b2dccf589b309c062fe69c6e3679665c5d67fe12..ad50caadfc6b2ca8c4203b20f0b0688766b4ad12 100644 (file)
@@ -175,7 +175,7 @@ public class AesCipherTest {
   }
 
   @Test
-  public void doesNotHaveSecretKey() throws Exception {
+  public void doesNotHaveSecretKey() {
     AesCipher cipher = new AesCipher("/my/twitter/id/is/SimonBrandhof");
 
     assertThat(cipher.hasSecretKey(), Matchers.is(false));
index 3a9fc4d29a2b7cc4da6764c14101cc5cfdb0b56b..2244d81f0a645d0934fbdbe6b99e4bca4fabfc17 100644 (file)
@@ -39,12 +39,12 @@ public class CategoryTest {
   }
 
   @Test
-  public void should_normalize_key() throws Exception {
+  public void should_normalize_key() {
     assertThat(new Category("Licenses").key()).isEqualTo("licenses");
   }
 
   @Test
-  public void should_use_original_key() throws Exception {
+  public void should_use_original_key() {
     assertThat(new Category("Licenses").toString()).isEqualTo("Licenses");
   }
 
index ff14eae997f3581277527b5219b77407c7cbdc04..32a2d772d0b7cacf7aa11f835fa50b67ee61f2b2 100644 (file)
@@ -123,7 +123,7 @@ public class SettingsTest {
   }
 
   @Test
-  public void setProperty_date() throws Exception {
+  public void setProperty_date() {
     Settings settings = new Settings();
     Date date = DateUtils.parseDateTime("2010-05-18T15:50:45+0100");
     settings.setProperty("aDate", date);
index 24547b68d06ab8084e3ae95662ab7347d323c7d6..4a8ec6601a0ae8262aaca2bafa4a251ead895f66 100644 (file)
@@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 public class MeasureModelTest {
   @Test
-  public void text_is_utf8() throws UnsupportedEncodingException {
+  public void text_is_utf8() {
     String s = "accents Ã©Ã  and special characters Ã§â‚¬";
 
     MeasureModel measure = new MeasureModel();
index ddcaacbb9920e09a19e59b4a1d7ad40e365d3df8..230826a8b8752d8cebd17fcfbb02df80d11a72ba 100644 (file)
@@ -69,7 +69,7 @@ public class NoSonarFilterTest {
   }
 
   @Test
-  public void should_accept_issues_on_no_sonar_rules() throws Exception {
+  public void should_accept_issues_on_no_sonar_rules() {
     // The "No Sonar" rule logs violations on the lines that are flagged with "NOSONAR" !!
     Issue issue = mock(Issue.class);
     when(issue.componentKey()).thenReturn("struts:org.apache.Action");
index a2d1aef5eefec41af6588e38678da4e5436602c4..e1fb1f2bb416cee4eb7c8a29e920fd0a2035a38e 100644 (file)
@@ -48,7 +48,7 @@ public class ActionTest {
   }
 
   @Test
-  public void key_should_be_set() throws Exception {
+  public void key_should_be_set() {
     try {
       new Action("");
       fail();
@@ -58,7 +58,7 @@ public class ActionTest {
   }
 
   @Test
-  public void should_verify_conditions() throws Exception {
+  public void should_verify_conditions() {
     DefaultIssue issue = new DefaultIssue();
     Action action = new Action("link-to-jira")
       .setConditions(condition1, condition2);
index 898d15704586dc0dcf13291f9e0447c7960e0ca4..805cfd9a49e00eaa58da084a8e0214241503f35a 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ActionsTest {
 
   @Test
-  public void add_action() throws Exception {
+  public void add_action() {
     Actions actions = new Actions();
     actions.add("plan");
 
index fe0937fe1d4a8c4cf94b813e42beeaf4675d9b99..67467178ba150f569700dd56810364d9605cb476 100644 (file)
@@ -30,7 +30,7 @@ public class HasResolutionTest {
   DefaultIssue issue = new DefaultIssue();
 
   @Test
-  public void should_match() throws Exception {
+  public void should_match() {
     HasResolution condition = new HasResolution(Issue.RESOLUTION_FIXED, Issue.RESOLUTION_FALSE_POSITIVE);
 
     assertThat(condition.matches(issue.setResolution("FIXED"))).isTrue();
index ab9705a706833c54daecd113f82e54435e0c4eb0..4b3b6e834cd5a2c2d8e51294f83fc4c361e7d9f4 100644 (file)
@@ -30,7 +30,7 @@ public class HasStatusTest {
   DefaultIssue issue = new DefaultIssue();
 
   @Test
-  public void should_match() throws Exception {
+  public void should_match() {
     HasStatus condition = new HasStatus("OPEN", "REOPENED", "CONFIRMED");
 
     assertThat(condition.matches(issue.setStatus("OPEN"))).isTrue();
index f626e00ed869f04e89b93592d36ab29e476deff5..3e826ba0ebfe73863652342a393dd0ae001d1e51 100644 (file)
@@ -30,7 +30,7 @@ public class IsUnResolvedTest {
   DefaultIssue issue = new DefaultIssue();
 
   @Test
-  public void should_match() throws Exception {
+  public void should_match() {
     IsUnResolved condition = new IsUnResolved();
 
     assertThat(condition.matches(issue)).isTrue();
index 52897dc767275a3045469b4a60a48053791c2192..4f35e961efdd9fc0bd5b6ae1edffec576b5605e2 100644 (file)
@@ -33,7 +33,7 @@ public class NotConditionTest {
   Condition target = Mockito.mock(Condition.class);
 
   @Test
-  public void should_match_opposite() throws Exception {
+  public void should_match_opposite() {
     NotCondition condition = new NotCondition(target);
 
     when(target.matches(any(Issue.class))).thenReturn(true);
index 998d89e1451ce7b9b9ceb5e1f05d7ccb6ac8bd73..6ab20d2dc64198c72152146351853d019852f9bb 100644 (file)
@@ -99,7 +99,7 @@ public class DefaultIssueTest {
   }
 
   @Test
-  public void set_empty_dates() throws Exception {
+  public void set_empty_dates() {
     issue
       .setCreationDate(null)
       .setUpdateDate(null)
@@ -124,7 +124,7 @@ public class DefaultIssueTest {
   }
 
   @Test
-  public void setAttributes_should_not_clear_existing_values() throws Exception {
+  public void setAttributes_should_not_clear_existing_values() {
     issue.setAttributes(ImmutableMap.of("1", "one"));
     assertThat(issue.attribute("1")).isEqualTo("one");
 
@@ -193,7 +193,7 @@ public class DefaultIssueTest {
   }
 
   @Test
-  public void comments_should_not_be_modifiable() throws Exception {
+  public void comments_should_not_be_modifiable() {
     DefaultIssue issue = new DefaultIssue().setKey("AAA");
 
     List<IssueComment> comments = issue.comments();
@@ -210,7 +210,7 @@ public class DefaultIssueTest {
   }
 
   @Test
-  public void all_changes_contain_current_change() throws Exception {
+  public void all_changes_contain_current_change() {
     IssueChangeContext issueChangeContext = mock(IssueChangeContext.class);
     DefaultIssue issue = new DefaultIssue().setKey("AAA").setFieldChange(issueChangeContext, "actionPlan", "1.0", "1.1");
 
index 1e00d66167c7687e611ccb90aa25ff6269301885..3de9680e8d0706abeac9110b7ddca68d9215cc95 100644 (file)
@@ -28,7 +28,7 @@ public class FieldDiffsTest {
   FieldDiffs diffs = new FieldDiffs();
 
   @Test
-  public void diffs_should_be_empty_by_default() throws Exception {
+  public void diffs_should_be_empty_by_default() {
     assertThat(diffs.diffs()).isEmpty();
   }
 
@@ -49,7 +49,7 @@ public class FieldDiffsTest {
   }
 
   @Test
-  public void diff_with_long_values() throws Exception {
+  public void diff_with_long_values() {
     diffs.setDiff("technicalDebt", 50l, "100");
 
     FieldDiffs.Diff diff = diffs.diffs().get("technicalDebt");
@@ -58,7 +58,7 @@ public class FieldDiffsTest {
   }
 
   @Test
-  public void diff_with_empty_long_values() throws Exception {
+  public void diff_with_empty_long_values() {
     diffs.setDiff("technicalDebt", null, "");
 
     FieldDiffs.Diff diff = diffs.diffs().get("technicalDebt");
@@ -83,7 +83,7 @@ public class FieldDiffsTest {
   }
 
   @Test
-  public void should_keep_old_value() throws Exception {
+  public void should_keep_old_value() {
     diffs.setDiff("severity", "BLOCKER", "INFO");
     diffs.setDiff("severity", null, "MAJOR");
     FieldDiffs.Diff diff = diffs.diffs().get("severity");
index 1935e5c19a7978db23ca48c70d0670e3829207c0..30a0ce20bad73a511940026f0a021a32d2a5f4bd 100644 (file)
@@ -114,7 +114,7 @@ public class MeasureUtilsTest {
   }
 
   @Test
-  public void shouldSumOnVariation() throws Exception {
+  public void shouldSumOnVariation() {
     Measure measure1 = new Measure(CoreMetrics.NEW_VIOLATIONS).setVariation1(1.0).setVariation2(1.0).setVariation3(3.0);
     Measure measure2 = new Measure(CoreMetrics.NEW_VIOLATIONS).setVariation1(1.0).setVariation2(2.0).setVariation3(3.0);
     List<Measure> children = Arrays.asList(measure1, measure2);
index 6129400fede3721ca003edd1c170e89e1b42c9ad..b4d64fd85514257993e6a1f2a58dd94b0c22a262 100644 (file)
@@ -96,7 +96,7 @@ public class SumChildDistributionFormulaTest {
   }
 
   @Test
-  public void shouldNotPersistWhenScopeLowerThanMinimun() throws Exception {
+  public void shouldNotPersistWhenScopeLowerThanMinimun() {
     when(context.getResource()).thenReturn(File.create("org/Foo.java"));
 
     initContextWithChildren();
@@ -107,7 +107,7 @@ public class SumChildDistributionFormulaTest {
   }
 
   @Test
-  public void shouldPersistWhenScopeEqualsMinimun() throws Exception {
+  public void shouldPersistWhenScopeEqualsMinimun() {
     when(context.getResource()).thenReturn(File.create("org/Foo.java"));
 
     initContextWithChildren();
@@ -118,7 +118,7 @@ public class SumChildDistributionFormulaTest {
   }
 
   @Test
-  public void shouldPersistWhenScopeHigherThanMinimun() throws Exception {
+  public void shouldPersistWhenScopeHigherThanMinimun() {
     when(context.getResource()).thenReturn(Directory.create("org/foo"));
 
     initContextWithChildren();
index 44660bf61c794739d9c1362149681d433980f7b4..8cbe1f5d3b4cfb4b513ca5679b7e4075403d2ac0 100644 (file)
@@ -293,7 +293,7 @@ public class ComponentContainerTest {
    * are not defined.
    */
   @Test
-  public void should_close_components_without_lifecycle() throws Exception {
+  public void should_close_components_without_lifecycle() {
     ComponentContainer container = new ComponentContainer();
     CloseableComponent component = new CloseableComponent();
     container.add(component);
@@ -307,7 +307,7 @@ public class ComponentContainerTest {
    * Method close() must be executed after stop()
    */
   @Test
-  public void should_close_components_with_lifecycle() throws Exception {
+  public void should_close_components_with_lifecycle() {
     ComponentContainer container = new ComponentContainer();
     StartableCloseableComponent component = new StartableCloseableComponent();
     container.add(component);
index 2a882663993a55cad121d5553963d8388bbdbc62..067a14f964e1c962302d925253ad3248e0a98ad5 100644 (file)
@@ -31,17 +31,17 @@ public class ComponentKeysTest {
   ComponentKeys keys = new ComponentKeys();
 
   @Test
-  public void generate_key_of_class() throws Exception {
+  public void generate_key_of_class() {
     assertThat(keys.of(FakeComponent.class)).isEqualTo(FakeComponent.class);
   }
 
   @Test
-  public void generate_key_of_object() throws Exception {
+  public void generate_key_of_object() {
     assertThat(keys.of(new FakeComponent())).isEqualTo("org.sonar.api.platform.ComponentKeysTest.FakeComponent-fake");
   }
 
   @Test
-  public void should_log_warning_if_toString_is_not_overridden() throws Exception {
+  public void should_log_warning_if_toString_is_not_overridden() {
     Logger log = mock(Logger.class);
     keys.of(new Object(), log);
     verifyZeroInteractions(log);
@@ -52,7 +52,7 @@ public class ComponentKeysTest {
   }
 
   @Test
-  public void should_generate_unique_key_when_toString_is_not_overridden() throws Exception {
+  public void should_generate_unique_key_when_toString_is_not_overridden() {
     Object key = keys.of(new WrongToStringImpl());
     assertThat(key).isNotEqualTo(WrongToStringImpl.KEY);
 
index 85a43f7c1054d8057ffb33faa1e57cedaf89f86d..252a030d93fe23a4d8ec39da8da563124f111d92 100644 (file)
@@ -34,14 +34,14 @@ public class RuleKeyTest {
   }
 
   @Test
-  public void key_can_contain_colons() throws Exception {
+  public void key_can_contain_colons() {
     RuleKey key = RuleKey.of("squid", "Key:With:Some::Colons");
     assertThat(key.repository()).isEqualTo("squid");
     assertThat(key.rule()).isEqualTo("Key:With:Some::Colons");
   }
 
   @Test
-  public void repository_must_not_be_null() throws Exception {
+  public void repository_must_not_be_null() {
     try {
       RuleKey.of(null, "NullDeref");
       fail();
@@ -51,7 +51,7 @@ public class RuleKeyTest {
   }
 
   @Test
-  public void repository_must_not_be_empty() throws Exception {
+  public void repository_must_not_be_empty() {
     try {
       RuleKey.of("", "NullDeref");
       fail();
@@ -61,7 +61,7 @@ public class RuleKeyTest {
   }
 
   @Test
-  public void rule_must_not_be_null() throws Exception {
+  public void rule_must_not_be_null() {
     try {
       RuleKey.of("squid", null);
       fail();
@@ -71,7 +71,7 @@ public class RuleKeyTest {
   }
 
   @Test
-  public void rule_must_not_be_empty() throws Exception {
+  public void rule_must_not_be_empty() {
     try {
       RuleKey.of("squid", "");
       fail();
@@ -81,7 +81,7 @@ public class RuleKeyTest {
   }
 
   @Test
-  public void encode_and_decode_string() throws Exception {
+  public void encode_and_decode_string() {
     RuleKey key = RuleKey.of("squid", "NullDeref");
     String serialized = key.toString();
     assertThat(serialized).isEqualTo("squid:NullDeref");
@@ -92,14 +92,14 @@ public class RuleKeyTest {
   }
 
   @Test
-  public void parse_key_with_colons() throws Exception {
+  public void parse_key_with_colons() {
     RuleKey key = RuleKey.parse("squid:Key:With:Some::Colons");
     assertThat(key.repository()).isEqualTo("squid");
     assertThat(key.rule()).isEqualTo("Key:With:Some::Colons");
   }
 
   @Test
-  public void not_accept_bad_format() throws Exception {
+  public void not_accept_bad_format() {
     try {
       RuleKey.parse("foo");
       fail();
index 806253f44cb1e43f191aa99391be03c7b3d2954f..a66e5ce96d75cde6cc065bab542abd7a99afb5cf 100644 (file)
@@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 public class RuleStatusTest {
   @Test
-  public void default_is_ready() throws Exception {
+  public void default_is_ready() {
     assertThat(RuleStatus.defaultStatus()).isEqualTo(RuleStatus.READY);
   }
 }
index ab472eba52384e9a12887c81b7ab1c80e3a3bd45..cab92e394c66816d0bbba27bd125bfb90dc51e7b 100644 (file)
@@ -31,7 +31,7 @@ public class SeverityTest {
   }
 
   @Test
-  public void default_is_major() throws Exception {
+  public void default_is_major() {
     assertThat(Severity.defaultSeverity()).isEqualTo(Severity.MAJOR);
   }
 }
index dadf72f3486071cebed3f2cbe93d357691b3a6f9..c3bd9bca34827ccd5bc5d9f8c5ccc5864646c258 100644 (file)
@@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class DefaultDebtCharacteristicTest {
 
   @Test
-  public void setter_and_getter_on_characteristic() throws Exception {
+  public void setter_and_getter_on_characteristic() {
     DefaultDebtCharacteristic debtCharacteristic = new DefaultDebtCharacteristic()
       .setId(1)
       .setKey("PORTABILITY")
@@ -49,7 +49,7 @@ public class DefaultDebtCharacteristicTest {
   }
 
   @Test
-  public void setter_and_getter_on_sub_characteristic() throws Exception {
+  public void setter_and_getter_on_sub_characteristic() {
     DefaultDebtCharacteristic debtCharacteristic = new DefaultDebtCharacteristic()
       .setId(1)
       .setKey("COMPILER")
@@ -69,7 +69,7 @@ public class DefaultDebtCharacteristicTest {
   }
 
   @Test
-  public void to_string() throws Exception {
+  public void to_string() {
     assertThat(new DefaultDebtCharacteristic()
       .setId(1)
       .setKey("PORTABILITY")
index 33cd1fe777eb31eff7bacb68cf77fa4d958c5768..d7d4e0cba4c5f7a4146b26fadd8ab4b71c3e30bf 100644 (file)
@@ -111,7 +111,7 @@ public class RuleParamTypeTest {
   }
 
   @Test
-  public void support_deprecated_formats() throws Exception {
+  public void support_deprecated_formats() {
     assertThat(RuleParamType.parse("b")).isEqualTo(RuleParamType.BOOLEAN);
     assertThat(RuleParamType.parse("i")).isEqualTo(RuleParamType.INTEGER);
     assertThat(RuleParamType.parse("i{}")).isEqualTo(RuleParamType.INTEGER);
index ffe3aae54ad39f72fff89140411c5b9a0cae6a0b..58e0ac6c44c6b323461bf81f710ad80521a5bb01 100644 (file)
@@ -32,7 +32,7 @@ public class RulesDefinitionI18nLoaderTest {
   RulesDefinitionI18nLoader loader = new RulesDefinitionI18nLoader(i18n);
 
   @Test
-  public void complete_rule_name_and_description() throws Exception {
+  public void complete_rule_name_and_description() {
     when(i18n.getName("squid", "S0001")).thenReturn("SOne");
     when(i18n.getDescription("squid", "S0001")).thenReturn("S One");
 
@@ -50,7 +50,7 @@ public class RulesDefinitionI18nLoaderTest {
   }
 
   @Test
-  public void do_not_override_if_no_bundle() throws Exception {
+  public void do_not_override_if_no_bundle() {
     // i18n returns null values
 
     RulesDefinition.Context context = new RulesDefinition.Context();
@@ -66,7 +66,7 @@ public class RulesDefinitionI18nLoaderTest {
   }
 
   @Test
-  public void override_existing() throws Exception {
+  public void override_existing() {
     when(i18n.getName("squid", "S0001")).thenReturn("SOne");
     when(i18n.getDescription("squid", "S0001")).thenReturn("S One");
 
@@ -83,7 +83,7 @@ public class RulesDefinitionI18nLoaderTest {
   }
 
   @Test
-  public void complete_param_description() throws Exception {
+  public void complete_param_description() {
     when(i18n.getParamDescription("squid", "S0001", "max")).thenReturn("Maximum");
 
     RulesDefinition.Context context = new RulesDefinition.Context();
index 2257a725c26041019605b4decc1822aa0f3be95f..e3ee4f76be97b823d12235067a5f5959a4ce6b23 100644 (file)
@@ -34,7 +34,7 @@ public class RulesDefinitionTest {
   RulesDefinition.Context context = new RulesDefinition.Context();
 
   @Test
-  public void define_repositories() throws Exception {
+  public void define_repositories() {
     assertThat(context.repositories()).isEmpty();
 
     context.createRepository("findbugs", "java").setName("Findbugs").done();
@@ -221,7 +221,7 @@ public class RulesDefinitionTest {
   }
 
   @Test
-  public void cant_set_blank_repository_name() throws Exception {
+  public void cant_set_blank_repository_name() {
     context.createRepository("findbugs", "java").setName(null).done();
 
     assertThat(context.repository("findbugs").name()).isEqualTo("findbugs");
index 5f6152983726ca0596339986a9e03407bd8a0459..3c372bd19fdc28a713217c4f161eeb76926101b4 100644 (file)
@@ -45,7 +45,7 @@ public class RulesDefinitionXmlLoaderTest {
   }
 
   @Test
-  public void parse_xml() throws Exception {
+  public void parse_xml() {
     InputStream input = getClass().getResourceAsStream("/org/sonar/api/server/rule/RulesDefinitionXmlLoaderTest/rules.xml");
     RulesDefinition.Repository repository = load(input, Charsets.UTF_8.name());
     assertThat(repository.rules()).hasSize(2);
@@ -94,7 +94,7 @@ public class RulesDefinitionXmlLoaderTest {
   }
 
   @Test
-  public void fail_if_invalid_xml() throws UnsupportedEncodingException {
+  public void fail_if_invalid_xml() {
     thrown.expect(IllegalStateException.class);
     thrown.expectMessage("XML is not valid");
 
@@ -117,7 +117,7 @@ public class RulesDefinitionXmlLoaderTest {
   }
 
   @Test
-  public void support_deprecated_format() throws UnsupportedEncodingException {
+  public void support_deprecated_format() {
     // the deprecated format uses some attributes instead of nodes
     InputStream input = getClass().getResourceAsStream("/org/sonar/api/server/rule/RulesDefinitionXmlLoaderTest/deprecated.xml");
     RulesDefinition.Repository repository = load(input, Charsets.UTF_8.name());
index 965419a7491b556aa2b258be694776a9198f0040..e0ba0f40ef327f0c0bf4b4e95de1d1b20cc8fd2f 100644 (file)
@@ -112,14 +112,14 @@ public class RequestTest {
   SimpleRequest request = new SimpleRequest();
 
   @Before
-  public void before() throws Exception {
+  public void before() {
     WebService.Context context = new WebService.Context();
     new SimpleWebService().define(context);
     request.setAction(context.controller("my_controller").action("my_action"));
   }
 
   @Test
-  public void has_param() throws Exception {
+  public void has_param() {
     request.setParam("a_required_string", "foo");
 
     assertThat(request.hasParam("a_required_string")).isTrue();
@@ -127,7 +127,7 @@ public class RequestTest {
   }
 
   @Test
-  public void required_param_is_missing() throws Exception {
+  public void required_param_is_missing() {
     try {
       request.mandatoryParam("required_param");
       fail();
@@ -137,7 +137,7 @@ public class RequestTest {
   }
 
   @Test
-  public void required_param() throws Exception {
+  public void required_param() {
     request.setParam("a_required_string", "foo");
     request.setParam("a_required_number", "42");
     request.setParam("a_required_boolean", "true");
@@ -151,7 +151,7 @@ public class RequestTest {
   }
 
   @Test
-  public void required_param_as_strings() throws Exception {
+  public void required_param_as_strings() {
     try {
       request.mandatoryParamAsStrings("a_required_string");
     } catch (IllegalArgumentException e) {
@@ -163,17 +163,17 @@ public class RequestTest {
   }
 
   @Test
-  public void default_value_of_optional_param() throws Exception {
+  public void default_value_of_optional_param() {
     assertThat(request.param("has_default_string")).isEqualTo("the_default_string");
   }
 
   @Test
-  public void param_as_string() throws Exception {
+  public void param_as_string() {
     assertThat(request.setParam("a_string", "foo").param("a_string")).isEqualTo("foo");
   }
 
   @Test
-  public void null_param() throws Exception {
+  public void null_param() {
     assertThat(request.param("a_string")).isNull();
     assertThat(request.paramAsBoolean("a_boolean")).isNull();
     assertThat(request.paramAsInt("a_number")).isNull();
@@ -181,19 +181,19 @@ public class RequestTest {
   }
 
   @Test
-  public void param_as_int() throws Exception {
+  public void param_as_int() {
     assertThat(request.setParam("a_number", "123").paramAsInt("a_number")).isEqualTo(123);
   }
 
   @Test
-  public void param_as_long() throws Exception {
+  public void param_as_long() {
     assertThat(request.setParam("a_number", "123").paramAsLong("a_number")).isEqualTo(123L);
     assertThat(request.setParam("a_number", "123").paramAsLong("a_number", 42L)).isEqualTo(123L);
     assertThat(request.setParam("a_number", null).paramAsLong("a_number", 42L)).isEqualTo(123L);
   }
 
   @Test
-  public void param_as_boolean() throws Exception {
+  public void param_as_boolean() {
     assertThat(request.setParam("a_boolean", "true").paramAsBoolean("a_boolean")).isTrue();
     assertThat(request.setParam("a_boolean", "yes").paramAsBoolean("a_boolean")).isTrue();
     assertThat(request.setParam("a_boolean", "false").paramAsBoolean("a_boolean")).isFalse();
@@ -207,23 +207,23 @@ public class RequestTest {
   }
 
   @Test
-  public void param_as_enum() throws Exception {
+  public void param_as_enum() {
     assertThat(request.setParam("a_enum", "BETA").paramAsEnum("a_enum", RuleStatus.class)).isEqualTo(RuleStatus.BETA);
   }
 
   @Test
-  public void param_as_enums() throws Exception {
+  public void param_as_enums() {
     assertThat(request.setParam("a_enum", "BETA,READY").paramAsEnums("a_enum", RuleStatus.class)).containsOnly(
       RuleStatus.BETA, RuleStatus.READY);
   }
 
   @Test
-  public void param_as_date() throws Exception {
+  public void param_as_date() {
     assertThat(request.setParam("a_date", "2014-05-27").paramAsDate("a_date")).isEqualTo(DateUtils.parseDate("2014-05-27"));
   }
 
   @Test
-  public void param_as_datetime() throws Exception {
+  public void param_as_datetime() {
     assertThat(request.setParam("a_datetime", "2014-05-27T15:50:45+0100").paramAsDateTime("a_datetime")).isEqualTo(DateUtils.parseDateTime("2014-05-27T15:50:45+0100"));
     assertThat(request.setParam("a_datetime", "2014-05-27").paramAsDateTime("a_datetime")).isEqualTo(DateUtils.parseDate("2014-05-27"));
     try {
@@ -234,7 +234,7 @@ public class RequestTest {
   }
 
   @Test
-  public void param_as_strings() throws Exception {
+  public void param_as_strings() {
     assertThat(request.paramAsStrings("a_string")).isNull();
     assertThat(request.setParam("a_string", "").paramAsStrings("a_string")).isEmpty();
     assertThat(request.setParam("a_string", "bar").paramAsStrings("a_string")).containsExactly("bar");
@@ -243,12 +243,12 @@ public class RequestTest {
   }
 
   @Test
-  public void deprecated_key() throws Exception {
+  public void deprecated_key() {
     assertThat(request.setParam("deprecated_param", "bar").param("new_param")).isEqualTo("bar");
   }
 
   @Test
-  public void fail_if_param_is_not_defined() throws Exception {
+  public void fail_if_param_is_not_defined() {
     try {
       request.param("unknown");
     } catch (IllegalArgumentException e) {
@@ -257,7 +257,7 @@ public class RequestTest {
   }
 
   @Test
-  public void verify_possible_values() throws Exception {
+  public void verify_possible_values() {
     request.setParam("has_possible_values", "foo");
     assertThat(request.param("has_possible_values")).isEqualTo("foo");
 
index f05e6f6d30a6177d2ca613e2f468723b7efb0ac9..9d81b9469d5184d9ab599fba31dc541d5fa90d99 100644 (file)
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class SimpleGetRequestTest {
 
   @Test
-  public void method() throws Exception {
+  public void method() {
     SimpleGetRequest request = new SimpleGetRequest();
     assertThat(request.method()).isEqualTo("GET");
 
@@ -36,7 +36,7 @@ public class SimpleGetRequestTest {
   }
 
   @Test
-  public void has_param() throws Exception {
+  public void has_param() {
     SimpleGetRequest request = new SimpleGetRequest();
     assertThat(request.method()).isEqualTo("GET");
 
index 8ab6cec20109be44f9fe723fee1164ee69220864..a3bddd6d0a80f175e462114bc3faad42ea22c061 100644 (file)
@@ -54,7 +54,7 @@ public class DefaultCharacteristicTest {
   }
 
   @Test
-  public void set_name_as_key() throws Exception {
+  public void set_name_as_key() {
     DefaultCharacteristic characteristic = new DefaultCharacteristic()
       .setId(1)
       .setName("Compiler related portability", true);
@@ -64,7 +64,7 @@ public class DefaultCharacteristicTest {
   }
 
   @Test
-  public void add_requirement() throws Exception {
+  public void add_requirement() {
     DefaultRequirement requirement = new DefaultRequirement().setRuleKey(RuleKey.of("repo", "rule"));
 
     DefaultCharacteristic characteristic = new DefaultCharacteristic()
@@ -76,7 +76,7 @@ public class DefaultCharacteristicTest {
   }
 
   @Test
-  public void add_child() throws Exception {
+  public void add_child() {
     DefaultCharacteristic root = new DefaultCharacteristic()
       .setId(1)
       .setKey("REUSABILITY");
@@ -93,7 +93,7 @@ public class DefaultCharacteristicTest {
 
 
   @Test
-  public void is_root() throws Exception {
+  public void is_root() {
     DefaultCharacteristic characteristic = new DefaultCharacteristic()
       .setId(1)
       .setKey("NETWORK_USE")
index 98514fa2119fd810217bfa3b5fb417d8fa3c3202..9bb3addb0ea31aeb512b4767054f92130036f63e 100644 (file)
@@ -81,7 +81,7 @@ public class DefaultCharacteristicTest {
   }
 
   @Test
-  public void is_root() throws Exception {
+  public void is_root() {
     DefaultCharacteristic characteristic = new DefaultCharacteristic()
       .setId(1)
       .setKey("NETWORK_USE")
@@ -94,7 +94,7 @@ public class DefaultCharacteristicTest {
   }
 
   @Test
-  public void is_requirement() throws Exception {
+  public void is_requirement() {
     DefaultCharacteristic requirement = new DefaultCharacteristic()
       .setId(1)
       .setRuleKey(RuleKey.of("repo", "rule"))
index 5d9b7e6575d936c93565d1d2011e383771989a1e..fa36ab4986b74d875f72e760b9495288271c0c66 100644 (file)
@@ -55,7 +55,7 @@ public class UserQueryTest {
   }
 
   @Test
-  public void should_limit_number_of_logins() throws Exception {
+  public void should_limit_number_of_logins() {
     List<String> logins = new ArrayList<String>();
     for (int i = 0; i < 1010; i++) {
       logins.add(String.valueOf(i));
@@ -69,14 +69,14 @@ public class UserQueryTest {
   }
 
   @Test
-  public void searchText() throws Exception {
+  public void searchText() {
     UserQuery query = UserQuery.builder().searchText("sim").build();
     assertThat(query.searchText()).isEqualTo("sim");
     assertThat(query.searchTextSql).isEqualTo("%sim%");
   }
 
   @Test
-  public void searchText_escape_special_characters_in_like() throws Exception {
+  public void searchText_escape_special_characters_in_like() {
     UserQuery query = UserQuery.builder().searchText("%sim_").build();
     assertThat(query.searchText()).isEqualTo("%sim_");
     assertThat(query.searchTextSql).isEqualTo("%/%sim/_%");
index 71a398979406b3792434f62264def5a694847861..ca4052f33e3bae84d2ab569a122cd12efd4da87c 100644 (file)
@@ -100,21 +100,21 @@ public class DateUtilsTest {
   }
 
   @Test
-  public void format_date_time_null_safe() throws Exception {
+  public void format_date_time_null_safe() {
     Assertions.assertThat(DateUtils.formatDateTimeNullSafe(new Date())).startsWith("20");
     Assertions.assertThat(DateUtils.formatDateTimeNullSafe(new Date()).length()).isGreaterThan(20);
     Assertions.assertThat(DateUtils.formatDateTimeNullSafe(null)).isEmpty();
   }
 
   @Test
-  public void long_to_date() throws Exception {
+  public void long_to_date() {
     Date date = new Date();
     Assertions.assertThat(DateUtils.longToDate(date.getTime())).isEqualTo(date);
     Assertions.assertThat(DateUtils.longToDate(null)).isNull();
   }
 
   @Test
-  public void date_to_long() throws Exception {
+  public void date_to_long() {
     Date date = new Date();
     Assertions.assertThat(DateUtils.dateToLong(date)).isEqualTo(date.getTime());
     Assertions.assertThat(DateUtils.dateToLong(null)).isEqualTo(null);
index 99e91f848447f79cdd3005f14623d6a15596a6cb..d8348f61faede7306cede74e901bdd730cbb3bde 100644 (file)
@@ -34,13 +34,13 @@ public class DurationTest {
   static final Long ONE_DAY_IN_MINUTES = ONE_HOUR_IN_MINUTES * HOURS_IN_DAY;
 
   @Test
-  public void create_from_duration_in_minutes() throws Exception {
+  public void create_from_duration_in_minutes() {
     Duration duration = Duration.create(ONE_DAY_IN_MINUTES + ONE_HOUR_IN_MINUTES + ONE_MINUTE);
     assertThat(duration.toMinutes()).isEqualTo(ONE_DAY_IN_MINUTES + ONE_HOUR_IN_MINUTES + ONE_MINUTE);
   }
 
   @Test
-  public void encode() throws Exception {
+  public void encode() {
     assertThat(Duration.create(2 * ONE_DAY_IN_MINUTES + 5 * ONE_HOUR_IN_MINUTES + 46 * ONE_MINUTE).encode(HOURS_IN_DAY)).isEqualTo("2d5h46min");
     assertThat(Duration.create(ONE_DAY_IN_MINUTES).encode(HOURS_IN_DAY)).isEqualTo("1d");
     assertThat(Duration.create(ONE_HOUR_IN_MINUTES).encode(HOURS_IN_DAY)).isEqualTo("1h");
@@ -49,7 +49,7 @@ public class DurationTest {
   }
 
   @Test
-  public void decode() throws Exception {
+  public void decode() {
     assertThat(Duration.decode("    15 d  23  h     42min  ", HOURS_IN_DAY)).isEqualTo(Duration.create(15 * ONE_DAY_IN_MINUTES + 23 * ONE_HOUR_IN_MINUTES + 42 * ONE_MINUTE));
     assertThat(Duration.decode("15d23h42min", HOURS_IN_DAY)).isEqualTo(Duration.create(15 * ONE_DAY_IN_MINUTES + 23 * ONE_HOUR_IN_MINUTES + 42 * ONE_MINUTE));
     assertThat(Duration.decode("23h", HOURS_IN_DAY)).isEqualTo(Duration.create(23 * ONE_HOUR_IN_MINUTES));
@@ -60,7 +60,7 @@ public class DurationTest {
   }
 
   @Test
-  public void fail_to_decode_if_unit_with_invalid_number() throws Exception {
+  public void fail_to_decode_if_unit_with_invalid_number() {
     try {
       Duration.decode("Xd", HOURS_IN_DAY);
       fail();
@@ -70,7 +70,7 @@ public class DurationTest {
   }
 
   @Test
-  public void fail_to_decode_if_no_valid_duration() throws Exception {
+  public void fail_to_decode_if_no_valid_duration() {
     try {
       Duration.decode("foo", HOURS_IN_DAY);
       fail();
@@ -80,7 +80,7 @@ public class DurationTest {
   }
 
   @Test
-  public void fail_to_decode_if_only_number() throws Exception {
+  public void fail_to_decode_if_only_number() {
     try {
       Duration.decode("15", HOURS_IN_DAY);
       fail();
@@ -90,7 +90,7 @@ public class DurationTest {
   }
 
   @Test
-  public void fail_to_decode_if_valid_unit_with_invalid_duration() throws Exception {
+  public void fail_to_decode_if_valid_unit_with_invalid_duration() {
     try {
       Duration.decode("15min foo", HOURS_IN_DAY);
       fail();
@@ -100,7 +100,7 @@ public class DurationTest {
   }
 
   @Test
-  public void is_greater_than() throws Exception {
+  public void is_greater_than() {
     assertThat(Duration.decode("1h", HOURS_IN_DAY).isGreaterThan(Duration.decode("1min", HOURS_IN_DAY))).isTrue();
     assertThat(Duration.decode("1min", HOURS_IN_DAY).isGreaterThan(Duration.decode("1d", HOURS_IN_DAY))).isFalse();
     assertThat(Duration.decode("1d", HOURS_IN_DAY).isGreaterThan(Duration.decode("1d", HOURS_IN_DAY))).isFalse();
@@ -108,17 +108,17 @@ public class DurationTest {
   }
 
   @Test
-  public void add() throws Exception {
+  public void add() {
     assertThat(Duration.decode("1h", HOURS_IN_DAY).add(Duration.decode("1min", HOURS_IN_DAY))).isEqualTo(Duration.decode("1h1min", HOURS_IN_DAY));
   }
 
   @Test
-  public void subtract() throws Exception {
+  public void subtract() {
     assertThat(Duration.decode("1h", HOURS_IN_DAY).subtract(Duration.decode("1min", HOURS_IN_DAY))).isEqualTo(Duration.decode("59min", HOURS_IN_DAY));
   }
 
   @Test
-  public void multiply() throws Exception {
+  public void multiply() {
     assertThat(Duration.decode("1h", HOURS_IN_DAY).multiply(2)).isEqualTo(Duration.decode("2h", HOURS_IN_DAY));
   }
 
index b567da69803391dfdd8b5f1156566231bf050326..f9931a818d2fa790c793ede47c84ecb66d05a69d 100644 (file)
@@ -54,19 +54,19 @@ public class DurationsTest {
   Durations durations;
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     settings = new Settings();
     settings.setProperty(CoreProperties.HOURS_IN_DAY, HOURS_IN_DAY);
     durations = new Durations(settings, i18n);
   }
 
   @Test
-  public void create_from_minutes() throws Exception {
+  public void create_from_minutes() {
     assertThat(durations.create(10L).toMinutes()).isEqualTo(10L);
   }
 
   @Test
-  public void decode() throws Exception {
+  public void decode() {
     // 1 working day -> 8 hours
     assertThat(durations.decode("1d").toMinutes()).isEqualTo(8L * ONE_HOUR);
     // 8 hours
index 78eb2ed7eaaa407d15ad30b9bd92585d2ee1edfb..87ef606ba0fa3edd8f428673fce00ad16b021025 100644 (file)
@@ -168,7 +168,7 @@ public class KeyValueFormatTest {
   }
 
   @Test
-  public void helper_parse_methods() throws Exception {
+  public void helper_parse_methods() {
     assertThat(KeyValueFormat.parseIntDate("1=2014-01-15")).hasSize(1);
     assertThat(KeyValueFormat.parseIntDateTime("1=2014-01-15T15:50:45+0100")).hasSize(1);
     assertThat(KeyValueFormat.parseIntDouble("1=3.14")).hasSize(1);
@@ -180,7 +180,7 @@ public class KeyValueFormatTest {
   }
 
   @Test
-  public void helper_format_methods() throws Exception {
+  public void helper_format_methods() {
     assertThat(KeyValueFormat.formatIntDateTime(ImmutableMap.of(1, new Date()))).startsWith("1=");
     assertThat(KeyValueFormat.formatIntDate(ImmutableMap.of(1, new Date()))).startsWith("1=");
     assertThat(KeyValueFormat.formatIntDouble(ImmutableMap.of(1, 3.14))).startsWith("1=");
@@ -230,7 +230,7 @@ public class KeyValueFormatTest {
   }
 
   @Test
-  public void escape_strings() throws Exception {
+  public void escape_strings() {
     Map<String, String> input = Maps.newLinkedHashMap();
     input.put("foo", "a=b=c");
     input.put("bar", "a;b;c");
@@ -245,7 +245,7 @@ public class KeyValueFormatTest {
   }
 
   @Test
-  public void not_instantiable() throws Exception {
+  public void not_instantiable() {
     // only static methods. Bad pattern, should be improved.
     TestUtils.hasOnlyPrivateConstructors(KeyValueFormat.class);
   }
index 562c95e3014fdcbb18cc423f7d86a9e2f5939cb4..d47219a55dbe6d40e0f42cc819867124db203859 100644 (file)
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class MessageExceptionTest {
 
   @Test
-  public void should_create_exception() throws Exception {
+  public void should_create_exception() {
     String message = "the message";
     MessageException exception = MessageException.of(message);
     assertThat(exception.getMessage()).isEqualTo(message);
index 658bdf386477b49557449926c0c17d5eba7666b8..2a2619ee3e7e91c32759fb6e11b8b707197a7345 100644 (file)
@@ -54,7 +54,7 @@ public class PagingTest {
   }
 
   @Test
-  public void page_size_should_be_strictly_positive() throws Exception {
+  public void page_size_should_be_strictly_positive() {
     try {
       Paging.create(0, 5, 5);
       fail();
@@ -64,7 +64,7 @@ public class PagingTest {
   }
 
   @Test
-  public void page_index_should_be_strictly_positive() throws Exception {
+  public void page_index_should_be_strictly_positive() {
     try {
       Paging.create(5, 0, 5);
       fail();
@@ -74,7 +74,7 @@ public class PagingTest {
   }
 
   @Test
-  public void total_items_should_be_positive() throws Exception {
+  public void total_items_should_be_positive() {
     try {
       Paging.create(5, 5, -1);
       fail();
index 64ea02cbfe5181d2d16387bc698a5abde7a3e0ca..3b76299f032387cadd4215cc75ec1c23b20e05f5 100644 (file)
@@ -68,7 +68,7 @@ public class PathUtilsTest {
   }
 
   @Test
-  public void haveFunGetCoverage() throws Exception {
+  public void haveFunGetCoverage() {
     // does not fail
     new PathUtils();
   }
index e0177fb4890c24a555eadf63b0dea3bd048f6d1c..c9951833c9ae407a389e63880ed28142db1cdb7c 100644 (file)
@@ -91,7 +91,7 @@ public class System2Test {
   }
 
   @Test
-  public void close() throws Exception {
+  public void close() {
     class MyCloseable implements Closeable {
       boolean isClosed = false;
       @Override
@@ -106,7 +106,7 @@ public class System2Test {
   }
 
   @Test
-  public void close_throws_exception_on_error() throws Exception {
+  public void close_throws_exception_on_error() {
     Closeable closeable = new Closeable() {
       @Override
       public void close() throws IOException {
@@ -122,7 +122,7 @@ public class System2Test {
   }
 
   @Test
-  public void getDefaultTimezone() throws Exception {
+  public void getDefaultTimezone() {
     assertThat(System2.INSTANCE.getDefaultTimeZone().getID()).isEqualTo(TimeZone.getDefault().getID());
 
   }
index 8d5a09a44dd58328806272d4b6263fc34513e41c..4ed539385d96be4ffedbf87c26cd44ee3c7c3317 100644 (file)
@@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 public class TimeUtilsTest {
   @Test
-  public void formatDuration() throws Exception {
+  public void formatDuration() {
     assertThat(TimeUtils.formatDuration(0)).isEqualTo("0ms");
     assertThat(TimeUtils.formatDuration(100)).isEqualTo("100ms");
     assertThat(TimeUtils.formatDuration(1000)).isEqualTo("1s");
index e42e8735e8f1387e88df9252f6b29f341f78cdce..c7f21de758fb7ecfd9f970fa6295137c1f7ede42 100644 (file)
@@ -52,13 +52,13 @@ public class UriReaderTest {
   }
 
   @Test
-  public void file_readString() throws Exception {
+  public void file_readString() {
     UriReader uriReader = new UriReader(new UriReader.SchemeProcessor[0]);
     assertThat(uriReader.readString(testFile, Charsets.UTF_8)).isEqualTo("in foo");
   }
 
   @Test
-  public void file_readBytes() throws Exception {
+  public void file_readBytes() {
     UriReader uriReader = new UriReader(new UriReader.SchemeProcessor[0]);
     assertThat(new String(uriReader.readBytes(testFile))).isEqualTo("in foo");
   }
index b0649bf5b3f8d9c1df573bb400016d361fb879d7..6b9c9f632a66404f272284d7899af6166330984a 100644 (file)
@@ -27,14 +27,14 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class WorkUnitTest {
 
   @Test
-  public void create() throws Exception {
+  public void create() {
     WorkUnit workUnit = WorkUnit.create(2.0, "mn");
     assertThat(workUnit.getUnit()).isEqualTo("mn");
     assertThat(workUnit.getValue()).isEqualTo(2.0);
   }
 
   @Test
-  public void create_default() throws Exception {
+  public void create_default() {
     WorkUnit workUnit = WorkUnit.create();
     assertThat(workUnit.getUnit()).isEqualTo("d");
     assertThat(workUnit.getValue()).isEqualTo(0.0);
@@ -48,7 +48,7 @@ public class WorkUnitTest {
   }
 
   @Test
-  public void fail_with_bad_unit() throws Exception {
+  public void fail_with_bad_unit() {
     try {
       WorkUnit.create(2.0, "z");
     } catch (Exception e) {
@@ -57,7 +57,7 @@ public class WorkUnitTest {
   }
 
   @Test
-  public void fail_with_bad_value() throws Exception {
+  public void fail_with_bad_value() {
     try {
       WorkUnit.create(-2.0, "mn");
     } catch (Exception e) {
index 321624c22460336f10be1e5ebd8d3d6a00d0d2e2..a5b4aff24e7d57f51f338798830a3c2d2d6c2b54 100644 (file)
@@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class UuidsTest {
 
   @Test
-  public void create_unique() throws Exception {
+  public void create_unique() {
     Set<String> all = Sets.newHashSet();
     for (int i = 0; i < 50; i++) {
       String uuid = Uuids.create();
@@ -41,7 +41,7 @@ public class UuidsTest {
   }
 
   @Test
-  public void constructor_is_private() throws Exception {
+  public void constructor_is_private() {
     TestUtils.hasOnlyPrivateConstructors(Uuids.class);
   }
 }
index 43d4bff59776b666d3157f1532ddff7fc88a5bcf..bb4b07e1cbd296957ba84507d52eeda04080ca5a 100644 (file)
@@ -33,7 +33,7 @@ public class WorkDurationTest {
   static final Long ONE_DAY_IN_MINUTES = ONE_HOUR_IN_MINUTES * HOURS_IN_DAY;
 
   @Test
-  public void create_from_days_hours_minutes() throws Exception {
+  public void create_from_days_hours_minutes() {
     WorkDuration workDuration = WorkDuration.create(1, 1, 1, HOURS_IN_DAY);
     assertThat(workDuration.days()).isEqualTo(1);
     assertThat(workDuration.hours()).isEqualTo(1);
@@ -43,7 +43,7 @@ public class WorkDurationTest {
   }
 
   @Test
-  public void create_from_value_and_unit() throws Exception {
+  public void create_from_value_and_unit() {
     WorkDuration result = WorkDuration.createFromValueAndUnit(1, WorkDuration.UNIT.DAYS, HOURS_IN_DAY);
     assertThat(result.days()).isEqualTo(1);
     assertThat(result.hours()).isEqualTo(0);
@@ -57,7 +57,7 @@ public class WorkDurationTest {
   }
 
   @Test
-  public void create_from_minutes() throws Exception {
+  public void create_from_minutes() {
     WorkDuration workDuration = WorkDuration.createFromMinutes(ONE_MINUTE, HOURS_IN_DAY);
     assertThat(workDuration.days()).isEqualTo(0);
     assertThat(workDuration.hours()).isEqualTo(0);
@@ -75,7 +75,7 @@ public class WorkDurationTest {
   }
 
   @Test
-  public void create_from_working_long() throws Exception {
+  public void create_from_working_long() {
     // 1 minute
     WorkDuration workDuration = WorkDuration.createFromLong(1L, HOURS_IN_DAY);
     assertThat(workDuration.days()).isEqualTo(0);
@@ -96,14 +96,14 @@ public class WorkDurationTest {
   }
 
   @Test
-  public void convert_to_seconds() throws Exception {
+  public void convert_to_seconds() {
     assertThat(WorkDuration.createFromValueAndUnit(2, WorkDuration.UNIT.MINUTES, HOURS_IN_DAY).toMinutes()).isEqualTo(2L * ONE_MINUTE);
     assertThat(WorkDuration.createFromValueAndUnit(2, WorkDuration.UNIT.HOURS, HOURS_IN_DAY).toMinutes()).isEqualTo(2L * ONE_HOUR_IN_MINUTES);
     assertThat(WorkDuration.createFromValueAndUnit(2, WorkDuration.UNIT.DAYS, HOURS_IN_DAY).toMinutes()).isEqualTo(2L * ONE_DAY_IN_MINUTES);
   }
 
   @Test
-  public void convert_to_working_days() throws Exception {
+  public void convert_to_working_days() {
     assertThat(WorkDuration.createFromValueAndUnit(2, WorkDuration.UNIT.MINUTES, HOURS_IN_DAY).toWorkingDays()).isEqualTo(2d / 60d / 8d);
     assertThat(WorkDuration.createFromValueAndUnit(240, WorkDuration.UNIT.MINUTES, HOURS_IN_DAY).toWorkingDays()).isEqualTo(0.5);
     assertThat(WorkDuration.createFromValueAndUnit(4, WorkDuration.UNIT.HOURS, HOURS_IN_DAY).toWorkingDays()).isEqualTo(0.5);
@@ -113,7 +113,7 @@ public class WorkDurationTest {
   }
 
   @Test
-  public void convert_to_working_long() throws Exception {
+  public void convert_to_working_long() {
     assertThat(WorkDuration.createFromValueAndUnit(2, WorkDuration.UNIT.MINUTES, HOURS_IN_DAY).toLong()).isEqualTo(2l);
     assertThat(WorkDuration.createFromValueAndUnit(4, WorkDuration.UNIT.HOURS, HOURS_IN_DAY).toLong()).isEqualTo(400l);
     assertThat(WorkDuration.createFromValueAndUnit(10, WorkDuration.UNIT.HOURS, HOURS_IN_DAY).toLong()).isEqualTo(10200l);
@@ -122,7 +122,7 @@ public class WorkDurationTest {
   }
 
   @Test
-  public void add() throws Exception {
+  public void add() {
     // 4h + 5h = 1d 1h
     WorkDuration result = WorkDuration.createFromValueAndUnit(4, WorkDuration.UNIT.HOURS, HOURS_IN_DAY).add(WorkDuration.createFromValueAndUnit(5, WorkDuration.UNIT.HOURS, HOURS_IN_DAY));
     assertThat(result.days()).isEqualTo(1);
@@ -146,7 +146,7 @@ public class WorkDurationTest {
   }
 
   @Test
-  public void subtract() throws Exception {
+  public void subtract() {
     // 1d 1h - 5h = 4h
     WorkDuration result = WorkDuration.create(1, 1, 0, HOURS_IN_DAY).subtract(WorkDuration.createFromValueAndUnit(5, WorkDuration.UNIT.HOURS, HOURS_IN_DAY));
     assertThat(result.days()).isEqualTo(0);
@@ -169,7 +169,7 @@ public class WorkDurationTest {
   }
 
   @Test
-  public void multiply() throws Exception {
+  public void multiply() {
     // 5h * 2 = 1d 2h
     WorkDuration result = WorkDuration.createFromValueAndUnit(5, WorkDuration.UNIT.HOURS, HOURS_IN_DAY).multiply(2);
     assertThat(result.days()).isEqualTo(1);
index 4aa1bd0bd9bcf912a96c15b6417bd87f6b879b1e..5f34386d175252166396081bfceb7ad97ea239e1 100644 (file)
@@ -26,7 +26,7 @@ public class BaseLoggerTest {
   ConsoleLogger sut = new ConsoleLogger();
 
   @Test
-  public void log() throws Exception {
+  public void log() {
     sut.log(LoggerLevel.WARN, "message");
   }
 }
index 834860d7a83ac52c390db172828c8e818a6d6a5f..4ee98c3c688211563df37b045b477e028d94ad17 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ConsoleFormatterTest {
 
   @Test
-  public void format() throws Exception {
+  public void format() {
     assertThat(ConsoleFormatter.format("foo")).isEqualTo("foo");
     assertThat(ConsoleFormatter.format("arg: {}", "foo")).isEqualTo("arg: foo");
     assertThat(ConsoleFormatter.format("two args: {} and {}", "foo", 42)).isEqualTo("two args: foo and 42");
@@ -36,7 +36,7 @@ public class ConsoleFormatterTest {
   }
 
   @Test
-  public void only_static_methods() throws Exception {
+  public void only_static_methods() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(ConsoleFormatter.class)).isTrue();
   }
 }
index 56d5f242dab8f1982746260eaeec45509a17469c..b58de37d1f24531253e596d5f76e9c9829c84e36 100644 (file)
@@ -37,7 +37,7 @@ public class ConsoleLoggerTest {
   public LogTester tester = new LogTester();
 
   @Test
-  public void debug_enabled() throws Exception {
+  public void debug_enabled() {
     tester.setLevel(LoggerLevel.DEBUG);
     assertThat(sut.isDebugEnabled()).isTrue();
     assertThat(sut.isTraceEnabled()).isFalse();
@@ -49,7 +49,7 @@ public class ConsoleLoggerTest {
   }
 
   @Test
-  public void debug_disabled() throws Exception {
+  public void debug_disabled() {
     tester.setLevel(LoggerLevel.INFO);
     assertThat(sut.isDebugEnabled()).isFalse();
     assertThat(sut.isTraceEnabled()).isFalse();
@@ -61,7 +61,7 @@ public class ConsoleLoggerTest {
   }
 
   @Test
-  public void trace_enabled() throws Exception {
+  public void trace_enabled() {
     tester.setLevel(LoggerLevel.TRACE);
     assertThat(sut.isDebugEnabled()).isTrue();
     assertThat(sut.isTraceEnabled()).isTrue();
@@ -73,7 +73,7 @@ public class ConsoleLoggerTest {
   }
 
   @Test
-  public void trace_disabled() throws Exception {
+  public void trace_disabled() {
     tester.setLevel(LoggerLevel.DEBUG);
     assertThat(sut.isTraceEnabled()).isFalse();
     sut.trace("message");
@@ -84,7 +84,7 @@ public class ConsoleLoggerTest {
   }
 
   @Test
-  public void log() throws Exception {
+  public void log() {
     sut.info("message");
     sut.info("message {}", "foo");
     sut.info("message {} {}", "foo", "bar");
@@ -106,7 +106,7 @@ public class ConsoleLoggerTest {
   }
 
   @Test
-  public void level_change_not_implemented_yet() throws Exception {
+  public void level_change_not_implemented_yet() {
     assertThat(sut.setLevel(LoggerLevel.DEBUG)).isFalse();
   }
 }
index a77cd98a18a3fb42e81df0b8f3f67986af98783e..197225cf5159b94ab30c50a36c5386a7625b96c3 100644 (file)
@@ -28,13 +28,13 @@ public class ConsoleLoggersTest {
   ConsoleLoggers sut = new ConsoleLoggers();
 
   @Test
-  public void newInstance() throws Exception {
+  public void newInstance() {
     Logger logger = sut.newInstance("foo");
     assertThat(logger).isInstanceOf(ConsoleLogger.class);
   }
 
   @Test
-  public void level() throws Exception {
+  public void level() {
     // INFO by default
     assertThat(sut.getLevel()).isEqualTo(LoggerLevel.INFO);
 
index 3bf72652db7af55c41b5f6db90f7e3fd58e00f41..da6b46697e4a635ab9755279f070aceaee38b2b8 100644 (file)
@@ -48,7 +48,7 @@ public class DefaultProfilerTest {
   }
 
   @Test
-  public void stop_reuses_start_message() throws Exception {
+  public void stop_reuses_start_message() {
     tester.setLevel(LoggerLevel.TRACE);
 
     // trace
@@ -76,7 +76,7 @@ public class DefaultProfilerTest {
   }
 
   @Test
-  public void different_start_and_stop_messages() throws Exception {
+  public void different_start_and_stop_messages() {
     tester.setLevel(LoggerLevel.TRACE);
 
     // start TRACE and stop DEBUG
@@ -104,7 +104,7 @@ public class DefaultProfilerTest {
   }
 
   @Test
-  public void log_on_at_stop() throws Exception {
+  public void log_on_at_stop() {
     tester.setLevel(LoggerLevel.TRACE);
 
     // trace
@@ -129,7 +129,7 @@ public class DefaultProfilerTest {
   }
 
   @Test
-  public void add_context() throws Exception {
+  public void add_context() {
     Profiler profiler = Profiler.create(Loggers.get("DefaultProfilerTest"));
     profiler.addContext("a_string", "bar");
     profiler.addContext("null_value", null);
@@ -147,7 +147,7 @@ public class DefaultProfilerTest {
   }
 
   @Test
-  public void empty_message() throws Exception {
+  public void empty_message() {
     sut.addContext("foo", "bar");
     sut.startInfo("");
     assertThat(tester.logs()).containsOnly("foo=bar");
@@ -161,7 +161,7 @@ public class DefaultProfilerTest {
   }
 
   @Test
-  public void fail_if_stop_without_message() throws Exception {
+  public void fail_if_stop_without_message() {
     sut.start();
     try {
       sut.stopInfo();
@@ -172,7 +172,7 @@ public class DefaultProfilerTest {
   }
 
   @Test
-  public void fail_if_stop_without_start() throws Exception {
+  public void fail_if_stop_without_start() {
     try {
       sut.stopDebug("foo");
       fail();
index d05a43953532c8f8e2160f044caac926f53b502c..7de0f049668a80534f19311bd65fe4ca1555cd42 100644 (file)
@@ -27,18 +27,18 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class LogInterceptorsTest {
 
   @Test
-  public void default_is_null_interceptor() throws Exception {
+  public void default_is_null_interceptor() {
     // production-ready
     assertThat(LogInterceptors.get()).isInstanceOf(NullInterceptor.class);
   }
 
   @Test(expected = IllegalArgumentException.class)
-  public void instance_cant_be_null() throws Exception {
+  public void instance_cant_be_null() {
     LogInterceptors.set(null);
   }
 
   @Test
-  public void private_constructor() throws Exception {
+  public void private_constructor() {
     assertThat(TestUtils.hasOnlyPrivateConstructors(LogInterceptors.class));
   }
 }
index f17cb9f799ffa503a70b88e707d545b22484d9ad..500b32b47d951af9508c8c6b5fc58a779a81ae59 100644 (file)
@@ -35,7 +35,7 @@ public class LogbackLoggerTest {
   public LogTester tester = new LogTester();
 
   @Test
-  public void log() throws Exception {
+  public void log() {
     // no assertions. Simply verify that calls do not fail.
     sut.trace("message");
     sut.trace("message {}", "foo");
@@ -65,7 +65,7 @@ public class LogbackLoggerTest {
   }
 
   @Test
-  public void change_level() throws Exception {
+  public void change_level() {
     assertThat(sut.setLevel(LoggerLevel.INFO)).isTrue();
     assertThat(sut.logbackLogger().getLevel()).isEqualTo(Level.INFO);
     assertThat(sut.isDebugEnabled()).isFalse();
@@ -83,7 +83,7 @@ public class LogbackLoggerTest {
   }
 
   @Test
-  public void info_level_can_not_be_disabled() throws Exception {
+  public void info_level_can_not_be_disabled() {
     try {
       sut.setLevel(LoggerLevel.ERROR);
       fail();
index b26094ce16a76ff74975311ebae508359bed34aa..0dd533207c1ae1e377594650479f00009648cf0e 100644 (file)
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class LoggersTest {
 
   @Test
-  public void factory() throws Exception {
+  public void factory() {
     // logback is used by sonar-plugin-api
     assertThat(Loggers.getFactory()).isInstanceOf(LogbackLoggers.class);
 
index f410fcd80aec7c5b694a586141a1f18a4e231c57..5b301769b955d981c85b55b94deb9a628df6c15d 100644 (file)
@@ -26,7 +26,7 @@ import static org.mockito.Mockito.mock;
 public class NullInterceptorTest {
 
   @Test
-  public void do_not_throws_exception() throws Exception {
+  public void do_not_throws_exception() {
     // verify that... it does nothing
     NullInterceptor.NULL_INSTANCE.log(LoggerLevel.INFO, "foo");
     NullInterceptor.NULL_INSTANCE.log(LoggerLevel.INFO, "foo {}", 42);
index a094ebb368eb90eb5c29ca5c400a295dc2a14960..bc9af01a006c7d31f6f29d3c4a34a560bdce6479 100644 (file)
@@ -28,7 +28,7 @@ public class NullProfilerTest {
   NullProfiler sut = NullProfiler.NULL_INSTANCE;
 
   @Test
-  public void do_not_fail() throws Exception {
+  public void do_not_fail() {
     assertThat(sut.start()).isSameAs(sut);
     assertThat(sut.startTrace("")).isSameAs(sut);
     assertThat(sut.startDebug("")).isSameAs(sut);
index 6a9e0b9c36d40f258809650f3660e456981a9122..6d45f7b818e299be0d4190937298a4b32c24ecbd 100644 (file)
@@ -29,13 +29,13 @@ public class ProfilerTest {
   public LogTester tester = new LogTester();
 
   @Test
-  public void create() throws Exception {
+  public void create() {
     Profiler profiler = Profiler.create(Loggers.get("foo"));
     assertThat(profiler).isInstanceOf(DefaultProfiler.class);
   }
 
   @Test
-  public void create_null_profiler_if_trace_level_is_disabled() throws Exception {
+  public void create_null_profiler_if_trace_level_is_disabled() {
     tester.setLevel(LoggerLevel.TRACE);
     Profiler profiler = Profiler.createIfTrace(Loggers.get("foo"));
     assertThat(profiler).isInstanceOf(DefaultProfiler.class);
@@ -46,7 +46,7 @@ public class ProfilerTest {
   }
 
   @Test
-  public void create_null_profiler_if_debug_level_is_disabled() throws Exception {
+  public void create_null_profiler_if_debug_level_is_disabled() {
     tester.setLevel(LoggerLevel.TRACE);
     Profiler profiler = Profiler.createIfDebug(Loggers.get("foo"));
     assertThat(profiler).isInstanceOf(DefaultProfiler.class);
index e0b945ddbe66a28321a18a79d54b3b55509fdd68..c4d4c6d94367aa0141ce9da0ca38d292bec88057 100644 (file)
@@ -52,26 +52,26 @@ public class JsonWriterTest {
   }
 
   @Test
-  public void empty_object() throws Exception {
+  public void empty_object() {
     writer.beginObject().endObject().close();
     expect("{}");
   }
 
   @Test
-  public void empty_array() throws Exception {
+  public void empty_array() {
     writer.beginArray().endArray().close();
     expect("[]");
   }
 
   @Test
-  public void stop_while_streaming() throws Exception {
+  public void stop_while_streaming() {
     writer.beginObject().name("foo").value("bar");
     // endObject() and close() are missing
     expect("{\"foo\":\"bar\"");
   }
 
   @Test
-  public void objects_and_arrays() throws Exception {
+  public void objects_and_arrays() {
     writer.beginObject().name("issues")
       .beginArray()
       .beginObject().prop("key", "ABC").endObject()
@@ -82,13 +82,13 @@ public class JsonWriterTest {
   }
 
   @Test
-  public void array_values() throws Exception {
+  public void array_values() {
     writer.beginArray().values(Arrays.asList("foo", "bar", "baz")).endArray().close();
     expect("[\"foo\",\"bar\",\"baz\"]");
   }
 
   @Test
-  public void type_of_values() throws Exception {
+  public void type_of_values() {
     Date date = DateUtils.parseDateTime("2010-05-18T15:50:45+0100");
     writer.beginObject()
       .prop("aBoolean", true)
@@ -103,7 +103,7 @@ public class JsonWriterTest {
   }
 
   @Test
-  public void ignore_null_values_by_default() throws Exception {
+  public void ignore_null_values_by_default() {
     writer.beginObject()
       .prop("nullNumber", (Number) null)
       .prop("nullString", (String) null)
@@ -116,7 +116,7 @@ public class JsonWriterTest {
   }
 
   @Test
-  public void serialize_null_values() throws Exception {
+  public void serialize_null_values() {
     writer.setSerializeNulls(true);
     writer.beginObject()
       .prop("nullNumber", (Number) null)
@@ -130,7 +130,7 @@ public class JsonWriterTest {
   }
 
   @Test
-  public void serialize_empty_strings_by_default() throws Exception {
+  public void serialize_empty_strings_by_default() {
     writer.beginObject()
       .prop("emptyString", EMPTY_STRING)
       .name("emptyStringAsObject").valueObject(EMPTY_STRING)
@@ -142,7 +142,7 @@ public class JsonWriterTest {
   }
 
   @Test
-  public void ignore_empty_strings_when_requested() throws Exception {
+  public void ignore_empty_strings_when_requested() {
     writer.setSerializeEmptys(false)
       .beginObject()
       .prop("emptyString", EMPTY_STRING)
@@ -152,7 +152,7 @@ public class JsonWriterTest {
   }
 
   @Test
-  public void escape_values() throws Exception {
+  public void escape_values() {
     writer.beginObject()
       .prop("foo", "<hello \"world\">")
       .endObject().close();
@@ -160,7 +160,7 @@ public class JsonWriterTest {
   }
 
   @Test
-  public void valueObject() throws Exception {
+  public void valueObject() {
     writer.beginObject()
       .name("aString").valueObject("stringValue")
       .name("aBoolean").valueObject(true)
@@ -175,14 +175,14 @@ public class JsonWriterTest {
   }
 
   @Test
-  public void valueObject_recursive() throws Exception {
+  public void valueObject_recursive() {
     Map map = ImmutableMap.of("a", ImmutableMap.of("b", "c"));
     writer.valueObject(map).close();
     expect("{\"a\":{\"b\":\"c\"}}");
   }
 
   @Test
-  public void valueObject_unsupported_type() throws Exception {
+  public void valueObject_unsupported_type() {
     try {
       writer.beginObject().valueObject(new StringWriter()).endObject().close();
       fail();
@@ -192,13 +192,13 @@ public class JsonWriterTest {
   }
 
   @Test
-  public void fail_on_NaN_value() throws Exception {
+  public void fail_on_NaN_value() {
     thrown.expect(WriterException.class);
     writer.beginObject().prop("foo", Double.NaN).endObject().close();
   }
 
   @Test
-  public void fail_if_not_valid() throws Exception {
+  public void fail_if_not_valid() {
     thrown.expect(WriterException.class);
     writer.beginObject().endArray().close();
   }
index daa4bc5cccf9ee9b6d8438f13cf5dc82e0b83b5d..679eaf774233f4a2a0cbdb19a2a16772dd8d035f 100644 (file)
@@ -51,25 +51,25 @@ public class XmlWriterTest {
   }
 
   @Test
-  public void only_root() throws Exception {
+  public void only_root() {
     writer.begin("foo").end().close();
     expect("<foo/>");
   }
 
   @Test
-  public void escape_value() throws Exception {
+  public void escape_value() {
     writer.prop("foo", "1<2 & 2>=2").close();
     expect("<foo>1&lt;2 &amp; 2>=2</foo>");
   }
 
   @Test
-  public void only_root_with_value() throws Exception {
+  public void only_root_with_value() {
     writer.prop("foo", "bar").close();
     expect("<foo>bar</foo>");
   }
 
   @Test
-  public void ignore_null_values() throws Exception {
+  public void ignore_null_values() {
     writer.begin("root")
       .prop("nullNumber", (Number) null)
       .prop("nullString", (String) null)
@@ -78,7 +78,7 @@ public class XmlWriterTest {
   }
 
   @Test
-  public void fail_on_NaN_value() throws Exception {
+  public void fail_on_NaN_value() {
     thrown.expect(WriterException.class);
     thrown.expectMessage("Fail to write XML. Double value is not valid: NaN");
     writer.begin("root").prop("foo", Double.NaN).end().close();
index 59a05d6506fffa870183b7284ef5937797be8a3d..21fbee1c43987d79c04091ad9bec3193be1b6b81 100644 (file)
@@ -32,7 +32,7 @@ import static org.sonar.test.JsonAssert.assertJson;
 public class JsonAssertTest {
 
   @Test
-  public void isSimilarAs_strings() throws Exception {
+  public void isSimilarAs_strings() {
     assertJson("{}").isSimilarTo("{}");
 
     try {
@@ -46,7 +46,7 @@ public class JsonAssertTest {
   }
 
   @Test
-  public void isSimilarAs_urls() throws Exception {
+  public void isSimilarAs_urls() {
     URL url1 = getClass().getResource("JsonAssertTest/sample1.json");
     URL url2 = getClass().getResource("JsonAssertTest/sample2.json");
     assertJson(url1).isSimilarTo(url1);
@@ -60,7 +60,7 @@ public class JsonAssertTest {
   }
 
   @Test
-  public void actual_can_be_superset_of_expected() throws Exception {
+  public void actual_can_be_superset_of_expected() {
     assertJson("{\"foo\": \"bar\"}").isSimilarTo("{}");
     try {
       assertJson("{}").isSimilarTo("{\"foo\": \"bar\"}");
@@ -76,7 +76,7 @@ public class JsonAssertTest {
   }
 
   @Test
-  public void enable_strict_order_of_arrays() throws Exception {
+  public void enable_strict_order_of_arrays() {
     try {
       assertJson("[1,2]").setStrictArrayOrder(true).isSimilarTo("[2, 1]");
       fail();
@@ -86,7 +86,7 @@ public class JsonAssertTest {
   }
 
   @Test
-  public void enable_strict_timezone() throws Exception {
+  public void enable_strict_timezone() {
     try {
       assertJson("[\"2010-05-18T15:50:45+0100\"]").setStrictTimezone(true).isSimilarTo("[\"2010-05-18T16:50:45+0200\"]");
       fail();
index 6dc57199a7cb802ebeff2eba64b44cf6bf4c7683..d640a76367d5adcef11d6c137f2117a07fb50319 100644 (file)
@@ -31,13 +31,13 @@ public class JsonComparisonTest {
   }
 
   @Test
-  public void syntax_agnostic() throws Exception {
+  public void syntax_agnostic() {
     assertThat(areSimilar("{}", " {  } ")).isTrue();
     assertThat(areSimilar("{\"foo\":\"bar\"}", "{\"foo\":  \"bar\" \n }")).isTrue();
   }
 
   @Test
-  public void object() throws Exception {
+  public void object() {
     assertThat(areSimilar("{}", "{}")).isTrue();
 
     // exactly the same
@@ -54,7 +54,7 @@ public class JsonComparisonTest {
   }
 
   @Test
-  public void strict_order_of_array() throws Exception {
+  public void strict_order_of_array() {
     assertThat(isSimilar_strict_array_order("[]", "[]")).isTrue();
     assertThat(isSimilar_strict_array_order("[1, 2]", "[1, 2]")).isTrue();
 
@@ -66,7 +66,7 @@ public class JsonComparisonTest {
   }
 
   @Test
-  public void lenient_order_of_array() throws Exception {
+  public void lenient_order_of_array() {
     assertThat(areSimilar("[]", "[]")).isTrue();
     assertThat(areSimilar("[1, 2]", "[1, 2]")).isTrue();
     assertThat(areSimilar("[1, 2]", "[1]")).isFalse();
@@ -77,12 +77,12 @@ public class JsonComparisonTest {
   }
 
   @Test
-  public void lenient_order_of_arrays_by_default() throws Exception {
+  public void lenient_order_of_arrays_by_default() {
     assertThat(new JsonComparison().isStrictArrayOrder()).isFalse();
   }
 
   @Test
-  public void null_value() throws Exception {
+  public void null_value() {
     assertThat(areSimilar("[null]", "[null]")).isTrue();
     assertThat(areSimilar("[null]", "[]")).isFalse();
 
@@ -99,7 +99,7 @@ public class JsonComparisonTest {
   }
 
   @Test
-  public void maps_and_arrays() throws Exception {
+  public void maps_and_arrays() {
     assertThat(areSimilar("[]", "{}")).isFalse();
     assertThat(areSimilar("{}", "[]")).isFalse();
 
@@ -121,7 +121,7 @@ public class JsonComparisonTest {
   }
 
   @Test
-  public void lenient_timezone() throws Exception {
+  public void lenient_timezone() {
     // lenient mode by default
     assertThat(new JsonComparison().isStrictTimezone()).isFalse();
 
@@ -136,7 +136,7 @@ public class JsonComparisonTest {
   }
 
   @Test
-  public void strict_timezone() throws Exception {
+  public void strict_timezone() {
     assertThat(new JsonComparison().setStrictTimezone(true).isStrictTimezone()).isTrue();
 
     // same instant, same timezone
@@ -151,7 +151,7 @@ public class JsonComparisonTest {
   }
 
   @Test
-  public void compare_doubles() throws Exception {
+  public void compare_doubles() {
     assertThat(areSimilar("{\"foo\": true}", "{\"foo\": false}")).isFalse();
     assertThat(areSimilar("{\"foo\": true}", "{\"foo\": true}")).isTrue();
     assertThat(areSimilar("{\"foo\": true}", "{\"foo\": \"true\"}")).isFalse();
@@ -159,7 +159,7 @@ public class JsonComparisonTest {
   }
 
   @Test
-  public void compare_booleans() throws Exception {
+  public void compare_booleans() {
     assertThat(areSimilar("{\"foo\": 3.14}", "{\"foo\": 3.14000000}")).isTrue();
     assertThat(areSimilar("{\"foo\": 3.14}", "{\"foo\": 3.1400001}")).isTrue();
   }