Remove deprecated code
This code removes code deprecated in 1.4 with the exception of code that requires an update to Spring Framework 5. Closes gh-6971
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import org.springframework.boot.context.config.ConfigFileApplicationListener;
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
/**
|
||||
* {@link ApplicationContextInitializer} that can be used with the
|
||||
* {@link ContextConfiguration#initializers()} to trigger loading of
|
||||
* {@literal application.properties}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @see ConfigFileApplicationListener
|
||||
* @deprecated as of 1.4 in favor of
|
||||
* {@link org.springframework.boot.test.context.ConfigFileApplicationContextInitializer}
|
||||
*/
|
||||
@Deprecated
|
||||
public class ConfigFileApplicationContextInitializer extends
|
||||
org.springframework.boot.test.context.ConfigFileApplicationContextInitializer {
|
||||
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
/**
|
||||
* Test utilities for setting environment values.
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @author Stephane Nicoll
|
||||
* @deprecated as of 1.4 in favor of
|
||||
* {@link org.springframework.boot.test.util.EnvironmentTestUtils}
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class EnvironmentTestUtils {
|
||||
|
||||
/**
|
||||
* Add additional (high priority) values to an {@link Environment} owned by an
|
||||
* {@link ApplicationContext}. Name-value pairs can be specified with colon (":") or
|
||||
* equals ("=") separators.
|
||||
* @param context the context with an environment to modify
|
||||
* @param pairs the name:value pairs
|
||||
*/
|
||||
public static void addEnvironment(ConfigurableApplicationContext context,
|
||||
String... pairs) {
|
||||
org.springframework.boot.test.util.EnvironmentTestUtils.addEnvironment(context,
|
||||
pairs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add additional (high priority) values to an {@link Environment}. Name-value pairs
|
||||
* can be specified with colon (":") or equals ("=") separators.
|
||||
* @param environment the environment to modify
|
||||
* @param pairs the name:value pairs
|
||||
*/
|
||||
public static void addEnvironment(ConfigurableEnvironment environment,
|
||||
String... pairs) {
|
||||
org.springframework.boot.test.util.EnvironmentTestUtils
|
||||
.addEnvironment(environment, pairs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add additional (high priority) values to an {@link Environment}. Name-value pairs
|
||||
* can be specified with colon (":") or equals ("=") separators.
|
||||
* @param environment the environment to modify
|
||||
* @param name the property source name
|
||||
* @param pairs the name:value pairs
|
||||
*/
|
||||
public static void addEnvironment(String name, ConfigurableEnvironment environment,
|
||||
String... pairs) {
|
||||
org.springframework.boot.test.util.EnvironmentTestUtils.addEnvironment(name,
|
||||
environment, pairs);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.test.context.TestExecutionListeners;
|
||||
import org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener;
|
||||
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
|
||||
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;
|
||||
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
|
||||
|
||||
/**
|
||||
* Test class annotation signifying that the tests are "integration tests" and therefore
|
||||
* require full startup in the same way as a production application. Normally used in
|
||||
* conjunction with {@code @SpringApplicationConfiguration}.
|
||||
* <p>
|
||||
* If your test also uses {@code @WebAppConfiguration} consider using the
|
||||
* {@link WebIntegrationTest} instead.
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @see WebIntegrationTest
|
||||
* @deprecated as of 1.4 in favor of {@link SpringBootTest}
|
||||
*/
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
// Leave out the ServletTestExecutionListener because it only deals with Mock* servlet
|
||||
// stuff. A real embedded application will not need the mocks.
|
||||
@TestExecutionListeners(listeners = { IntegrationTestPropertiesListener.class,
|
||||
DependencyInjectionTestExecutionListener.class,
|
||||
DirtiesContextTestExecutionListener.class,
|
||||
TransactionalTestExecutionListener.class, SqlScriptsTestExecutionListener.class })
|
||||
@Deprecated
|
||||
public @interface IntegrationTest {
|
||||
|
||||
/**
|
||||
* Properties in form {@literal key=value} that should be added to the Spring
|
||||
* {@link Environment} before the test runs.
|
||||
* @return the environment properties
|
||||
*/
|
||||
String[] value() default {};
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.AnnotatedElementUtils;
|
||||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.test.context.MergedContextConfiguration;
|
||||
import org.springframework.test.context.TestContext;
|
||||
import org.springframework.test.context.support.AbstractTestExecutionListener;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
|
||||
/**
|
||||
* Manipulate the TestContext to merge properties from {@code @IntegrationTest}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @author Phillip Webb
|
||||
* @since 1.2.0
|
||||
* @deprecated as of 1.4 as no longer used by {@code @IntegrationTest}.
|
||||
*/
|
||||
@Deprecated
|
||||
public class IntegrationTestPropertiesListener extends AbstractTestExecutionListener {
|
||||
|
||||
@Override
|
||||
public void prepareTestInstance(TestContext testContext) throws Exception {
|
||||
Class<?> testClass = testContext.getTestClass();
|
||||
AnnotationAttributes annotationAttributes = AnnotatedElementUtils
|
||||
.getMergedAnnotationAttributes(testClass,
|
||||
IntegrationTest.class.getName());
|
||||
if (annotationAttributes != null) {
|
||||
addPropertySourceProperties(testContext,
|
||||
annotationAttributes.getStringArray("value"));
|
||||
}
|
||||
}
|
||||
|
||||
private void addPropertySourceProperties(TestContext testContext,
|
||||
String[] properties) {
|
||||
try {
|
||||
MergedContextConfiguration configuration = (MergedContextConfiguration) ReflectionTestUtils
|
||||
.getField(testContext, "mergedContextConfiguration");
|
||||
new MergedContextConfigurationProperties(configuration).add(properties);
|
||||
}
|
||||
catch (RuntimeException ex) {
|
||||
throw ex;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Ordered.HIGHEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.test.context.MergedContextConfiguration;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
|
||||
/**
|
||||
* Provides access to {@link MergedContextConfiguration} properties.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @deprecated as of 1.4 along with {@link IntegrationTestPropertiesListener}
|
||||
*/
|
||||
@Deprecated
|
||||
class MergedContextConfigurationProperties {
|
||||
|
||||
private final MergedContextConfiguration configuration;
|
||||
|
||||
MergedContextConfigurationProperties(MergedContextConfiguration configuration) {
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
public void add(String[] properties, String... additional) {
|
||||
Set<String> merged = new LinkedHashSet<String>(
|
||||
(Arrays.asList(this.configuration.getPropertySourceProperties())));
|
||||
merged.addAll(Arrays.asList(properties));
|
||||
merged.addAll(Arrays.asList(additional));
|
||||
addIntegrationTestProperty(merged);
|
||||
ReflectionTestUtils.setField(this.configuration, "propertySourceProperties",
|
||||
merged.toArray(new String[merged.size()]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an "IntegrationTest" property to ensure that there is something to
|
||||
* differentiate regular tests and {@code @IntegrationTest} tests. Without this
|
||||
* property a cached context could be returned that hadn't started the embedded
|
||||
* servlet container.
|
||||
* @param propertySourceProperties the property source properties
|
||||
*/
|
||||
private void addIntegrationTestProperty(Set<String> propertySourceProperties) {
|
||||
propertySourceProperties.add(WebIntegrationTest.class.getName() + "=true");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
/**
|
||||
* JUnit {@code @Rule} to capture output from System.out and System.err.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Andy Wilkinson
|
||||
* @deprecated as of 1.4 in favor of
|
||||
* {@link org.springframework.boot.test.rule.OutputCapture}
|
||||
*/
|
||||
@Deprecated
|
||||
public class OutputCapture extends org.springframework.boot.test.rule.OutputCapture {
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootContextLoader;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
/**
|
||||
* Class-level annotation that is used to determine how to load and configure an
|
||||
* {@code ApplicationContext} for integration tests.
|
||||
* <p>
|
||||
* Similar to the standard {@link ContextConfiguration @ContextConfiguration} but uses
|
||||
* Spring Boot's {@link SpringApplicationContextLoader}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @author Sam Brannen
|
||||
* @see SpringBootContextLoader
|
||||
* @see ContextConfiguration
|
||||
* @deprecated as of 1.4 in favor of {@link SpringBootTest} or direct use of
|
||||
* {@link SpringBootContextLoader}.
|
||||
*/
|
||||
@ContextConfiguration(loader = SpringApplicationContextLoader.class)
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Deprecated
|
||||
public @interface SpringApplicationConfiguration {
|
||||
|
||||
/**
|
||||
* The context configuration classes.
|
||||
* @see ContextConfiguration#classes()
|
||||
* @return the context configuration classes
|
||||
*/
|
||||
@AliasFor("classes")
|
||||
Class<?>[] value() default {};
|
||||
|
||||
/**
|
||||
* The context configuration locations.
|
||||
* @see ContextConfiguration#locations()
|
||||
* @return the context configuration locations
|
||||
*/
|
||||
@AliasFor(annotation = ContextConfiguration.class, attribute = "locations")
|
||||
String[] locations() default {};
|
||||
|
||||
/**
|
||||
* The context configuration classes.
|
||||
* @see ContextConfiguration#classes()
|
||||
* @return the context configuration classes
|
||||
*/
|
||||
@AliasFor("value")
|
||||
Class<?>[] classes() default {};
|
||||
|
||||
/**
|
||||
* The context configuration initializers.
|
||||
* @see ContextConfiguration#initializers()
|
||||
* @return the context configuration initializers
|
||||
*/
|
||||
@AliasFor(annotation = ContextConfiguration.class, attribute = "initializers")
|
||||
Class<? extends ApplicationContextInitializer<? extends ConfigurableApplicationContext>>[] initializers() default {};
|
||||
|
||||
/**
|
||||
* Should context locations be inherited.
|
||||
* @see ContextConfiguration#inheritLocations()
|
||||
* @return {@code true} if context locations should be inherited
|
||||
*/
|
||||
@AliasFor(annotation = ContextConfiguration.class, attribute = "inheritLocations")
|
||||
boolean inheritLocations() default true;
|
||||
|
||||
/**
|
||||
* Should initializers be inherited.
|
||||
* @see ContextConfiguration#inheritInitializers()
|
||||
* @return {@code true} if context initializers should be inherited
|
||||
*/
|
||||
@AliasFor(annotation = ContextConfiguration.class, attribute = "inheritInitializers")
|
||||
boolean inheritInitializers() default true;
|
||||
|
||||
/**
|
||||
* The name of the context hierarchy level.
|
||||
* @see ContextConfiguration#name()
|
||||
* @return the name of the context hierarchy level
|
||||
*/
|
||||
@AliasFor(annotation = ContextConfiguration.class, attribute = "name")
|
||||
String name() default "";
|
||||
|
||||
}
|
||||
@@ -1,291 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.test.context.SpringBootContextLoader;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.web.support.ServletContextApplicationContextInitializer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.core.SpringVersion;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.MapPropertySource;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.mock.web.MockServletContext;
|
||||
import org.springframework.test.context.ContextConfigurationAttributes;
|
||||
import org.springframework.test.context.ContextLoader;
|
||||
import org.springframework.test.context.MergedContextConfiguration;
|
||||
import org.springframework.test.context.support.AbstractContextLoader;
|
||||
import org.springframework.test.context.support.AnnotationConfigContextLoaderUtils;
|
||||
import org.springframework.test.context.support.TestPropertySourceUtils;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
import org.springframework.test.context.web.WebMergedContextConfiguration;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.context.support.GenericWebApplicationContext;
|
||||
|
||||
/**
|
||||
* A {@link ContextLoader} that can be used to test Spring Boot applications (those that
|
||||
* normally startup using {@link SpringApplication}). Can be used to test non-web features
|
||||
* (like a repository layer) or start a fully-configured embedded servlet container.
|
||||
* <p>
|
||||
* Use {@code @WebIntegrationTest} (or {@code @IntegrationTest} with
|
||||
* {@code @WebAppConfiguration}) to indicate that you want to use a real servlet container
|
||||
* or {@code @WebAppConfiguration} alone to use a {@link MockServletContext}.
|
||||
* <p>
|
||||
* If {@code @ActiveProfiles} are provided in the test class they will be used to create
|
||||
* the application context.
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @author Phillip Webb
|
||||
* @author Andy Wilkinson
|
||||
* @see org.springframework.boot.test.context.SpringBootTest
|
||||
* @see org.springframework.boot.test.IntegrationTest
|
||||
* @see org.springframework.boot.test.WebIntegrationTest
|
||||
* @deprecated as of 1.4 in favor of {@link SpringBootTest @SpringBootTest}
|
||||
* {@link SpringBootContextLoader} can also be considered if absolutely necessary.
|
||||
*/
|
||||
@Deprecated
|
||||
public class SpringApplicationContextLoader extends AbstractContextLoader {
|
||||
|
||||
@Override
|
||||
public ApplicationContext loadContext(final MergedContextConfiguration config)
|
||||
throws Exception {
|
||||
assertValidAnnotations(config.getTestClass());
|
||||
SpringApplication application = getSpringApplication();
|
||||
application.setMainApplicationClass(config.getTestClass());
|
||||
application.setSources(getSources(config));
|
||||
ConfigurableEnvironment environment = new StandardEnvironment();
|
||||
if (!ObjectUtils.isEmpty(config.getActiveProfiles())) {
|
||||
setActiveProfiles(environment, config.getActiveProfiles());
|
||||
}
|
||||
Map<String, Object> properties = getEnvironmentProperties(config);
|
||||
addProperties(environment, properties);
|
||||
application.setEnvironment(environment);
|
||||
List<ApplicationContextInitializer<?>> initializers = getInitializers(config,
|
||||
application);
|
||||
if (config instanceof WebMergedContextConfiguration) {
|
||||
new WebConfigurer().configure(config, application, initializers);
|
||||
}
|
||||
else {
|
||||
application.setWebEnvironment(false);
|
||||
}
|
||||
application.setInitializers(initializers);
|
||||
ConfigurableApplicationContext applicationContext = application.run();
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
private void assertValidAnnotations(Class<?> testClass) {
|
||||
boolean hasWebAppConfiguration = AnnotationUtils.findAnnotation(testClass,
|
||||
WebAppConfiguration.class) != null;
|
||||
boolean hasWebIntegrationTest = AnnotationUtils.findAnnotation(testClass,
|
||||
WebIntegrationTest.class) != null;
|
||||
if (hasWebAppConfiguration && hasWebIntegrationTest) {
|
||||
throw new IllegalStateException("@WebIntegrationTest and "
|
||||
+ "@WebAppConfiguration cannot be used together");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds new {@link org.springframework.boot.SpringApplication} instance. You can
|
||||
* override this method to add custom behavior
|
||||
* @return {@link org.springframework.boot.SpringApplication} instance
|
||||
*/
|
||||
protected SpringApplication getSpringApplication() {
|
||||
return new SpringApplication();
|
||||
}
|
||||
|
||||
private Set<Object> getSources(MergedContextConfiguration mergedConfig) {
|
||||
Set<Object> sources = new LinkedHashSet<Object>();
|
||||
sources.addAll(Arrays.asList(mergedConfig.getClasses()));
|
||||
sources.addAll(Arrays.asList(mergedConfig.getLocations()));
|
||||
Assert.state(!sources.isEmpty(), "No configuration classes "
|
||||
+ "or locations found in @SpringApplicationConfiguration. "
|
||||
+ "For default configuration detection to work you need "
|
||||
+ "Spring 4.0.3 or better (found " + SpringVersion.getVersion() + ").");
|
||||
return sources;
|
||||
}
|
||||
|
||||
private void setActiveProfiles(ConfigurableEnvironment environment,
|
||||
String[] profiles) {
|
||||
EnvironmentTestUtils.addEnvironment(environment, "spring.profiles.active="
|
||||
+ StringUtils.arrayToCommaDelimitedString(profiles));
|
||||
}
|
||||
|
||||
protected Map<String, Object> getEnvironmentProperties(
|
||||
MergedContextConfiguration config) {
|
||||
Map<String, Object> properties = new LinkedHashMap<String, Object>();
|
||||
// JMX bean names will clash if the same bean is used in multiple contexts
|
||||
disableJmx(properties);
|
||||
properties.putAll(TestPropertySourceUtils
|
||||
.convertInlinedPropertiesToMap(config.getPropertySourceProperties()));
|
||||
if (!TestAnnotations.isIntegrationTest(config)) {
|
||||
properties.putAll(getDefaultEnvironmentProperties());
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
private void disableJmx(Map<String, Object> properties) {
|
||||
properties.put("spring.jmx.enabled", "false");
|
||||
}
|
||||
|
||||
private Map<String, String> getDefaultEnvironmentProperties() {
|
||||
return Collections.singletonMap("server.port", "-1");
|
||||
}
|
||||
|
||||
private void addProperties(ConfigurableEnvironment environment,
|
||||
Map<String, Object> properties) {
|
||||
// @IntegrationTest properties go before external configuration and after system
|
||||
environment.getPropertySources().addAfter(
|
||||
StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
|
||||
new MapPropertySource("integrationTest", properties));
|
||||
}
|
||||
|
||||
private List<ApplicationContextInitializer<?>> getInitializers(
|
||||
MergedContextConfiguration mergedConfig, SpringApplication application) {
|
||||
List<ApplicationContextInitializer<?>> initializers = new ArrayList<ApplicationContextInitializer<?>>();
|
||||
initializers.add(new PropertySourceLocationsInitializer(
|
||||
mergedConfig.getPropertySourceLocations()));
|
||||
initializers.addAll(application.getInitializers());
|
||||
for (Class<? extends ApplicationContextInitializer<?>> initializerClass : mergedConfig
|
||||
.getContextInitializerClasses()) {
|
||||
initializers.add(BeanUtils.instantiate(initializerClass));
|
||||
}
|
||||
return initializers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processContextConfiguration(
|
||||
ContextConfigurationAttributes configAttributes) {
|
||||
super.processContextConfiguration(configAttributes);
|
||||
if (!configAttributes.hasResources()) {
|
||||
Class<?>[] defaultConfigClasses = detectDefaultConfigurationClasses(
|
||||
configAttributes.getDeclaringClass());
|
||||
configAttributes.setClasses(defaultConfigClasses);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect the default configuration classes for the supplied test class. By default
|
||||
* simply delegates to
|
||||
* {@link AnnotationConfigContextLoaderUtils#detectDefaultConfigurationClasses} .
|
||||
* @param declaringClass the test class that declared {@code @ContextConfiguration}
|
||||
* @return an array of default configuration classes, potentially empty but never
|
||||
* {@code null}
|
||||
* @see AnnotationConfigContextLoaderUtils
|
||||
*/
|
||||
protected Class<?>[] detectDefaultConfigurationClasses(Class<?> declaringClass) {
|
||||
return AnnotationConfigContextLoaderUtils
|
||||
.detectDefaultConfigurationClasses(declaringClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationContext loadContext(String... locations) throws Exception {
|
||||
throw new UnsupportedOperationException("SpringApplicationContextLoader "
|
||||
+ "does not support the loadContext(String...) method");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getResourceSuffixes() {
|
||||
return new String[] { "-context.xml", "Context.groovy" };
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getResourceSuffix() {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inner class to configure {@link WebMergedContextConfiguration}.
|
||||
*/
|
||||
private static class WebConfigurer {
|
||||
|
||||
private static final Class<GenericWebApplicationContext> WEB_CONTEXT_CLASS = GenericWebApplicationContext.class;
|
||||
|
||||
void configure(MergedContextConfiguration configuration,
|
||||
SpringApplication application,
|
||||
List<ApplicationContextInitializer<?>> initializers) {
|
||||
if (!TestAnnotations.isIntegrationTest(configuration)) {
|
||||
WebMergedContextConfiguration webConfiguration = (WebMergedContextConfiguration) configuration;
|
||||
addMockServletContext(initializers, webConfiguration);
|
||||
application.setApplicationContextClass(WEB_CONTEXT_CLASS);
|
||||
}
|
||||
}
|
||||
|
||||
private void addMockServletContext(
|
||||
List<ApplicationContextInitializer<?>> initializers,
|
||||
WebMergedContextConfiguration webConfiguration) {
|
||||
SpringBootMockServletContext servletContext = new SpringBootMockServletContext(
|
||||
webConfiguration.getResourceBasePath());
|
||||
initializers.add(0, new ServletContextApplicationContextInitializer(
|
||||
servletContext, true));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link ApplicationContextInitializer} to setup test property source locations.
|
||||
*/
|
||||
private static class PropertySourceLocationsInitializer
|
||||
implements ApplicationContextInitializer<ConfigurableApplicationContext> {
|
||||
|
||||
private final String[] propertySourceLocations;
|
||||
|
||||
PropertySourceLocationsInitializer(String[] propertySourceLocations) {
|
||||
this.propertySourceLocations = propertySourceLocations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(ConfigurableApplicationContext applicationContext) {
|
||||
TestPropertySourceUtils.addPropertiesFilesToEnvironment(applicationContext,
|
||||
this.propertySourceLocations);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TestAnnotations {
|
||||
|
||||
public static boolean isIntegrationTest(
|
||||
MergedContextConfiguration configuration) {
|
||||
return (hasAnnotation(configuration, IntegrationTest.class)
|
||||
|| hasAnnotation(configuration, WebIntegrationTest.class));
|
||||
}
|
||||
|
||||
private static boolean hasAnnotation(MergedContextConfiguration configuration,
|
||||
Class<? extends Annotation> annotation) {
|
||||
return (AnnotationUtils.findAnnotation(configuration.getTestClass(),
|
||||
annotation) != null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.mock.web.MockServletContext;
|
||||
|
||||
/**
|
||||
* {@link MockServletContext} implementation for Spring Boot. Respects well-known Spring
|
||||
* Boot resource locations and uses an empty directory for "/" if no locations can be
|
||||
* found.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @deprecated as of 1.4 in favor of
|
||||
* {@link org.springframework.boot.test.mock.web.SpringBootMockServletContext}
|
||||
*/
|
||||
@Deprecated
|
||||
public class SpringBootMockServletContext
|
||||
extends org.springframework.boot.test.mock.web.SpringBootMockServletContext {
|
||||
|
||||
public SpringBootMockServletContext(String resourceBasePath) {
|
||||
super(resourceBasePath);
|
||||
}
|
||||
|
||||
public SpringBootMockServletContext(String resourceBasePath,
|
||||
ResourceLoader resourceLoader) {
|
||||
super(resourceBasePath, resourceLoader);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.http.client.config.CookieSpecs;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.config.RequestConfig.Builder;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.http.protocol.HttpContext;
|
||||
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.client.ClientHttpRequestInterceptor;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||
import org.springframework.http.client.InterceptingClientHttpRequestFactory;
|
||||
import org.springframework.http.client.support.BasicAuthorizationInterceptor;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* Convenient subclass of {@link RestTemplate} that is suitable for integration tests.
|
||||
* They are fault tolerant, and optionally can carry Basic authentication headers. If
|
||||
* Apache Http Client 4.3.2 or better is available (recommended) it will be used as the
|
||||
* client, and by default configured to ignore cookies and redirects.
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @author Phillip Webb
|
||||
* @deprecated as of 1.4 in favor of
|
||||
* {@link org.springframework.boot.test.web.client.TestRestTemplate}
|
||||
*/
|
||||
@Deprecated
|
||||
public class TestRestTemplate extends RestTemplate {
|
||||
|
||||
/**
|
||||
* Create a new {@link TestRestTemplate} instance.
|
||||
* @param httpClientOptions client options to use if the Apache HTTP Client is used
|
||||
*/
|
||||
public TestRestTemplate(HttpClientOption... httpClientOptions) {
|
||||
this(null, null, httpClientOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@link TestRestTemplate} instance with the specified credentials.
|
||||
* @param username the username to use (or {@code null})
|
||||
* @param password the password (or {@code null})
|
||||
* @param httpClientOptions client options to use if the Apache HTTP Client is used
|
||||
*/
|
||||
public TestRestTemplate(String username, String password,
|
||||
HttpClientOption... httpClientOptions) {
|
||||
if (ClassUtils.isPresent("org.apache.http.client.config.RequestConfig", null)) {
|
||||
setRequestFactory(
|
||||
new CustomHttpComponentsClientHttpRequestFactory(httpClientOptions));
|
||||
}
|
||||
addAuthentication(username, password);
|
||||
setErrorHandler(new DefaultResponseErrorHandler() {
|
||||
@Override
|
||||
public void handleError(ClientHttpResponse response) throws IOException {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void addAuthentication(String username, String password) {
|
||||
if (username == null) {
|
||||
return;
|
||||
}
|
||||
List<ClientHttpRequestInterceptor> interceptors = Collections
|
||||
.<ClientHttpRequestInterceptor>singletonList(
|
||||
new BasicAuthorizationInterceptor(username, password));
|
||||
setRequestFactory(new InterceptingClientHttpRequestFactory(getRequestFactory(),
|
||||
interceptors));
|
||||
}
|
||||
|
||||
/**
|
||||
* Options used to customize the Apache Http Client if it is used.
|
||||
*/
|
||||
public enum HttpClientOption {
|
||||
|
||||
/**
|
||||
* Enable cookies.
|
||||
*/
|
||||
ENABLE_COOKIES,
|
||||
|
||||
/**
|
||||
* Enable redirects.
|
||||
*/
|
||||
ENABLE_REDIRECTS
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link HttpComponentsClientHttpRequestFactory} to apply customizations.
|
||||
*/
|
||||
protected static class CustomHttpComponentsClientHttpRequestFactory
|
||||
extends HttpComponentsClientHttpRequestFactory {
|
||||
|
||||
private final String cookieSpec;
|
||||
|
||||
private final boolean enableRedirects;
|
||||
|
||||
public CustomHttpComponentsClientHttpRequestFactory(
|
||||
HttpClientOption[] httpClientOptions) {
|
||||
Set<HttpClientOption> options = new HashSet<TestRestTemplate.HttpClientOption>(
|
||||
Arrays.asList(httpClientOptions));
|
||||
this.cookieSpec = (options.contains(HttpClientOption.ENABLE_COOKIES)
|
||||
? CookieSpecs.STANDARD : CookieSpecs.IGNORE_COOKIES);
|
||||
this.enableRedirects = options.contains(HttpClientOption.ENABLE_REDIRECTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected HttpContext createHttpContext(HttpMethod httpMethod, URI uri) {
|
||||
HttpClientContext context = HttpClientContext.create();
|
||||
context.setRequestConfig(getRequestConfig());
|
||||
return context;
|
||||
}
|
||||
|
||||
protected RequestConfig getRequestConfig() {
|
||||
Builder builder = RequestConfig.custom().setCookieSpec(this.cookieSpec)
|
||||
.setAuthenticationEnabled(false)
|
||||
.setRedirectsEnabled(this.enableRedirects);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.test.context.ContextLoader;
|
||||
import org.springframework.test.context.MergedContextConfiguration;
|
||||
import org.springframework.test.context.TestContextBootstrapper;
|
||||
import org.springframework.test.context.support.DefaultTestContextBootstrapper;
|
||||
import org.springframework.test.context.web.WebDelegatingSmartContextLoader;
|
||||
import org.springframework.test.context.web.WebMergedContextConfiguration;
|
||||
|
||||
/**
|
||||
* {@link TestContextBootstrapper} for Spring Boot web integration tests.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @since 1.2.1
|
||||
* @deprecated as of 1.4 along with {@link WebIntegrationTest}
|
||||
*/
|
||||
@Deprecated
|
||||
class WebAppIntegrationTestContextBootstrapper extends DefaultTestContextBootstrapper {
|
||||
|
||||
@Override
|
||||
protected Class<? extends ContextLoader> getDefaultContextLoaderClass(
|
||||
Class<?> testClass) {
|
||||
if (AnnotationUtils.findAnnotation(testClass, WebIntegrationTest.class) != null) {
|
||||
return WebDelegatingSmartContextLoader.class;
|
||||
}
|
||||
return super.getDefaultContextLoaderClass(testClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MergedContextConfiguration processMergedContextConfiguration(
|
||||
MergedContextConfiguration mergedConfig) {
|
||||
WebIntegrationTest annotation = AnnotationUtils
|
||||
.findAnnotation(mergedConfig.getTestClass(), WebIntegrationTest.class);
|
||||
if (annotation != null) {
|
||||
mergedConfig = new WebMergedContextConfiguration(mergedConfig, null);
|
||||
MergedContextConfigurationProperties properties = new MergedContextConfigurationProperties(
|
||||
mergedConfig);
|
||||
if (annotation.randomPort()) {
|
||||
properties.add(annotation.value(), "server.port:0");
|
||||
}
|
||||
else {
|
||||
properties.add(annotation.value());
|
||||
}
|
||||
}
|
||||
return mergedConfig;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.context.embedded.LocalServerPort;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.test.context.BootstrapWith;
|
||||
|
||||
/**
|
||||
* Test class annotation signifying that the tests are "web integration tests" and
|
||||
* therefore require full startup in the same way as a production application (listening
|
||||
* on normal ports). Normally used in conjunction with
|
||||
* {@code @SpringApplicationConfiguration},
|
||||
* <p>
|
||||
* This annotation can be used as an alternative to {@code @IntegrationTest} and
|
||||
* {@code @WebAppConfiguration}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @since 1.2.1
|
||||
* @see IntegrationTest
|
||||
* @deprecated as of 1.4 in favor of
|
||||
* {@link org.springframework.boot.test.context.SpringBootTest} with
|
||||
* {@code webEnvironment=RANDOM_PORT} or {@code webEnvironment=DEFINED_PORT}.
|
||||
*/
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@BootstrapWith(WebAppIntegrationTestContextBootstrapper.class)
|
||||
@Deprecated
|
||||
public @interface WebIntegrationTest {
|
||||
|
||||
/**
|
||||
* Properties in form {@literal key=value} that should be added to the Spring
|
||||
* {@link Environment} before the test runs.
|
||||
* @return properties to add to the context
|
||||
*/
|
||||
String[] value() default {};
|
||||
|
||||
/**
|
||||
* Convenience attribute that can be used to set a {@code server.port=0}
|
||||
* {@link Environment} property which usually triggers listening on a random port.
|
||||
* Often used in conjunction with a {@link LocalServerPort} injected field on the
|
||||
* test.
|
||||
* @return if a random port should be used
|
||||
*/
|
||||
boolean randomPort() default false;
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Classes and utilities that are useful when unit-testing Spring Boot applications.
|
||||
*/
|
||||
package org.springframework.boot.test;
|
||||
Reference in New Issue
Block a user