Skip to content

Commit 6c191e1

Browse files
committed
Fix broken usage of LiquibaseServiceLocatorApplicationListener
1 parent 08ec3d2 commit 6c191e1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,9 +30,11 @@
3030
import org.junit.rules.TemporaryFolder;
3131

3232
import org.springframework.beans.factory.BeanCreationException;
33+
import org.springframework.boot.SpringApplication;
3334
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
3435
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
3536
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
37+
import org.springframework.boot.context.event.ApplicationStartingEvent;
3638
import org.springframework.boot.liquibase.CommonsLoggingLiquibaseLogger;
3739
import org.springframework.boot.liquibase.LiquibaseServiceLocatorApplicationListener;
3840
import org.springframework.boot.test.rule.OutputCapture;
@@ -70,7 +72,9 @@ public class LiquibaseAutoConfigurationTests {
7072
public void init() {
7173
EnvironmentTestUtils.addEnvironment(this.context,
7274
"spring.datasource.name:liquibasetest");
73-
new LiquibaseServiceLocatorApplicationListener().onApplicationEvent(null);
75+
new LiquibaseServiceLocatorApplicationListener().onApplicationEvent(
76+
new ApplicationStartingEvent(new SpringApplication(Object.class),
77+
new String[0]));
7478
}
7579

7680
@After

0 commit comments

Comments
 (0)