diff --git a/embedded-database-spring-test/src/test/java/io/zonky/test/db/liquibase/LiquibaseDatabaseExtensionTest.java b/embedded-database-spring-test/src/test/java/io/zonky/test/db/liquibase/LiquibaseDatabaseExtensionTest.java index c2e3986..311989c 100644 --- a/embedded-database-spring-test/src/test/java/io/zonky/test/db/liquibase/LiquibaseDatabaseExtensionTest.java +++ b/embedded-database-spring-test/src/test/java/io/zonky/test/db/liquibase/LiquibaseDatabaseExtensionTest.java @@ -22,10 +22,12 @@ import liquibase.exception.LiquibaseException; import liquibase.integration.spring.SpringLiquibase; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.mockito.Mock; +import org.mockito.internal.runners.util.TestMethodsFinder; import org.mockito.runners.MockitoJUnitRunner; import org.springframework.aop.framework.Advised; @@ -45,8 +47,19 @@ public class LiquibaseDatabaseExtensionTest { private SpringLiquibase liquibase; + @BeforeClass + public static void beforeClass() { + System.out.println("TestMethodsFinder.hasTestMethods(SpringLiquibase.class)..."); + boolean hasTestMethods = TestMethodsFinder.hasTestMethods(SpringLiquibase.class); + System.out.println("TestMethodsFinder.hasTestMethods(SpringLiquibase.class): " + hasTestMethods); + System.out.println("TestMethodsFinder.hasTestMethods(LiquibaseException.class)..."); + hasTestMethods = TestMethodsFinder.hasTestMethods(LiquibaseException.class); + System.out.println("TestMethodsFinder.hasTestMethods(LiquibaseException.class): " + hasTestMethods); + } + @Before - public void setUp() { + public void setUp() throws ClassNotFoundException { + Class liquibaseException = getClass().getClassLoader().loadClass("liquibase.exception.LiquibaseException"); Advised dataSource = mock(Advised.class, withSettings().extraInterfaces(DataSource.class)); when(dataSource.getTargetSource()).thenReturn(new DatabaseTargetSource(databaseContext)); @@ -63,4 +76,4 @@ public void testMigrate() throws LiquibaseException { verify(databaseContext).apply(new LiquibaseDatabasePreparer(LiquibaseDescriptor.from(liquibase))); } -} \ No newline at end of file +}