pull/13568/merge
Andy Wilkinson 6 years ago
parent 953df7cf86
commit 454de0bfd7

@ -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.
@ -66,9 +66,14 @@ public abstract class AbstractEndpointTests<T extends Endpoint<?>> {
public void setup() {
this.context = new AnnotationConfigApplicationContext();
this.context.register(JacksonAutoConfiguration.class, this.configClass);
configureEnvironment(this.context);
this.context.refresh();
}
protected void configureEnvironment(AnnotationConfigApplicationContext context) {
}
@After
public void close() {
if (this.context != null) {

@ -46,6 +46,12 @@ public class LiquibaseEndpointTests extends AbstractEndpointTests<LiquibaseEndpo
"endpoints.liquibase");
}
@Override
protected void configureEnvironment(AnnotationConfigApplicationContext context) {
EnvironmentTestUtils.addEnvironment(context,
"spring.datasource.generate-unique-name=true");
}
@Test
public void invoke() throws Exception {
DataSource dataSource = this.context.getBean(DataSource.class);
@ -70,7 +76,6 @@ public class LiquibaseEndpointTests extends AbstractEndpointTests<LiquibaseEndpo
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();

Loading…
Cancel
Save