11/*
2- * Copyright 2012-2016 the original author or authors.
2+ * Copyright 2012-2017 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.
1919import liquibase .integration .spring .SpringLiquibase ;
2020import org .junit .Test ;
2121
22- import org .springframework .boot .autoconfigure .jdbc .EmbeddedDataSourceConfiguration ;
22+ import org .springframework .boot .autoconfigure .jdbc .DataSourceAutoConfiguration ;
2323import org .springframework .boot .autoconfigure .liquibase .LiquibaseAutoConfiguration ;
24+ import org .springframework .boot .test .util .TestPropertyValues ;
25+ import org .springframework .context .annotation .AnnotationConfigApplicationContext ;
2426import org .springframework .context .annotation .Bean ;
2527import org .springframework .context .annotation .Configuration ;
2628import org .springframework .context .annotation .Import ;
@@ -44,8 +46,20 @@ public void invoke() throws Exception {
4446 assertThat (getEndpointBean ().invoke ()).hasSize (1 );
4547 }
4648
49+ @ Test
50+ public void invokeWithCustomSchema () throws Exception {
51+ this .context = new AnnotationConfigApplicationContext ();
52+ TestPropertyValues .of ("liquibase.default-schema=CUSTOMSCHEMA" ,
53+ "spring.datasource.generate-unique-name=true" ,
54+ "spring.datasource.schema=classpath:/db/create-custom-schema.sql" )
55+ .applyTo (this .context );
56+ this .context .register (Config .class );
57+ this .context .refresh ();
58+ assertThat (getEndpointBean ().invoke ()).hasSize (1 );
59+ }
60+
4761 @ Configuration
48- @ Import ({ EmbeddedDataSourceConfiguration .class , LiquibaseAutoConfiguration .class })
62+ @ Import ({ DataSourceAutoConfiguration .class , LiquibaseAutoConfiguration .class })
4963 public static class Config {
5064
5165 private final SpringLiquibase liquibase ;
0 commit comments