Merge pull request #18285 from adiohana

* gh-18285:
  Test custom comment prefix with one that does not work by default

Closes gh-18285
This commit is contained in:
Andy Wilkinson 2019-09-21 13:41:43 +01:00
commit 0efee9e327
2 changed files with 4 additions and 4 deletions

View File

@ -50,8 +50,8 @@ public class QuartzDataSourceInitializerTests {
@Test @Test
public void commentPrefixCanBeCustomized() { public void commentPrefixCanBeCustomized() {
this.contextRunner.withUserConfiguration(TestConfiguration.class).withPropertyValues( this.contextRunner.withUserConfiguration(TestConfiguration.class).withPropertyValues(
"spring.quartz.jdbc.comment-prefix=##", "spring.quartz.jdbc.comment-prefix=**",
"spring.quartz.jdbc.schema=classpath:org/springframework/boot/autoconfigure/quartz/tables_@@platform@@.sql") "spring.quartz.jdbc.schema=classpath:org/springframework/boot/autoconfigure/quartz/tables_**_comments.sql")
.run((context) -> { .run((context) -> {
JdbcTemplate jdbcTemplate = context.getBean(JdbcTemplate.class); JdbcTemplate jdbcTemplate = context.getBean(JdbcTemplate.class);
assertThat(jdbcTemplate.queryForObject("SELECT COUNT(*) FROM QRTZ_TEST_TABLE", Integer.class)) assertThat(jdbcTemplate.queryForObject("SELECT COUNT(*) FROM QRTZ_TEST_TABLE", Integer.class))

View File

@ -1,10 +1,10 @@
## This is a test script to check custom comment prefix is taken into account ** This is a test script to check ** is treated as a comment prefix when prefix is customized
CREATE TABLE QRTZ_TEST_TABLE ( CREATE TABLE QRTZ_TEST_TABLE (
SCHED_NAME VARCHAR(120) NOT NULL, SCHED_NAME VARCHAR(120) NOT NULL,
CALENDAR_NAME VARCHAR (200) NOT NULL CALENDAR_NAME VARCHAR (200) NOT NULL
); );
## Another comment ** Another comment
COMMIT; COMMIT;