Polishing

This commit is contained in:
Juergen Hoeller
2018-08-24 12:39:03 +02:00
parent a44fe4cbe4
commit b5270a9cff
8 changed files with 203 additions and 198 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -49,7 +49,7 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
* <p>Permissible values include {@link Boolean#TRUE} and {@link Boolean#FALSE}.
*/
public static final String REINJECT_DEPENDENCIES_ATTRIBUTE = Conventions.getQualifiedAttributeName(
DependencyInjectionTestExecutionListener.class, "reinjectDependencies");
DependencyInjectionTestExecutionListener.class, "reinjectDependencies");
private static final Log logger = LogFactory.getLog(DependencyInjectionTestExecutionListener.class);
@@ -76,7 +76,7 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
* from the test context, regardless of its value.
*/
@Override
public void prepareTestInstance(final TestContext testContext) throws Exception {
public void prepareTestInstance(TestContext testContext) throws Exception {
if (logger.isDebugEnabled()) {
logger.debug("Performing dependency injection for test context [" + testContext + "].");
}
@@ -91,7 +91,7 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
* otherwise, this method will have no effect.
*/
@Override
public void beforeTestMethod(final TestContext testContext) throws Exception {
public void beforeTestMethod(TestContext testContext) throws Exception {
if (Boolean.TRUE.equals(testContext.getAttribute(REINJECT_DEPENDENCIES_ATTRIBUTE))) {
if (logger.isDebugEnabled()) {
logger.debug("Reinjecting dependencies for test context [" + testContext + "].");
@@ -112,7 +112,7 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
* @see #prepareTestInstance(TestContext)
* @see #beforeTestMethod(TestContext)
*/
protected void injectDependencies(final TestContext testContext) throws Exception {
protected void injectDependencies(TestContext testContext) throws Exception {
Object bean = testContext.getTestInstance();
AutowireCapableBeanFactory beanFactory = testContext.getApplicationContext().getAutowireCapableBeanFactory();
beanFactory.autowireBeanProperties(bean, AutowireCapableBeanFactory.AUTOWIRE_NO, false);