diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2018-01-10 21:14:52 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2018-01-14 20:37:37 +0100 |
commit | d55f047c445daf698ccde5f0af9d0669804c818b (patch) | |
tree | 990d01ddad6fd40aff012e1f40bfc8ce77918670 /server/sonar-db-migration | |
parent | 4a5be9fbaba0b9729e909eec935852c56f6e71e2 (diff) | |
download | sonarqube-d55f047c445daf698ccde5f0af9d0669804c818b.tar.gz sonarqube-d55f047c445daf698ccde5f0af9d0669804c818b.zip |
Cleanup code based on Intellij inspections
Diffstat (limited to 'server/sonar-db-migration')
17 files changed, 66 insertions, 67 deletions
diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/charset/DatabaseCharsetCheckerTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/charset/DatabaseCharsetCheckerTest.java index 65badeebd24..912c21c622e 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/charset/DatabaseCharsetCheckerTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/charset/DatabaseCharsetCheckerTest.java @@ -74,32 +74,32 @@ public class DatabaseCharsetCheckerTest { } @Test - public void does_nothing_if_h2() throws Exception { + public void does_nothing_if_h2() { assertThat(underTest.getHandler(new H2())).isNull(); } @Test - public void getHandler_returns_MysqlCharsetHandler_if_mysql() throws Exception { + public void getHandler_returns_MysqlCharsetHandler_if_mysql() { assertThat(underTest.getHandler(new MySql())).isInstanceOf(MysqlCharsetHandler.class); } @Test - public void getHandler_returns_MssqlCharsetHandler_if_mssql() throws Exception { + public void getHandler_returns_MssqlCharsetHandler_if_mssql() { assertThat(underTest.getHandler(new MsSql())).isInstanceOf(MssqlCharsetHandler.class); } @Test - public void getHandler_returns_OracleCharsetHandler_if_oracle() throws Exception { + public void getHandler_returns_OracleCharsetHandler_if_oracle() { assertThat(underTest.getHandler(new Oracle())).isInstanceOf(OracleCharsetHandler.class); } @Test - public void getHandler_returns_PostgresCharsetHandler_if_postgres() throws Exception { + public void getHandler_returns_PostgresCharsetHandler_if_postgres() { assertThat(underTest.getHandler(new PostgreSql())).isInstanceOf(PostgresCharsetHandler.class); } @Test - public void getHandler_throws_IAE_if_unsupported_db() throws Exception { + public void getHandler_throws_IAE_if_unsupported_db() { Dialect unsupportedDialect = mock(Dialect.class); when(unsupportedDialect.getId()).thenReturn("foo"); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/BigIntegerColumnDefTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/BigIntegerColumnDefTest.java index 41162ca2825..ffd6fe9dbd3 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/BigIntegerColumnDefTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/BigIntegerColumnDefTest.java @@ -36,7 +36,7 @@ public class BigIntegerColumnDefTest { public ExpectedException thrown = ExpectedException.none(); @Test - public void build_string_column_def() throws Exception { + public void build_string_column_def() { BigIntegerColumnDef def = new BigIntegerColumnDef.Builder() .setColumnName("issues") .setIsNullable(true) @@ -47,7 +47,7 @@ public class BigIntegerColumnDefTest { } @Test - public void build_string_column_def_with_default_values() throws Exception { + public void build_string_column_def_with_default_values() { BigIntegerColumnDef def = new BigIntegerColumnDef.Builder() .setColumnName("issues") .build(); @@ -57,7 +57,7 @@ public class BigIntegerColumnDefTest { } @Test - public void generate_sql_type() throws Exception { + public void generate_sql_type() { BigIntegerColumnDef def = new BigIntegerColumnDef.Builder() .setColumnName("issues") .setIsNullable(true) @@ -71,7 +71,7 @@ public class BigIntegerColumnDefTest { } @Test - public void fail_with_NPE_if_name_is_null() throws Exception { + public void fail_with_NPE_if_name_is_null() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); @@ -80,7 +80,7 @@ public class BigIntegerColumnDefTest { } @Test - public void fail_with_NPE_if_no_name() throws Exception { + public void fail_with_NPE_if_no_name() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/BooleanColumnDefTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/BooleanColumnDefTest.java index e0149bf41c0..9521b7e5ffb 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/BooleanColumnDefTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/BooleanColumnDefTest.java @@ -37,7 +37,7 @@ public class BooleanColumnDefTest { public ExpectedException thrown = ExpectedException.none(); @Test - public void build_column_def() throws Exception { + public void build_column_def() { BooleanColumnDef def = new BooleanColumnDef.Builder() .setColumnName("enabled") .setIsNullable(false) @@ -50,7 +50,7 @@ public class BooleanColumnDefTest { } @Test - public void build_column_def_with_only_required_attributes() throws Exception { + public void build_column_def_with_only_required_attributes() { BooleanColumnDef def = new BooleanColumnDef.Builder() .setColumnName("enabled") .build(); @@ -61,7 +61,7 @@ public class BooleanColumnDefTest { } @Test - public void generate_sql_type() throws Exception { + public void generate_sql_type() { BooleanColumnDef def = new BooleanColumnDef.Builder() .setColumnName("enabled") .setIsNullable(true) @@ -75,7 +75,7 @@ public class BooleanColumnDefTest { } @Test - public void fail_with_NPE_if_name_is_null() throws Exception { + public void fail_with_NPE_if_name_is_null() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); @@ -83,7 +83,7 @@ public class BooleanColumnDefTest { } @Test - public void fail_with_NPE_if_no_name() throws Exception { + public void fail_with_NPE_if_no_name() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/ClobColumnDefTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/ClobColumnDefTest.java index e65f13ca2d8..dab891080ea 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/ClobColumnDefTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/ClobColumnDefTest.java @@ -40,14 +40,14 @@ public class ClobColumnDefTest { .build(); @Test - public void build_string_column_def() throws Exception { + public void build_string_column_def() { assertThat(underTest.getName()).isEqualTo("issues"); assertThat(underTest.isNullable()).isTrue(); assertThat(underTest.getDefaultValue()).isNull(); } @Test - public void build_string_column_def_with_only_required_attributes() throws Exception { + public void build_string_column_def_with_only_required_attributes() { ClobColumnDef def = new ClobColumnDef.Builder() .setColumnName("issues") .build(); @@ -58,32 +58,32 @@ public class ClobColumnDefTest { } @Test - public void generate_sql_type_on_mssql() throws Exception { + public void generate_sql_type_on_mssql() { assertThat(underTest.generateSqlType(new MsSql())).isEqualTo("NVARCHAR (MAX)"); } @Test - public void generate_sql_type_on_h2() throws Exception { + public void generate_sql_type_on_h2() { assertThat(underTest.generateSqlType(new H2())).isEqualTo("CLOB(2147483647)"); } @Test - public void generate_sql_type_on_mysql() throws Exception { + public void generate_sql_type_on_mysql() { assertThat(underTest.generateSqlType(new MySql())).isEqualTo("LONGTEXT"); } @Test - public void generate_sql_type_on_oracle() throws Exception { + public void generate_sql_type_on_oracle() { assertThat(underTest.generateSqlType(new Oracle())).isEqualTo("CLOB"); } @Test - public void generate_sql_type_on_postgre() throws Exception { + public void generate_sql_type_on_postgre() { assertThat(underTest.generateSqlType(new PostgreSql())).isEqualTo("TEXT"); } @Test - public void fail_with_NPE_if_name_is_null() throws Exception { + public void fail_with_NPE_if_name_is_null() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); @@ -92,7 +92,7 @@ public class ClobColumnDefTest { } @Test - public void fail_with_NPE_if_no_name() throws Exception { + public void fail_with_NPE_if_no_name() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/DecimalColumnDefTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/DecimalColumnDefTest.java index c9b24611511..effa7b9cfed 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/DecimalColumnDefTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/DecimalColumnDefTest.java @@ -39,7 +39,7 @@ public class DecimalColumnDefTest { public ExpectedException thrown = ExpectedException.none(); @Test - public void build_string_column_def() throws Exception { + public void build_string_column_def() { DecimalColumnDef def = new DecimalColumnDef.Builder() .setColumnName("issues") .setPrecision(30) @@ -55,7 +55,7 @@ public class DecimalColumnDefTest { } @Test - public void fail_with_NPE_if_name_is_null() throws Exception { + public void fail_with_NPE_if_name_is_null() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); @@ -64,7 +64,7 @@ public class DecimalColumnDefTest { } @Test - public void fail_with_NPE_if_no_name() throws Exception { + public void fail_with_NPE_if_no_name() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); @@ -73,7 +73,7 @@ public class DecimalColumnDefTest { } @Test - public void default_precision_is_38() throws Exception { + public void default_precision_is_38() { DecimalColumnDef def = new DecimalColumnDef.Builder() .setColumnName("issues") .setScale(20) @@ -84,7 +84,7 @@ public class DecimalColumnDefTest { } @Test - public void default_precision_is_20() throws Exception { + public void default_precision_is_20() { DecimalColumnDef def = new DecimalColumnDef.Builder() .setColumnName("issues") .setPrecision(30) @@ -95,7 +95,7 @@ public class DecimalColumnDefTest { } @Test - public void create_builder_with_only_required_attributes() throws Exception { + public void create_builder_with_only_required_attributes() { DecimalColumnDef def = new DecimalColumnDef.Builder() .setColumnName("issues") .build(); @@ -107,7 +107,7 @@ public class DecimalColumnDefTest { } @Test - public void generate_sql_type() throws Exception { + public void generate_sql_type() { DecimalColumnDef def = new DecimalColumnDef.Builder() .setColumnName("issues") .setPrecision(30) @@ -123,7 +123,7 @@ public class DecimalColumnDefTest { } @Test - public void fail_with_UOE_to_generate_sql_type_when_unknown_dialect() throws Exception { + public void fail_with_UOE_to_generate_sql_type_when_unknown_dialect() { thrown.expect(UnsupportedOperationException.class); thrown.expectMessage("Unknown dialect 'unknown'"); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/TimestampColumnDefTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/TimestampColumnDefTest.java index 0ce4910f7ba..15da755165b 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/TimestampColumnDefTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/TimestampColumnDefTest.java @@ -37,7 +37,7 @@ public class TimestampColumnDefTest { public ExpectedException thrown = ExpectedException.none(); @Test - public void build_column_def() throws Exception { + public void build_column_def() { TimestampColumnDef def = newTimestampColumnDefBuilder() .setColumnName("created_at") .setIsNullable(false) @@ -49,7 +49,7 @@ public class TimestampColumnDefTest { } @Test - public void build_column_def_with_only_required_attributes() throws Exception { + public void build_column_def_with_only_required_attributes() { TimestampColumnDef def = newTimestampColumnDefBuilder() .setColumnName("created_at") .build(); @@ -60,7 +60,7 @@ public class TimestampColumnDefTest { } @Test - public void generate_sql_type() throws Exception { + public void generate_sql_type() { TimestampColumnDef def = newTimestampColumnDefBuilder() .setColumnName("created_at") .build(); @@ -73,7 +73,7 @@ public class TimestampColumnDefTest { } @Test - public void fail_with_NPE_if_name_is_null() throws Exception { + public void fail_with_NPE_if_name_is_null() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); @@ -81,7 +81,7 @@ public class TimestampColumnDefTest { } @Test - public void fail_with_NPE_if_no_name() throws Exception { + public void fail_with_NPE_if_no_name() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/TinyIntColumnDefTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/TinyIntColumnDefTest.java index 5393ecfc86b..073f614896e 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/TinyIntColumnDefTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/TinyIntColumnDefTest.java @@ -39,7 +39,7 @@ public class TinyIntColumnDefTest { public ExpectedException thrown = ExpectedException.none(); @Test - public void build_string_column_def() throws Exception { + public void build_string_column_def() { TinyIntColumnDef def = new TinyIntColumnDef.Builder() .setColumnName("foo") .setIsNullable(true) @@ -51,7 +51,7 @@ public class TinyIntColumnDefTest { } @Test - public void generate_sql_type() throws Exception { + public void generate_sql_type() { TinyIntColumnDef def = new TinyIntColumnDef.Builder() .setColumnName("foo") .setIsNullable(true) @@ -65,7 +65,7 @@ public class TinyIntColumnDefTest { } @Test - public void fail_with_UOE_to_generate_sql_type_when_unknown_dialect() throws Exception { + public void fail_with_UOE_to_generate_sql_type_when_unknown_dialect() { thrown.expect(UnsupportedOperationException.class); thrown.expectMessage("Unknown dialect 'unknown'"); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/ValidationsTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/ValidationsTest.java index 0f7d1e753d9..6baf90a516f 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/ValidationsTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/ValidationsTest.java @@ -33,13 +33,13 @@ public class ValidationsTest { public ExpectedException thrown = ExpectedException.none(); @Test - public void accept_valid_table_name() throws Exception { + public void accept_valid_table_name() { validateColumnName("date_in_ms"); validateColumnName("date_in_ms_1"); } @Test - public void fail_with_NPE_if_name_is_null() throws Exception { + public void fail_with_NPE_if_name_is_null() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/VarcharColumnDefTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/VarcharColumnDefTest.java index f1ea7878508..ecdc79d57d1 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/VarcharColumnDefTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/def/VarcharColumnDefTest.java @@ -36,7 +36,7 @@ public class VarcharColumnDefTest { public ExpectedException thrown = ExpectedException.none(); @Test - public void build_string_column_def() throws Exception { + public void build_string_column_def() { VarcharColumnDef def = new VarcharColumnDef.Builder() .setColumnName("issues") .setLimit(10) @@ -51,7 +51,7 @@ public class VarcharColumnDefTest { } @Test - public void build_string_column_def_with_only_required_attributes() throws Exception { + public void build_string_column_def_with_only_required_attributes() { VarcharColumnDef def = new VarcharColumnDef.Builder() .setColumnName("issues") .setLimit(10) @@ -64,7 +64,7 @@ public class VarcharColumnDefTest { } @Test - public void generate_sql_type() throws Exception { + public void generate_sql_type() { VarcharColumnDef def = new VarcharColumnDef.Builder() .setColumnName("issues") .setLimit(10) @@ -79,7 +79,7 @@ public class VarcharColumnDefTest { } @Test - public void generateSqlType_does_not_set_unit_on_oracle_if_legacy_mode() throws Exception { + public void generateSqlType_does_not_set_unit_on_oracle_if_legacy_mode() { VarcharColumnDef def = new VarcharColumnDef.Builder() .setColumnName("issues") .setLimit(10) @@ -91,7 +91,7 @@ public class VarcharColumnDefTest { } @Test - public void fail_with_NPE_if_name_is_null() throws Exception { + public void fail_with_NPE_if_name_is_null() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); @@ -100,7 +100,7 @@ public class VarcharColumnDefTest { } @Test - public void fail_with_NPE_if_no_name() throws Exception { + public void fail_with_NPE_if_no_name() { thrown.expect(NullPointerException.class); thrown.expectMessage("Column name cannot be null"); @@ -109,7 +109,7 @@ public class VarcharColumnDefTest { } @Test - public void fail_with_NPE_if_size_is_null() throws Exception { + public void fail_with_NPE_if_size_is_null() { thrown.expect(NullPointerException.class); thrown.expectMessage("Limit cannot be null"); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/history/NoTableMigrationHistoryImplTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/history/NoTableMigrationHistoryImplTest.java index 17a682f89b4..b1e8979212a 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/history/NoTableMigrationHistoryImplTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/history/NoTableMigrationHistoryImplTest.java @@ -34,7 +34,7 @@ public class NoTableMigrationHistoryImplTest { private MigrationHistoryImpl underTest = new MigrationHistoryImpl(dbTester.database()); @Test - public void start_fails_with_ISE_if_table_history_does_not_exist() throws SQLException { + public void start_fails_with_ISE_if_table_history_does_not_exist() { expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Migration history table is missing"); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/sql/DropTableBuilderTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/sql/DropTableBuilderTest.java index 51332818092..34351b5791f 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/sql/DropTableBuilderTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/sql/DropTableBuilderTest.java @@ -83,13 +83,13 @@ public class DropTableBuilderTest { } @Test - public void fail_when_dialect_is_null() throws Exception { + public void fail_when_dialect_is_null() { expectedException.expect(NullPointerException.class); new DropTableBuilder(null, "issues"); } @Test - public void fail_when_table_is_null() throws Exception { + public void fail_when_table_is_null() { expectedException.expect(NullPointerException.class); new DropTableBuilder(new PostgreSql(), null); } diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/step/DataChangeTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/step/DataChangeTest.java index 2bef4b89686..cad65f9c290 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/step/DataChangeTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/step/DataChangeTest.java @@ -117,7 +117,7 @@ public class DataChangeTest { public void execute(Context context) throws SQLException { context.prepareSelect("select id from persons where id>=?").setLong(1, 2L).get(new RowReader<Long>() { @Override - public Long read(Row row) throws SQLException { + public Long read(Row row) { throw new IllegalStateException("Unexpected error"); } }); @@ -138,7 +138,7 @@ public class DataChangeTest { public void execute(Context context) throws SQLException { context.prepareSelect("select id from persons where id>=?").setLong(1, 2L).list(new RowReader<Long>() { @Override - public Long read(Row row) throws SQLException { + public Long read(Row row) { throw new IllegalStateException("Unexpected error"); } }); @@ -319,7 +319,7 @@ public class DataChangeTest { final Upsert upsert = context.prepareUpsert("update persons set login=?, age=? where id=?"); context.prepareSelect("select id from persons").scroll(new Select.RowHandler() { @Override - public void handle(Row row) throws SQLException { + public void handle(Row row) { throw new IllegalStateException("Unexpected error"); } }); @@ -370,7 +370,7 @@ public class DataChangeTest { massUpdate.update("update persons set login=?, age=? where id=?"); massUpdate.execute(new MassUpdate.Handler() { @Override - public boolean handle(Row row, SqlStatement update) throws SQLException { + public boolean handle(Row row, SqlStatement update) { throw new IllegalStateException("Unexpected error"); } }); @@ -390,7 +390,7 @@ public class DataChangeTest { massUpdate.update("update persons set login=?, age=? where id=?"); massUpdate.execute(new MassUpdate.Handler() { @Override - public boolean handle(Row row, SqlStatement update) throws SQLException { + public boolean handle(Row row, SqlStatement update) { return false; } }); @@ -412,7 +412,7 @@ public class DataChangeTest { // update is not set massUpdate.execute(new MassUpdate.Handler() { @Override - public boolean handle(Row row, SqlStatement update) throws SQLException { + public boolean handle(Row row, SqlStatement update) { return false; } }); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v60/Migration1223Test.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v60/Migration1223Test.java index b9b8645a436..546b9293b1a 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v60/Migration1223Test.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v60/Migration1223Test.java @@ -45,13 +45,13 @@ public class Migration1223Test { private FixProjectUuidOfDeveloperProjects projectUuidOfDeveloperProjects = new FixProjectUuidOfDeveloperProjects(database) { @Override - public void execute(Context context) throws SQLException { + public void execute(Context context) { calls.add(Call.CALL_1); } }; private CleanUsurperRootComponents cleanUsurperRootComponents = new CleanUsurperRootComponents(database) { @Override - public void execute(Context context) throws SQLException { + public void execute(Context context) { calls.add(Call.CALL_2); } }; diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v61/Migration1304Test.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v61/Migration1304Test.java index a9310b40648..fa0d52bfe56 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v61/Migration1304Test.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v61/Migration1304Test.java @@ -46,13 +46,13 @@ public class Migration1304Test { private ShrinkModuleUuidPathOfProjects shrinkModuleUuidPathOfProjects = new ShrinkModuleUuidPathOfProjects(database) { @Override - public void execute(Context context) throws SQLException { + public void execute(Context context) { calls.add(Call.CALL_1); } }; private AddBUuidPathToProjects addBUuidPathToProjects = new AddBUuidPathToProjects(database) { @Override - public void execute(Context context) throws SQLException { + public void execute(Context context) { calls.add(Call.CALL_2); } }; diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/TestDefaultOrganizationUuidProvider.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/TestDefaultOrganizationUuidProvider.java index cf0d2d0362d..816d20a7d6d 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/TestDefaultOrganizationUuidProvider.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/TestDefaultOrganizationUuidProvider.java @@ -35,12 +35,12 @@ public class TestDefaultOrganizationUuidProvider implements DefaultOrganizationU } @Override - public String get(DataChange.Context context) throws SQLException { + public String get(DataChange.Context context) { return organizationUuid; } @Override - public String getAndCheck(DataChange.Context context) throws SQLException { + public String getAndCheck(DataChange.Context context) { return organizationUuid; } } diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/PopulateRulesMetadataTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/PopulateRulesMetadataTest.java index 58777a8c2d0..7b1364ee189 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/PopulateRulesMetadataTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/PopulateRulesMetadataTest.java @@ -232,7 +232,6 @@ public class PopulateRulesMetadataTest { this.noteData = seed + "_noteData"; this.noteUserLogin = seed + "_noteUserLogin"; this.noteDates = new Dates(seed.hashCode()); - ; return this; } diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v70/RenameOldSonarQubeWayQualityGateTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v70/RenameOldSonarQubeWayQualityGateTest.java index a2443cd6eb2..67f3e000a87 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v70/RenameOldSonarQubeWayQualityGateTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v70/RenameOldSonarQubeWayQualityGateTest.java @@ -84,7 +84,7 @@ public class RenameOldSonarQubeWayQualityGateTest { } @Test - public void should_log_a_meaningful_info_if_outdated_copy_exists() throws SQLException { + public void should_log_a_meaningful_info_if_outdated_copy_exists() { insertQualityGate(SONARQUBE_WAY_QUALITY_GATE, false); insertQualityGate(SONAR_WAY_OUTDATED_QUALITY_GATE, false); |