diff --git a/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/ddl/index/PostgreSQLIndexSQLGeneratorTest.java b/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/ddl/index/PostgreSQLIndexSQLGeneratorTest.java index 9691bd61f8288..de572aab2eee1 100644 --- a/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/ddl/index/PostgreSQLIndexSQLGeneratorTest.java +++ b/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/ddl/index/PostgreSQLIndexSQLGeneratorTest.java @@ -39,7 +39,7 @@ void assertGenerate() throws SQLException { Connection connection = mock(Connection.class, RETURNS_DEEP_STUBS); ResultSet getNodesResultSet = mockGetNodesResultSet(); when(connection.createStatement().executeQuery( - contains("SELECT DISTINCT ON(cls.relname) cls.oid, cls.relname as name," + System.lineSeparator() + "(SELECT (CASE WHEN count(i.inhrelid) > 0 THEN true ELSE false END)"))) + contains("SELECT DISTINCT ON(cls.relname) cls.oid, cls.relname as name," + "\n" + "(SELECT (CASE WHEN count(i.inhrelid) > 0 THEN true ELSE false END)"))) .thenReturn(getNodesResultSet); ResultSet getPropertiesResultSet = mockGetPropertiesResultSet(); when(connection.createStatement().executeQuery(contains("SELECT DISTINCT ON(cls.relname) cls.oid, cls.relname as name, indrelid, indkey, indisclustered"))).thenReturn(getPropertiesResultSet); @@ -50,8 +50,8 @@ void assertGenerate() throws SQLException { context.put("schema", "foo_schema"); context.put("name", "foo_tbl"); String actual = new PostgreSQLIndexSQLGenerator(connection, 10, 0).generate(context); - String expected = "CREATE INDEX IF NOT EXISTS foo_tbl" + System.lineSeparator() + "ON foo_schema.foo_tbl USING foo_am_name" - + System.lineSeparator() + "()" + System.lineSeparator() + "WITH (FILLFACTOR=90)" + System.lineSeparator() + "TABLESPACE default" + System.lineSeparator() + "WHERE NULL;"; + String expected = "CREATE INDEX IF NOT EXISTS foo_tbl" + "\n" + "ON foo_schema.foo_tbl USING foo_am_name" + + "\n" + "()" + "\n" + "WITH (FILLFACTOR=90)" + "\n" + "TABLESPACE default" + "\n" + "WHERE NULL;"; assertThat(actual, is(expected)); } diff --git a/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/ddl/table/PostgreSQLTablePropertiesLoaderTest.java b/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/ddl/table/PostgreSQLTablePropertiesLoaderTest.java index 8556ea175b162..5fc83af3be9ea 100644 --- a/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/ddl/table/PostgreSQLTablePropertiesLoaderTest.java +++ b/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/ddl/table/PostgreSQLTablePropertiesLoaderTest.java @@ -37,10 +37,10 @@ void assertLoad() throws SQLException { Connection connection = mock(Connection.class, RETURNS_DEEP_STUBS); when(connection.getCatalog()).thenReturn("foo_db"); ResultSet fetchDatabaseIdResultSet = mockFetchDatabaseIdResultSet(); - when(connection.createStatement().executeQuery(System.lineSeparator() + "SELECT oid AS did, datlastsysoid FROM pg_catalog.pg_database WHERE datname = 'foo_db';" + System.lineSeparator())) + when(connection.createStatement().executeQuery("\n" + "SELECT oid AS did, datlastsysoid FROM pg_catalog.pg_database WHERE datname = 'foo_db';" + "\n")) .thenReturn(fetchDatabaseIdResultSet); ResultSet fetchSchemaIdResultSet = mockFetchSchemaIdResultSet(); - when(connection.createStatement().executeQuery(System.lineSeparator() + "SELECT oid AS scid FROM pg_catalog.pg_namespace WHERE nspname = 'foo_schema';" + System.lineSeparator())) + when(connection.createStatement().executeQuery("\n" + "SELECT oid AS scid FROM pg_catalog.pg_namespace WHERE nspname = 'foo_schema';" + "\n")) .thenReturn(fetchSchemaIdResultSet); Map actual = new PostgreSQLTablePropertiesLoader(connection, "foo_tbl", "foo_schema", 12, 0).load(); assertThat(actual.size(), is(7)); diff --git a/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/template/PostgreSQLPipelineFreemarkerManagerTest.java b/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/template/PostgreSQLPipelineFreemarkerManagerTest.java index 7a2dc17336e13..742e0a41ddc3d 100644 --- a/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/template/PostgreSQLPipelineFreemarkerManagerTest.java +++ b/kernel/data-pipeline/dialect/postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/template/PostgreSQLPipelineFreemarkerManagerTest.java @@ -32,7 +32,7 @@ class PostgreSQLPipelineFreemarkerManagerTest { @Test void assertGetSQLByDefaultVersion() { String actual = PostgreSQLPipelineFreemarkerManager.getSQLByVersion(Collections.singletonMap("databaseName", "foo_db"), "component/table/%s/get_database_id.ftl", 10, 0); - String expected = System.lineSeparator() + "SELECT oid AS did, datlastsysoid FROM pg_catalog.pg_database WHERE datname = 'foo_db';" + System.lineSeparator(); + String expected = "\n" + "SELECT oid AS did, datlastsysoid FROM pg_catalog.pg_database WHERE datname = 'foo_db';" + "\n"; assertThat(actual, is(expected)); }