StartupShutdownService { static boolean isBlankOrSqlComment(String sqlLine) { return SQL_COMMENT_PATTERN.matcher(sqlLine).matches(); }  @PostConstruct void startup(); @PreDestroy void shutdown(); static final String SORMAS_TO_SORMAS_USER_NAME; }
@Test public void testIsBlankOrSqlComment() { assertThat(StartupShutdownService.isBlankOrSqlComment(""), is(true)); assertThat(StartupShutdownService.isBlankOrSqlComment(" \t "), is(true)); assertThat( StartupShutdownService.isBlankOrSqlComment("--INSERT INTO schema_version (version_number, comment) VALUES (1, 'Init database');"), is(true)); assertThat(StartupShutdownService.isBlankOrSqlComment("\t --"), is(true)); assertThat( StartupShutdownService.isBlankOrSqlComment("INSERT INTO schema_version (version_number, comment) VALUES (1, 'Init database');"), is(false)); assertThat(StartupShutdownService.isBlankOrSqlComment(" select * from test; -- comment"), is(false)); }