Skip to content

Commit 91bb4d2

Browse files
committed
Apply spring-javaformat
1 parent ced1cbf commit 91bb4d2

10 files changed

+91
-67
lines changed

spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/DB2MigrationScriptIntegrationTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ class DB2MigrationScriptIntegrationTests {
4141
@Test
4242
void migrationScriptShouldBeValid() {
4343
DB2SimpleDataSource datasource = createDataSource();
44-
44+
4545
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
4646
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/schema-db2-v4.sql"));
47-
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-db2.sql"));
47+
databasePopulator
48+
.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-db2.sql"));
4849

4950
Assertions.assertDoesNotThrow(() -> databasePopulator.execute(datasource));
5051
}
@@ -58,4 +59,5 @@ private DB2SimpleDataSource createDataSource() {
5859
datasource.setPassword(db2.getPassword());
5960
return datasource;
6061
}
62+
6163
}

spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/DerbyMigrationScriptIntegrationTests.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,22 @@
3131
*/
3232
class DerbyMigrationScriptIntegrationTests {
3333

34-
// Note: This test currently FAILS due to Derby-specific syntax issues in migration-derby.sql:
35-
// Derby does not support "MODIFY COLUMN" syntax
36-
@Test
37-
@Disabled
38-
void migrationScriptShouldBeValid() {
39-
EmbeddedDatabase datasource = new EmbeddedDatabaseBuilder()
40-
.setType(EmbeddedDatabaseType.DERBY)
41-
.addScript("/org/springframework/batch/core/schema-derby-v4.sql")
42-
.build();
34+
// Note: This test currently FAILS due to Derby-specific syntax issues in
35+
// migration-derby.sql:
36+
// Derby does not support "MODIFY COLUMN" syntax
37+
@Test
38+
@Disabled
39+
void migrationScriptShouldBeValid() {
40+
EmbeddedDatabase datasource = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY)
41+
.addScript("/org/springframework/batch/core/schema-derby-v4.sql")
42+
.build();
4343

44-
ResourceDatabasePopulator schemaPopulator = new ResourceDatabasePopulator();
45-
schemaPopulator.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-derby.sql"));
44+
ResourceDatabasePopulator schemaPopulator = new ResourceDatabasePopulator();
45+
schemaPopulator
46+
.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-derby.sql"));
4647

47-
Assertions.assertDoesNotThrow(() -> schemaPopulator.execute(datasource));
48+
Assertions.assertDoesNotThrow(() -> schemaPopulator.execute(datasource));
49+
50+
}
4851

49-
}
5052
}

spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/H2MigrationScriptIntegrationTests.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ class H2MigrationScriptIntegrationTests {
3232

3333
@Test
3434
void migrationScriptShouldBeValid() {
35-
EmbeddedDatabase datasource = new EmbeddedDatabaseBuilder()
36-
.setType(EmbeddedDatabaseType.H2)
37-
.addScript("/org/springframework/batch/core/schema-h2-v4.sql")
38-
.build();
35+
EmbeddedDatabase datasource = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2)
36+
.addScript("/org/springframework/batch/core/schema-h2-v4.sql")
37+
.build();
3938

4039
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
41-
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-h2.sql"));
40+
databasePopulator
41+
.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-h2.sql"));
4242

4343
Assertions.assertDoesNotThrow(() -> databasePopulator.execute(datasource));
4444
}
45+
4546
}

spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/HSQLDBMigrationScriptIntegrationTests.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,21 @@
3131
*/
3232
class HSQLDBMigrationScriptIntegrationTests {
3333

34-
// Note: This test currently FAILS due to HSQLDB-specific syntax issues in migration-hsqldb.sql:
35-
// - HSQLDB does not support "MODIFY COLUMN"
36-
@Test
37-
@Disabled
38-
void migrationScriptShouldBeValid() {
39-
EmbeddedDatabase datasource = new EmbeddedDatabaseBuilder()
40-
.setType(EmbeddedDatabaseType.HSQL)
41-
.addScript("/org/springframework/batch/core/schema-hsqldb-v4.sql")
42-
.build();
34+
// Note: This test currently FAILS due to HSQLDB-specific syntax issues in
35+
// migration-hsqldb.sql:
36+
// - HSQLDB does not support "MODIFY COLUMN"
37+
@Test
38+
@Disabled
39+
void migrationScriptShouldBeValid() {
40+
EmbeddedDatabase datasource = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.HSQL)
41+
.addScript("/org/springframework/batch/core/schema-hsqldb-v4.sql")
42+
.build();
4343

4444
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
45-
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-hsqldb.sql"));
45+
databasePopulator
46+
.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-hsqldb.sql"));
4647

4748
Assertions.assertDoesNotThrow(() -> databasePopulator.execute(datasource));
48-
}
49+
}
50+
4951
}

spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/MySQLMigrationScriptIntegrationTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
/**
2929
* Integration tests for Mysql migration script for v5.0
30-
*
30+
*
3131
* @author Jinwoo Bae
3232
*/
3333
@Testcontainers(disabledWithoutDocker = true)
@@ -41,7 +41,8 @@ void migrationScriptShouldBeValid() {
4141
MysqlDataSource datasource = createDataSource();
4242
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
4343
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/schema-mysql-v4.sql"));
44-
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-mysql.sql"));
44+
databasePopulator
45+
.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-mysql.sql"));
4546
Assertions.assertDoesNotThrow(() -> databasePopulator.execute(datasource));
4647
}
4748

@@ -52,4 +53,5 @@ private MysqlDataSource createDataSource() {
5253
datasource.setPassword(mysql.getPassword());
5354
return datasource;
5455
}
56+
5557
}

spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/OracleMigrationScriptIntegrationTests.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
/**
2929
* Integration tests for Oracle migration script for v5.0
30-
*
30+
*
3131
* @author Jinwoo Bae
3232
*/
3333
@Testcontainers(disabledWithoutDocker = true)
@@ -39,11 +39,12 @@ class OracleMigrationScriptIntegrationTests {
3939
@Test
4040
void migrationScriptShouldBeValid() throws Exception {
4141
OracleDataSource datasource = createDataSource();
42-
42+
4343
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
4444
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/schema-oracle-v4.sql"));
45-
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-oracle.sql"));
46-
45+
databasePopulator
46+
.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-oracle.sql"));
47+
4748
Assertions.assertDoesNotThrow(() -> databasePopulator.execute(datasource));
4849
}
4950

@@ -54,4 +55,5 @@ private OracleDataSource createDataSource() throws Exception {
5455
datasource.setPassword(oracle.getPassword());
5556
return datasource;
5657
}
58+
5759
}

spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/PostgreSQLMigrationScriptIntegrationTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
/**
2929
* Integration tests for PostgreSQL migration script for v5.0
30-
*
30+
*
3131
* @author Jinwoo Bae
3232
*/
3333
@Testcontainers(disabledWithoutDocker = true)
@@ -41,7 +41,8 @@ void migrationScriptShouldBeValid() {
4141
PGSimpleDataSource datasource = createDataSource();
4242
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
4343
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/schema-postgresql-v4.sql"));
44-
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-postgresql.sql"));
44+
databasePopulator
45+
.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-postgresql.sql"));
4546
Assertions.assertDoesNotThrow(() -> databasePopulator.execute(datasource));
4647
}
4748

@@ -52,4 +53,5 @@ private PGSimpleDataSource createDataSource() {
5253
datasource.setPassword(postgres.getPassword());
5354
return datasource;
5455
}
56+
5557
}

spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/SQLServerMigrationScriptIntegrationTests.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,18 @@
3434
class SQLServerMigrationScriptIntegrationTests {
3535

3636
@Container
37-
public static MSSQLServerContainer<?> sqlserver = new MSSQLServerContainer<>(DockerImageName.parse("mcr.microsoft.com/mssql/server:2019-latest"))
38-
.acceptLicense();
37+
public static MSSQLServerContainer<?> sqlserver = new MSSQLServerContainer<>(
38+
DockerImageName.parse("mcr.microsoft.com/mssql/server:2019-latest"))
39+
.acceptLicense();
3940

4041
@Test
4142
void migrationScriptShouldBeValid() {
4243
SQLServerDataSource datasource = createDataSource();
4344
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
4445
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/schema-sqlserver-v4.sql"));
45-
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-sqlserver.sql"));
46-
46+
databasePopulator
47+
.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-sqlserver.sql"));
48+
4749
Assertions.assertDoesNotThrow(() -> databasePopulator.execute(datasource));
4850
}
4951

@@ -54,4 +56,5 @@ private SQLServerDataSource createDataSource() {
5456
datasource.setPassword(sqlserver.getPassword());
5557
return datasource;
5658
}
59+
5760
}

spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/SQLiteMigrationScriptIntegrationTests.java

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,26 @@
2929
*/
3030
class SQLiteMigrationScriptIntegrationTests {
3131

32-
// Note: This test currently FAILS due to SQLite-specific limitations in migration-sqlite.sql:
32+
// Note: This test currently FAILS due to SQLite-specific limitations in
33+
// migration-sqlite.sql:
3334
// - SQLite does not support "MODIFY COLUMN" syntax
34-
@Test
35-
@Disabled
36-
void migrationScriptShouldBeValid() {
37-
SQLiteDataSource datasource = createDataSource();
35+
@Test
36+
@Disabled
37+
void migrationScriptShouldBeValid() {
38+
SQLiteDataSource datasource = createDataSource();
3839

39-
ResourceDatabasePopulator schemaPopulator = new ResourceDatabasePopulator();
40-
schemaPopulator.addScript(new ClassPathResource("/org/springframework/batch/core/schema-sqlite-v4.sql"));
41-
schemaPopulator.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-sqlite.sql"));
40+
ResourceDatabasePopulator schemaPopulator = new ResourceDatabasePopulator();
41+
schemaPopulator.addScript(new ClassPathResource("/org/springframework/batch/core/schema-sqlite-v4.sql"));
42+
schemaPopulator
43+
.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-sqlite.sql"));
4244

43-
Assertions.assertDoesNotThrow(() -> schemaPopulator.execute(datasource));
44-
}
45+
Assertions.assertDoesNotThrow(() -> schemaPopulator.execute(datasource));
46+
}
47+
48+
private SQLiteDataSource createDataSource() {
49+
SQLiteDataSource datasource = new SQLiteDataSource();
50+
datasource.setUrl("jdbc:sqlite::memory:");
51+
return datasource;
52+
}
4553

46-
private SQLiteDataSource createDataSource() {
47-
SQLiteDataSource datasource = new SQLiteDataSource();
48-
datasource.setUrl("jdbc:sqlite::memory:");
49-
return datasource;
50-
}
5154
}

spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/SybaseMigrationScriptIntegrationTests.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,34 @@
2828

2929
/**
3030
* Integration tests for Sybase migration script for v5.0
31-
*
31+
*
3232
* @author Jinwoo Bae
3333
*/
3434
@Testcontainers(disabledWithoutDocker = true)
3535
class SybaseMigrationScriptIntegrationTests {
3636

3737
@Container
3838
public static GenericContainer<?> sybase = new GenericContainer<>(DockerImageName.parse("datagrip/sybase:16.0"))
39-
.withExposedPorts(5000)
40-
.withEnv("SYBASE_PASSWORD", "myPassword");
39+
.withExposedPorts(5000)
40+
.withEnv("SYBASE_PASSWORD", "myPassword");
4141

42-
// Note: This test currently FAILS due to Sybase-specific database configuration issues:
43-
// - Sybase requires 'select into' or 'full logging for alter table' options to be enabled
42+
// Note: This test currently FAILS due to Sybase-specific database configuration
43+
// issues:
44+
// - Sybase requires 'select into' or 'full logging for alter table' options to be
45+
// enabled
4446
// - Error: "Neither the 'select into' nor the 'full logging for alter table' database
45-
// options are enabled for database 'master'. ALTER TABLE with data copy cannot be done."
47+
// options are enabled for database 'master'. ALTER TABLE with data copy cannot be
48+
// done."
4649
@Test
4750
@Disabled
4851
void migrationScriptShouldBeValid() {
4952
JtdsDataSource datasource = createDataSource();
5053
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
51-
54+
5255
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/schema-sybase-4.sql"));
53-
databasePopulator.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-sybase.sql"));
54-
56+
databasePopulator
57+
.addScript(new ClassPathResource("/org/springframework/batch/core/migration/5.0/migration-sybase.sql"));
58+
5559
Assertions.assertDoesNotThrow(() -> databasePopulator.execute(datasource));
5660
}
5761

@@ -65,4 +69,5 @@ private JtdsDataSource createDataSource() {
6569
datasource.setPassword("myPassword");
6670
return datasource;
6771
}
72+
6873
}

0 commit comments

Comments
 (0)