|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2016 the original author or authors.
|
|
|
|
|
* Copyright 2012-2017 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
@ -19,8 +19,10 @@ package org.springframework.boot.actuate.endpoint;
|
|
|
|
|
import liquibase.integration.spring.SpringLiquibase;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
|
|
|
|
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
|
|
|
import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration;
|
|
|
|
|
import org.springframework.boot.test.util.EnvironmentTestUtils;
|
|
|
|
|
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
@ -44,8 +46,20 @@ public class LiquibaseEndpointTests extends AbstractEndpointTests<LiquibaseEndpo
|
|
|
|
|
assertThat(getEndpointBean().invoke()).hasSize(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void invokeWithCustomSchema() throws Exception {
|
|
|
|
|
this.context = new AnnotationConfigApplicationContext();
|
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
|
"liquibase.default-schema=CUSTOMSCHEMA",
|
|
|
|
|
"spring.datasource.generate-unique-name=true",
|
|
|
|
|
"spring.datasource.schema=classpath:/db/create-custom-schema.sql");
|
|
|
|
|
this.context.register(Config.class);
|
|
|
|
|
this.context.refresh();
|
|
|
|
|
assertThat(getEndpointBean().invoke()).hasSize(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
|
@Import({ EmbeddedDataSourceConfiguration.class, LiquibaseAutoConfiguration.class })
|
|
|
|
|
@Import({ DataSourceAutoConfiguration.class, LiquibaseAutoConfiguration.class })
|
|
|
|
|
public static class Config {
|
|
|
|
|
|
|
|
|
|
private final SpringLiquibase liquibase;
|
|
|
|
|