Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-5452

Unit test fails on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 2.0.0.Beta2
    • 2.0.0.Alpha3
    • debezium-server
    • None

      this test method SignalBasedSnapshotChangeEventSourceTest.testBuildQueryThreePkColumns() fails because this fails:
              Assertions.assertThat(source.buildChunkQuery(table)).isEqualTo("""
                              SELECT * FROM \"s1\".\"table1\"
                              WHERE ((\"pk1\" > ?)
                              OR (\"pk1\" = ? AND \"pk2\" > ?)
                              OR (\"pk1\" = ? AND \"pk2\" = ? AND \"pk3\" > ?))
                              AND NOT ((\"pk1\" > ?) OR (\"pk1\" = ? AND \"pk2\" > ?)
                              OR (\"pk1\" = ? AND \"pk2\" = ? AND \"pk3\" > ?))
                              ORDER BY \"pk1\", \"pk2\", \"pk3\"
                              LIMIT 1024
                      """.replace(System.getProperty("line.separator"), "").replace("        ", " ").trim());

       

      The Java 15 Text Blocks feature is normalizing all line ending terminators to "\n" and not to the platform specific line terminator as coded above.

       

      So in Windows, this code

      .replace(System.getProperty("line.separator"), "")

      does nothing.

       

      The fix is simple:

      .replace("\n", "")

       

              Unassigned Unassigned
              ggaborg Gabor Andras (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: