diff --git a/build.gradle b/build.gradle
index bf5df93e859c..fac5af1ec003 100644
--- a/build.gradle
+++ b/build.gradle
@@ -13,7 +13,6 @@ configure(allprojects) { project ->
version = qualifyVersionIfNecessary(version)
ext.aspectjVersion = "1.7.2"
- ext.easymockVersion = "2.5.2"
ext.hsqldbVersion = "1.8.0.10"
ext.junitVersion = "4.11"
ext.slf4jVersion = "1.6.1"
@@ -69,13 +68,6 @@ configure(allprojects) { project ->
testCompile("junit:junit:${junitVersion}")
testCompile("org.hamcrest:hamcrest-all:1.3")
testCompile("org.mockito:mockito-core:1.9.5")
- if (project.name in ["spring",
- "spring-orm-hibernate4", "spring-oxm", "spring-struts",
- "spring-test", "spring-test-mvc", "spring-tx", "spring-web",
- "spring-webmvc", "spring-webmvc-portlet", "spring-webmvc-tiles3"]) {
- testCompile("org.easymock:easymock:${easymockVersion}")
- testCompile "org.easymock:easymockclassextension:${easymockVersion}"
- }
}
ext.javadocLinks = [
diff --git a/spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java
index e13097c4b68b..f2224a4134d1 100644
--- a/spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java
+++ b/spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java
@@ -16,11 +16,6 @@
package org.springframework.aop.framework.adapter;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Method;
@@ -33,6 +28,9 @@
import org.springframework.aop.ThrowsAdvice;
import org.springframework.tests.aop.advice.MethodCounter;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java
index 0c1c50c9c529..6146571fa6f2 100644
--- a/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java
+++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/CustomizableTraceInterceptorTests.java
@@ -16,18 +16,13 @@
package org.springframework.aop.interceptor;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rob Harrop
* @author Rick Evans
diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java
index d0cee0780eb7..5096fe88dd7a 100644
--- a/spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java
+++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/DebugInterceptorTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,18 +16,13 @@
package org.springframework.aop.interceptor;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for the {@link DebugInterceptor} class.
*
diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptorTests.java
index bf2c45fc2c6e..a08b03064a1e 100644
--- a/spring-aop/src/test/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptorTests.java
+++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/PerformanceMonitorInterceptorTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,16 +16,13 @@
package org.springframework.aop.interceptor;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rob Harrop
* @author Rick Evans
diff --git a/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java
index 96501f2c14f6..5bdeb414dff8 100644
--- a/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java
+++ b/spring-aop/src/test/java/org/springframework/aop/interceptor/SimpleTraceInterceptorTests.java
@@ -16,18 +16,13 @@
package org.springframework.aop.interceptor;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for the {@link SimpleTraceInterceptor} class.
*
diff --git a/spring-aop/src/test/java/org/springframework/aop/scope/DefaultScopedObjectTests.java b/spring-aop/src/test/java/org/springframework/aop/scope/DefaultScopedObjectTests.java
index 9ec42626db35..4e3d3ca61978 100644
--- a/spring-aop/src/test/java/org/springframework/aop/scope/DefaultScopedObjectTests.java
+++ b/spring-aop/src/test/java/org/springframework/aop/scope/DefaultScopedObjectTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,11 +16,11 @@
package org.springframework.aop.scope;
-import static org.mockito.Mockito.mock;
-
import org.junit.Test;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for the {@link DefaultScopedObject} class.
*
diff --git a/spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java b/spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java
index 7a7257ea2f35..cf959b324ca7 100644
--- a/spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java
+++ b/spring-aop/src/test/java/org/springframework/aop/support/DelegatingIntroductionInterceptorTests.java
@@ -16,14 +16,6 @@
package org.springframework.aop.support;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import java.io.Serializable;
import org.aopalliance.intercept.MethodInterceptor;
@@ -41,6 +33,10 @@
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.SerializationTestUtils;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Chris Beams
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
index 94f6376ce18f..73c2ab592a6c 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
@@ -16,24 +16,6 @@
package org.springframework.beans.factory;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.equalTo;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.isNull;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-
import java.io.Closeable;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
@@ -104,6 +86,10 @@
import org.springframework.util.StopWatch;
import org.springframework.util.StringValueResolver;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Tests properties population and autowire behavior.
*
@@ -2261,8 +2247,8 @@ public void testContainsBeanReturnsTrueEvenForAbstractBeanDefinition() {
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
bf.registerBeanDefinition("abs", BeanDefinitionBuilder
.rootBeanDefinition(TestBean.class).setAbstract(true).getBeanDefinition());
- assertThat(bf.containsBean("abs"), is(true));
- assertThat(bf.containsBean("bogus"), is(false));
+ assertThat(bf.containsBean("abs"), equalTo(true));
+ assertThat(bf.containsBean("bogus"), equalTo(false));
}
@Test
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java
index f06388cc8d7c..4c6725e01ecb 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java
@@ -16,9 +16,6 @@
package org.springframework.beans.factory.config;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-
import java.util.HashMap;
import java.util.Map;
@@ -26,6 +23,9 @@
import org.junit.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for {@link CustomScopeConfigurer}.
*
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java
index dc56161776db..a41a5c97bb73 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java
@@ -16,14 +16,6 @@
package org.springframework.beans.factory.config;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.springframework.tests.TestResourceUtils.qualifiedResource;
-
import java.util.Date;
import javax.inject.Provider;
@@ -38,6 +30,10 @@
import org.springframework.core.io.Resource;
import org.springframework.util.SerializationTestUtils;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+import static org.springframework.tests.TestResourceUtils.*;
+
/**
* @author Colin Sampaleanu
* @author Juergen Hoeller
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java
index f7ab438e7659..ae7c2b845198 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,10 +16,6 @@
package org.springframework.beans.factory.config;
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.mock;
-import static org.springframework.beans.factory.support.BeanDefinitionBuilder.genericBeanDefinition;
-
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -30,6 +26,10 @@
import org.springframework.core.NestedCheckedException;
import org.springframework.core.NestedRuntimeException;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+import static org.springframework.beans.factory.support.BeanDefinitionBuilder.*;
+
/**
* Unit tests for {@link ServiceLocatorFactoryBean}.
*
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java
index 622b7fda5d38..af6ec0c484fb 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/parsing/FailFastProblemReporterTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,15 +16,13 @@
package org.springframework.beans.factory.parsing;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import org.apache.commons.logging.Log;
import org.junit.Test;
import org.springframework.core.io.DescriptiveResource;
+import static org.mockito.Matchers.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
* @author Juergen Hoeller
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/wiring/BeanConfigurerSupportTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/wiring/BeanConfigurerSupportTests.java
index 625e8c7085e7..7b039cc66083 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/wiring/BeanConfigurerSupportTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/wiring/BeanConfigurerSupportTests.java
@@ -16,9 +16,6 @@
package org.springframework.beans.factory.wiring;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
import junit.framework.TestCase;
import org.springframework.beans.factory.BeanFactory;
@@ -26,6 +23,8 @@
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.tests.sample.beans.TestBean;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
diff --git a/spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java b/spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java
index ca55ed9a0e19..04d7bda02f3f 100644
--- a/spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java
+++ b/spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java
@@ -16,15 +16,6 @@
package org.springframework.scheduling.quartz;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
@@ -52,19 +43,22 @@
import org.quartz.TriggerListener;
import org.quartz.impl.SchedulerRepository;
import org.quartz.spi.JobFactory;
-import org.springframework.tests.context.TestMethodInvokingTask;
-import org.springframework.tests.sample.beans.TestBean;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.support.StaticListableBeanFactory;
-import org.springframework.tests.Assume;
-import org.springframework.tests.TestGroup;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.core.io.FileSystemResourceLoader;
import org.springframework.core.task.TaskExecutor;
import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.tests.Assume;
+import org.springframework.tests.TestGroup;
+import org.springframework.tests.context.TestMethodInvokingTask;
+import org.springframework.tests.sample.beans.TestBean;
+
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.java
index 364d5415920c..b078e3c0048e 100644
--- a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.java
+++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterAdviceBindingTests.java
@@ -16,18 +16,17 @@
package org.springframework.aop.aspectj;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.aspectj.AdviceBindingTestAspect.AdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
/**
* Tests for various parameter binding scenarios with before advice.
diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java
index c04a54f8e646..3d6f902d3425 100644
--- a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java
+++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java
@@ -16,19 +16,17 @@
package org.springframework.aop.aspectj;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
-
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.aspectj.AfterReturningAdviceBindingTestAspect.AfterReturningAdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
/**
* Tests for various parameter binding scenarios with before advice.
diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.java
index 076050792495..c98aea5211d1 100644
--- a/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.java
+++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AfterThrowingAdviceBindingTests.java
@@ -16,14 +16,13 @@
package org.springframework.aop.aspectj;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.aspectj.AfterThrowingAdviceBindingTestAspect.AfterThrowingAdviceBindingCollaborator;
-import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.tests.sample.beans.ITestBean;
+
+import static org.mockito.BDDMockito.*;
/**
* Tests for various parameter binding scenarios with before advice.
diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.java
index 879e846b2bdc..0d9911560e64 100644
--- a/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.java
+++ b/spring-context/src/test/java/org/springframework/aop/aspectj/AroundAdviceBindingTests.java
@@ -16,20 +16,19 @@
package org.springframework.aop.aspectj;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import org.aspectj.lang.ProceedingJoinPoint;
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.aspectj.AroundAdviceBindingTestAspect.AroundAdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
-import org.springframework.tests.sample.beans.ITestBean;
-import org.springframework.tests.sample.beans.TestBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.tests.sample.beans.ITestBean;
+import org.springframework.tests.sample.beans.TestBean;
+
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
/**
* Tests for various parameter binding scenarios with before advice.
diff --git a/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java b/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java
index 94e6e43f8abc..c313c6f33932 100644
--- a/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java
+++ b/spring-context/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java
@@ -16,18 +16,17 @@
package org.springframework.aop.aspectj;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.aspectj.AdviceBindingTestAspect.AdviceBindingCollaborator;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
/**
* Tests for various parameter binding scenarios with before advice.
diff --git a/spring-context/src/test/java/org/springframework/aop/config/MethodLocatingFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/aop/config/MethodLocatingFactoryBeanTests.java
index 753fb3341a75..7959a45b08a8 100644
--- a/spring-context/src/test/java/org/springframework/aop/config/MethodLocatingFactoryBeanTests.java
+++ b/spring-context/src/test/java/org/springframework/aop/config/MethodLocatingFactoryBeanTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,19 +16,15 @@
package org.springframework.aop.config;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.lang.reflect.Method;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
* @author Chris Beams
diff --git a/spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java b/spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java
index 77101f6cc902..562ab9bf3287 100644
--- a/spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java
+++ b/spring-context/src/test/java/org/springframework/aop/framework/JdkDynamicProxyTests.java
@@ -16,21 +16,19 @@
package org.springframework.aop.framework;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import java.io.Serializable;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
-
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
import org.springframework.aop.support.AopUtils;
import org.springframework.tests.sample.beans.IOther;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @since 13.03.2003
* @author Rod Johnson
diff --git a/spring-context/src/test/java/org/springframework/context/access/ContextBeanFactoryReferenceTests.java b/spring-context/src/test/java/org/springframework/context/access/ContextBeanFactoryReferenceTests.java
index 33bdac26e819..f9aefe64da1c 100644
--- a/spring-context/src/test/java/org/springframework/context/access/ContextBeanFactoryReferenceTests.java
+++ b/spring-context/src/test/java/org/springframework/context/access/ContextBeanFactoryReferenceTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,13 +16,12 @@
package org.springframework.context.access;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit test for {@link ContextBeanFactoryReference}
*
diff --git a/spring-context/src/test/java/org/springframework/context/annotation/EnableLoadTimeWeavingTests.java b/spring-context/src/test/java/org/springframework/context/annotation/EnableLoadTimeWeavingTests.java
index 9a3ced52d704..a8b40b2ac33f 100644
--- a/spring-context/src/test/java/org/springframework/context/annotation/EnableLoadTimeWeavingTests.java
+++ b/spring-context/src/test/java/org/springframework/context/annotation/EnableLoadTimeWeavingTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,11 +16,6 @@
package org.springframework.context.annotation;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
-
import java.lang.instrument.ClassFileTransformer;
import org.junit.Test;
@@ -28,6 +23,9 @@
import org.springframework.context.support.GenericXmlApplicationContext;
import org.springframework.instrument.classloading.LoadTimeWeaver;
+import static org.mockito.Matchers.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for @EnableLoadTimeWeaving
*
diff --git a/spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java b/spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java
index d124bac83066..24c1a4da95a2 100644
--- a/spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java
+++ b/spring-context/src/test/java/org/springframework/context/event/ApplicationContextEventTests.java
@@ -20,16 +20,8 @@
import java.util.Set;
import org.aopalliance.intercept.MethodInvocation;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import org.junit.Test;
-
import org.springframework.aop.framework.ProxyFactory;
-import org.springframework.tests.sample.beans.TestBean;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.ApplicationContext;
@@ -39,6 +31,10 @@
import org.springframework.context.BeanThatListens;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.core.Ordered;
+import org.springframework.tests.sample.beans.TestBean;
+
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
/**
* Unit and integration tests for the ApplicationContext event support.
diff --git a/spring-context/src/test/java/org/springframework/context/event/EventPublicationInterceptorTests.java b/spring-context/src/test/java/org/springframework/context/event/EventPublicationInterceptorTests.java
index 1a0e064b757f..128abf301dc6 100644
--- a/spring-context/src/test/java/org/springframework/context/event/EventPublicationInterceptorTests.java
+++ b/spring-context/src/test/java/org/springframework/context/event/EventPublicationInterceptorTests.java
@@ -16,21 +16,21 @@
package org.springframework.context.event;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.beans.BeansException;
-import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.beans.MutablePropertyValues;
-import org.springframework.tests.sample.beans.TestBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.TestListener;
import org.springframework.context.support.StaticApplicationContext;
+import org.springframework.tests.sample.beans.ITestBean;
+import org.springframework.tests.sample.beans.TestBean;
+
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
/**
* @author Dmitriy Kopylenko
diff --git a/spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java b/spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
index b8206b21a28f..a87d56eb9bd7 100644
--- a/spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
+++ b/spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,11 +16,6 @@
package org.springframework.ejb.access;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import javax.ejb.CreateException;
import javax.ejb.EJBLocalHome;
import javax.ejb.EJBLocalObject;
@@ -31,6 +26,9 @@
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.jndi.JndiTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Juergen Hoeller
diff --git a/spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java
index c0a78215bd67..d10dce2a5ac7 100644
--- a/spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java
+++ b/spring-context/src/test/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBeanTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,12 +16,6 @@
package org.springframework.ejb.access;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
-
import java.lang.reflect.Proxy;
import javax.ejb.CreateException;
@@ -32,6 +26,9 @@
import org.junit.Test;
import org.springframework.jndi.JndiTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Juergen Hoeller
diff --git a/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java b/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java
index 0c03c57c69db..0191220b1bf3 100644
--- a/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java
+++ b/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java
@@ -16,12 +16,6 @@
package org.springframework.ejb.access;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.rmi.ConnectException;
import java.rmi.RemoteException;
@@ -36,6 +30,9 @@
import org.springframework.jndi.JndiTemplate;
import org.springframework.remoting.RemoteAccessException;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Juergen Hoeller
diff --git a/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java
index 8e03115c1f30..68af4a9b06db 100644
--- a/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java
+++ b/spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBeanTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,12 +16,6 @@
package org.springframework.ejb.access;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
-
import java.lang.reflect.Proxy;
import java.rmi.RemoteException;
@@ -34,6 +28,9 @@
import org.springframework.jndi.JndiTemplate;
import org.springframework.remoting.RemoteAccessException;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Juergen Hoeller
diff --git a/spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java b/spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java
index 4ad2255d2c49..d9d7e60ac6b5 100644
--- a/spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java
+++ b/spring-context/src/test/java/org/springframework/jndi/JndiObjectFactoryBeanTests.java
@@ -16,12 +16,6 @@
package org.springframework.jndi;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import javax.naming.Context;
import javax.naming.NamingException;
@@ -31,6 +25,9 @@
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Juergen Hoeller
diff --git a/spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java b/spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java
index 401880247598..ef73a867f189 100644
--- a/spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java
+++ b/spring-context/src/test/java/org/springframework/jndi/JndiTemplateTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,16 +16,14 @@
package org.springframework.jndi;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import javax.naming.Context;
import javax.naming.NameNotFoundException;
import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Juergen Hoeller
diff --git a/spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java b/spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java
index 05601840108e..93b33b48bc99 100644
--- a/spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java
+++ b/spring-context/src/test/java/org/springframework/scripting/bsh/BshScriptFactoryTests.java
@@ -16,9 +16,6 @@
package org.springframework.scripting.bsh;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import java.util.Arrays;
import java.util.Collection;
@@ -26,7 +23,6 @@
import org.springframework.aop.support.AopUtils;
import org.springframework.aop.target.dynamic.Refreshable;
-import org.springframework.tests.sample.beans.TestBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -38,6 +34,9 @@
import org.springframework.scripting.ScriptSource;
import org.springframework.scripting.TestBeanAwareMessenger;
import org.springframework.scripting.support.ScriptFactoryPostProcessor;
+import org.springframework.tests.sample.beans.TestBean;
+
+import static org.mockito.BDDMockito.*;
/**
* @author Rob Harrop
diff --git a/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java b/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java
index cca1625d3dfe..7ced7671ce37 100644
--- a/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java
+++ b/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java
@@ -16,16 +16,16 @@
package org.springframework.scripting.groovy;
+import groovy.lang.DelegatingMetaClass;
+import groovy.lang.GroovyObject;
+
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Map;
-import groovy.lang.DelegatingMetaClass;
-import groovy.lang.GroovyObject;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
-
import org.springframework.aop.support.AopUtils;
import org.springframework.aop.target.dynamic.Refreshable;
import org.springframework.beans.factory.BeanCreationException;
@@ -52,7 +52,6 @@
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
-import static org.mockito.Mockito.mock;
/**
* @author Rob Harrop
diff --git a/spring-context/src/test/java/org/springframework/scripting/support/RefreshableScriptTargetSourceTests.java b/spring-context/src/test/java/org/springframework/scripting/support/RefreshableScriptTargetSourceTests.java
index 5a5b72715c56..a443bee0bb43 100644
--- a/spring-context/src/test/java/org/springframework/scripting/support/RefreshableScriptTargetSourceTests.java
+++ b/spring-context/src/test/java/org/springframework/scripting/support/RefreshableScriptTargetSourceTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,11 +16,12 @@
package org.springframework.scripting.support;
-import static org.mockito.Mockito.mock;
import junit.framework.TestCase;
import org.springframework.beans.factory.BeanFactory;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
*/
diff --git a/spring-context/src/test/java/org/springframework/scripting/support/ResourceScriptSourceTests.java b/spring-context/src/test/java/org/springframework/scripting/support/ResourceScriptSourceTests.java
index e1fe7c848e06..08c9353bb923 100644
--- a/spring-context/src/test/java/org/springframework/scripting/support/ResourceScriptSourceTests.java
+++ b/spring-context/src/test/java/org/springframework/scripting/support/ResourceScriptSourceTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,9 +16,6 @@
package org.springframework.scripting.support;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -27,6 +24,8 @@
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.Resource;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
* @author Juergen Hoeller
diff --git a/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java b/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java
index d561ac7e7eb7..680bbe65d259 100644
--- a/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java
+++ b/spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java
@@ -16,11 +16,8 @@
package org.springframework.scripting.support;
-import static org.mockito.Mockito.mock;
-
import org.junit.Before;
import org.junit.Test;
-
import org.springframework.beans.FatalBeanException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.BeanDefinition;
@@ -34,6 +31,7 @@
import org.springframework.tests.TestGroup;
import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
/**
* @author Rick Evans
diff --git a/spring-core/src/test/java/org/springframework/util/StreamUtilsTests.java b/spring-core/src/test/java/org/springframework/util/StreamUtilsTests.java
index fe10d2359673..61810c98ec64 100644
--- a/spring-core/src/test/java/org/springframework/util/StreamUtilsTests.java
+++ b/spring-core/src/test/java/org/springframework/util/StreamUtilsTests.java
@@ -16,14 +16,6 @@
package org.springframework.util;
-import static org.hamcrest.Matchers.equalTo;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
@@ -36,6 +28,10 @@
import org.junit.Test;
import org.mockito.InOrder;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Tests for {@link StreamUtils}.
*
diff --git a/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxXMLReaderTestCase.java b/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxXMLReaderTestCase.java
index 0c3b9f0e49de..3ced43ba0ce9 100644
--- a/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxXMLReaderTestCase.java
+++ b/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxXMLReaderTestCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,12 +16,6 @@
package org.springframework.util.xml;
-import static org.mockito.BDDMockito.willAnswer;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-
import java.io.InputStream;
import javax.xml.stream.XMLInputFactory;
@@ -44,6 +38,8 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.XMLReaderFactory;
+import static org.mockito.BDDMockito.*;
+
public abstract class AbstractStaxXMLReaderTestCase {
protected static XMLInputFactory inputFactory;
diff --git a/spring-core/src/test/java/org/springframework/util/xml/StaxEventXMLReaderTests.java b/spring-core/src/test/java/org/springframework/util/xml/StaxEventXMLReaderTests.java
index 5a34a003ee25..355cb94438b4 100644
--- a/spring-core/src/test/java/org/springframework/util/xml/StaxEventXMLReaderTests.java
+++ b/spring-core/src/test/java/org/springframework/util/xml/StaxEventXMLReaderTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,11 +16,9 @@
package org.springframework.util.xml;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.InputStream;
import java.io.StringReader;
+
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
@@ -29,6 +27,8 @@
import org.xml.sax.InputSource;
import org.xml.sax.helpers.AttributesImpl;
+import static org.mockito.BDDMockito.*;
+
public class StaxEventXMLReaderTests extends AbstractStaxXMLReaderTestCase {
public static final String CONTENT = "";
diff --git a/spring-core/src/test/java/org/springframework/util/xml/StaxStreamXMLReaderTests.java b/spring-core/src/test/java/org/springframework/util/xml/StaxStreamXMLReaderTests.java
index ba84eadd760f..e074085f6d7b 100644
--- a/spring-core/src/test/java/org/springframework/util/xml/StaxStreamXMLReaderTests.java
+++ b/spring-core/src/test/java/org/springframework/util/xml/StaxStreamXMLReaderTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -18,23 +18,22 @@
import java.io.InputStream;
import java.io.StringReader;
+
import javax.xml.namespace.QName;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import org.junit.Test;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.*;
+import static org.mockito.BDDMockito.*;
+
public class StaxStreamXMLReaderTests extends AbstractStaxXMLReaderTestCase {
public static final String CONTENT = "";
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java
index 98016c611349..e6e2121c8d1c 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/AbstractRowMapperTests.java
@@ -16,12 +16,6 @@
package org.springframework.jdbc.core;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.ResultSet;
@@ -35,6 +29,9 @@
import org.springframework.jdbc.datasource.SingleConnectionDataSource;
import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Mock object based abstract class for RowMapper tests.
* Initializes mock objects and verifies results.
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateQueryTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateQueryTests.java
index 86518a5f8769..f9963c11233f 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateQueryTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateQueryTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,14 +16,6 @@
package org.springframework.jdbc.core;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Connection;
@@ -43,6 +35,9 @@
import org.junit.rules.ExpectedException;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java
index 3c4e1bc73ae6..ffa2d74ddfcf 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,26 +16,6 @@
package org.springframework.jdbc.core;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.hamcrest.Matchers.sameInstance;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.atLeastOnce;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.springframework.tests.Matchers.exceptionCause;
-
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
@@ -71,6 +51,11 @@
import org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter;
import org.springframework.util.LinkedCaseInsensitiveMap;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+import static org.springframework.tests.Matchers.*;
+
/**
* Mock object based tests for JdbcTemplate.
*
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/RowMapperTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/RowMapperTests.java
index 60a4b4b3499b..a44686f3a617 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/RowMapperTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/RowMapperTests.java
@@ -16,11 +16,6 @@
package org.springframework.jdbc.core;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -34,9 +29,11 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.springframework.tests.sample.beans.TestBean;
import org.springframework.jdbc.datasource.SingleConnectionDataSource;
import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator;
+import org.springframework.tests.sample.beans.TestBean;
+
+import static org.mockito.BDDMockito.*;
/**
* @author Juergen Hoeller
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/StatementCreatorUtilsTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/StatementCreatorUtilsTests.java
index 00e229ba9dc6..694c3c65fad6 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/StatementCreatorUtilsTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/StatementCreatorUtilsTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,10 +16,6 @@
package org.springframework.jdbc.core;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
@@ -30,6 +26,8 @@
import org.junit.Before;
import org.junit.Test;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 31.08.2004
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java
index c17c8bbc02d9..a8c27275e817 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java
@@ -27,13 +27,13 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.Customer;
import org.springframework.jdbc.core.JdbcOperations;
@@ -46,11 +46,6 @@
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.atLeastOnce;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
/**
* @author Rick Evans
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterQueryTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterQueryTests.java
index 80c7a07f2e2f..73e9b46ff59f 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterQueryTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterQueryTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,13 +16,6 @@
package org.springframework.jdbc.core.namedparam;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -42,6 +35,9 @@
import org.junit.Test;
import org.springframework.jdbc.core.RowMapper;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Thomas Risberg
* @author Phillip Webb
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/CallMetaDataContextTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/CallMetaDataContextTests.java
index 0b09e04dc3f6..22498510c746 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/CallMetaDataContextTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/CallMetaDataContextTests.java
@@ -1,11 +1,5 @@
package org.springframework.jdbc.core.simple;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.Types;
@@ -24,6 +18,9 @@
import org.springframework.jdbc.core.metadata.CallMetaDataContext;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Mock object based tests for CallMetaDataContext.
*
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java
index 9779c29d65da..0559f34b8c84 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,14 +16,6 @@
package org.springframework.jdbc.core.simple;
-import static org.hamcrest.Matchers.sameInstance;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.atLeastOnce;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.springframework.tests.Matchers.exceptionCause;
-
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
@@ -43,6 +35,11 @@
import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+import static org.springframework.tests.Matchers.*;
+
/**
* Mock object based tests for SimpleJdbcCall.
*
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertTests.java
index 85b6263e47fa..9d76aeebd49a 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,10 +16,6 @@
package org.springframework.jdbc.core.simple;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
@@ -34,6 +30,8 @@
import org.junit.rules.ExpectedException;
import org.springframework.dao.InvalidDataAccessApiUsageException;
+import static org.mockito.BDDMockito.*;
+
/**
* Mock object based tests for SimpleJdbcInsert.
*
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcTemplateTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcTemplateTests.java
index 05f289076ba6..8c5a2024df0e 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcTemplateTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcTemplateTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,15 +16,6 @@
package org.springframework.jdbc.core.simple;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
@@ -48,6 +39,9 @@
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Rob Harrop
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/TableMetaDataContextTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/TableMetaDataContextTests.java
index 34572961a808..968883fd6a28 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/TableMetaDataContextTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/TableMetaDataContextTests.java
@@ -16,12 +16,6 @@
package org.springframework.jdbc.core.simple;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.atLeastOnce;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
@@ -38,6 +32,9 @@
import org.springframework.jdbc.core.metadata.TableMetaDataContext;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Mock object based tests for TableMetaDataContext.
*
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcBeanDefinitionReaderTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcBeanDefinitionReaderTests.java
index 664c2ff24b14..6e5779c26a40 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcBeanDefinitionReaderTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcBeanDefinitionReaderTests.java
@@ -16,11 +16,6 @@
package org.springframework.jdbc.core.support;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
@@ -28,8 +23,11 @@
import javax.sql.DataSource;
import org.junit.Test;
-import org.springframework.tests.sample.beans.TestBean;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.tests.sample.beans.TestBean;
+
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
/**
* @author Rod Johnson
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcDaoSupportTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcDaoSupportTests.java
index 1aefee1e9464..45e11b3c2522 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcDaoSupportTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/JdbcDaoSupportTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,9 +16,6 @@
package org.springframework.jdbc.core.support;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-
import java.util.ArrayList;
import java.util.List;
@@ -27,6 +24,9 @@
import org.junit.Test;
import org.springframework.jdbc.core.JdbcTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 30.07.2003
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/LobSupportTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/LobSupportTests.java
index feba295516b3..a243d59ba42a 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/LobSupportTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/LobSupportTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,12 +16,6 @@
package org.springframework.jdbc.core.support;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -36,6 +30,9 @@
import org.springframework.jdbc.support.lob.LobCreator;
import org.springframework.jdbc.support.lob.LobHandler;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Alef Arendsen
*/
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/SqlLobValueTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/SqlLobValueTests.java
index 8a7cc6454695..d0003d4f56f4 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/SqlLobValueTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/support/SqlLobValueTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -15,14 +15,6 @@
*/
package org.springframework.jdbc.core.support;
-import static org.hamcrest.Matchers.equalTo;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -40,6 +32,10 @@
import org.springframework.jdbc.support.lob.LobCreator;
import org.springframework.jdbc.support.lob.LobHandler;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Test cases for the sql lob value:
*
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceJtaTransactionTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceJtaTransactionTests.java
index 3d6d4d4d1770..4563a2b197ec 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceJtaTransactionTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceJtaTransactionTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,19 +16,6 @@
package org.springframework.jdbc.datasource;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Mockito.atLeastOnce;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
@@ -59,6 +46,9 @@
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.support.TransactionTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 17.10.2005
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java
index c02dcbf02de8..3c29aa3ae89c 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java
@@ -16,14 +16,6 @@
package org.springframework.jdbc.datasource;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
@@ -55,6 +47,9 @@
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.support.TransactionTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 04.07.2003
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DelegatingDataSourceTest.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DelegatingDataSourceTest.java
index de22e56058e6..05295b56dde3 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DelegatingDataSourceTest.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DelegatingDataSourceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,12 +16,6 @@
package org.springframework.jdbc.datasource;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
import java.sql.Connection;
@@ -31,6 +25,10 @@
import org.junit.Before;
import org.junit.Test;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Tests for {@link DelegatingDataSource}.
*
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DriverManagerDataSourceTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DriverManagerDataSourceTests.java
index ec33bdeaf1e5..d4c1be90262c 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DriverManagerDataSourceTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DriverManagerDataSourceTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,14 +16,14 @@
package org.springframework.jdbc.datasource;
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.mock;
-
import java.sql.Connection;
import java.util.Properties;
import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
*/
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapterTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapterTests.java
index 221a9e59fbcd..0a9f8b7df18c 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapterTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/UserCredentialsDataSourceAdapterTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,10 +16,6 @@
package org.springframework.jdbc.datasource;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import java.sql.Connection;
import java.sql.SQLException;
@@ -27,6 +23,9 @@
import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 28.05.2004
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/DatabasePopulatorTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/DatabasePopulatorTests.java
index 2e5c67d0f2b9..64f09cc77cc9 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/DatabasePopulatorTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/init/DatabasePopulatorTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,10 +16,6 @@
package org.springframework.jdbc.datasource.init;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.SQLException;
@@ -32,6 +28,9 @@
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Dave Syer
* @author Sam Brannen
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/BeanFactoryDataSourceLookupTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/BeanFactoryDataSourceLookupTests.java
index 1ad38f1457c0..ec2e2b4d0d7b 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/BeanFactoryDataSourceLookupTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/BeanFactoryDataSourceLookupTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,18 +16,15 @@
package org.springframework.jdbc.datasource.lookup;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import javax.sql.DataSource;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanNotOfRequiredTypeException;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
* @author Juergen Hoeller
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/object/BatchSqlUpdateTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/object/BatchSqlUpdateTests.java
index f325d4891f3c..e0352b941c82 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/object/BatchSqlUpdateTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/object/BatchSqlUpdateTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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
@@ -16,13 +16,6 @@
package org.springframework.jdbc.object;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
@@ -33,6 +26,9 @@
import org.junit.Test;
import org.springframework.jdbc.core.SqlParameter;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 22.02.2005
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericSqlQueryTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericSqlQueryTests.java
index 6f17fc2044ec..b43b68957255 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericSqlQueryTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericSqlQueryTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -17,11 +17,6 @@
package org.springframework.jdbc.object;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -43,6 +38,9 @@
import org.springframework.jdbc.Customer;
import org.springframework.jdbc.datasource.TestDataSourceWrapper;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Thomas Risberg
*/
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericStoredProcedureTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericStoredProcedureTests.java
index 4a5c78738250..c7260f2bd3d7 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericStoredProcedureTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/object/GenericStoredProcedureTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,11 +16,6 @@
package org.springframework.jdbc.object;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Types;
@@ -37,6 +32,9 @@
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.TestDataSourceWrapper;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Thomas Risberg
*/
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java
index 10a2248c374a..3dc5c36d89b9 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,18 +16,6 @@
package org.springframework.jdbc.object;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -51,6 +39,10 @@
import org.springframework.jdbc.Customer;
import org.springframework.jdbc.core.SqlParameter;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Trevor Cook
* @author Thomas Risberg
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java
index c57e430f67b2..718f085b29e5 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,11 +16,6 @@
package org.springframework.jdbc.object;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -42,6 +37,9 @@
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Trevor Cook
* @author Thomas Risberg
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/object/StoredProcedureTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/object/StoredProcedureTests.java
index 6d2ce8106fe5..d31f74315725 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/object/StoredProcedureTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/object/StoredProcedureTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,17 +16,6 @@
package org.springframework.jdbc.object;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Matchers.startsWith;
-import static org.mockito.Mockito.atLeastOnce;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-
import java.math.BigDecimal;
import java.sql.CallableStatement;
import java.sql.Connection;
@@ -62,6 +51,9 @@
import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Thomas Risberg
* @author Trevor Cook
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/DataFieldMaxValueIncrementerTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/support/DataFieldMaxValueIncrementerTests.java
index 6d23a8e8284e..b1e021d2e3f5 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/DataFieldMaxValueIncrementerTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/support/DataFieldMaxValueIncrementerTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,12 +16,6 @@
package org.springframework.jdbc.support;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -35,6 +29,9 @@
import org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer;
import org.springframework.jdbc.support.incrementer.PostgreSQLSequenceMaxValueIncrementer;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 27.02.2004
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/DefaultLobHandlerTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/support/DefaultLobHandlerTests.java
index 14e4d5bf682b..1426ade1044a 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/DefaultLobHandlerTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/support/DefaultLobHandlerTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,9 +16,6 @@
package org.springframework.jdbc.support;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -33,6 +30,8 @@
import org.springframework.jdbc.support.lob.LobCreator;
import org.springframework.jdbc.support.lob.LobHandler;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 17.12.2003
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/NativeJdbcExtractorTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/support/NativeJdbcExtractorTests.java
index f99ae954ddee..d70991e608d1 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/NativeJdbcExtractorTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/support/NativeJdbcExtractorTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,10 +16,6 @@
package org.springframework.jdbc.support;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
@@ -32,6 +28,9 @@
import org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor;
import org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Andre Biryukov
* @author Juergen Hoeller
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java
index e118d922ff8a..944b77c5dc02 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,16 +16,6 @@
package org.springframework.jdbc.support;
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
@@ -37,6 +27,10 @@
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Tests for SQLErrorCodes loading.
*
diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/rowset/ResultSetWrappingRowSetTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/support/rowset/ResultSetWrappingRowSetTests.java
index 0594fec1cb4a..27e1d96fb773 100644
--- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/rowset/ResultSetWrappingRowSetTests.java
+++ b/spring-jdbc/src/test/java/org/springframework/jdbc/support/rowset/ResultSetWrappingRowSetTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,11 +16,6 @@
package org.springframework.jdbc.support.rowset;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.math.BigDecimal;
@@ -34,6 +29,9 @@
import org.junit.Test;
import org.springframework.jdbc.InvalidResultSetAccessException;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Thomas Risberg
*/
diff --git a/spring-jms/src/test/java/org/springframework/jms/config/JmsNamespaceHandlerTests.java b/spring-jms/src/test/java/org/springframework/jms/config/JmsNamespaceHandlerTests.java
index a8c89b525e87..fd7dbf89390b 100644
--- a/spring-jms/src/test/java/org/springframework/jms/config/JmsNamespaceHandlerTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/config/JmsNamespaceHandlerTests.java
@@ -16,14 +16,6 @@
package org.springframework.jms.config;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
@@ -53,6 +45,9 @@
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.ErrorHandler;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Mark Fisher
* @author Juergen Hoeller
diff --git a/spring-jms/src/test/java/org/springframework/jms/connection/JmsTransactionManagerTests.java b/spring-jms/src/test/java/org/springframework/jms/connection/JmsTransactionManagerTests.java
index cd53ab37a313..77353d24dab2 100644
--- a/spring-jms/src/test/java/org/springframework/jms/connection/JmsTransactionManagerTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/connection/JmsTransactionManagerTests.java
@@ -16,14 +16,6 @@
package org.springframework.jms.connection;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
@@ -53,6 +45,9 @@
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.support.TransactionTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 26.07.2004
diff --git a/spring-jms/src/test/java/org/springframework/jms/connection/SingleConnectionFactoryTests.java b/spring-jms/src/test/java/org/springframework/jms/connection/SingleConnectionFactoryTests.java
index a1a40d51e44b..3f323ec8b151 100644
--- a/spring-jms/src/test/java/org/springframework/jms/connection/SingleConnectionFactoryTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/connection/SingleConnectionFactoryTests.java
@@ -16,14 +16,6 @@
package org.springframework.jms.connection;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.ExceptionListener;
@@ -38,6 +30,9 @@
import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 26.07.2004
diff --git a/spring-jms/src/test/java/org/springframework/jms/core/JmsTemplate102Tests.java b/spring-jms/src/test/java/org/springframework/jms/core/JmsTemplate102Tests.java
index cbf03b7abaf2..6b9e83581ed0 100644
--- a/spring-jms/src/test/java/org/springframework/jms/core/JmsTemplate102Tests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/core/JmsTemplate102Tests.java
@@ -16,15 +16,6 @@
package org.springframework.jms.core;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.verify;
-
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
@@ -67,6 +58,9 @@
import org.springframework.jms.support.destination.JndiDestinationResolver;
import org.springframework.jndi.JndiTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for the JmsTemplate implemented using JMS 1.0.2.
*
diff --git a/spring-jms/src/test/java/org/springframework/jms/core/JmsTemplateTests.java b/spring-jms/src/test/java/org/springframework/jms/core/JmsTemplateTests.java
index 1ac040f3f86d..937220108050 100644
--- a/spring-jms/src/test/java/org/springframework/jms/core/JmsTemplateTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/core/JmsTemplateTests.java
@@ -16,16 +16,6 @@
package org.springframework.jms.core;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.verify;
-
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
@@ -68,6 +58,9 @@
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for the JmsTemplate implemented using JMS 1.1.
*
diff --git a/spring-jms/src/test/java/org/springframework/jms/core/support/JmsGatewaySupportTests.java b/spring-jms/src/test/java/org/springframework/jms/core/support/JmsGatewaySupportTests.java
index 15eefc873f75..570a7abc87a1 100644
--- a/spring-jms/src/test/java/org/springframework/jms/core/support/JmsGatewaySupportTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/core/support/JmsGatewaySupportTests.java
@@ -15,9 +15,6 @@
*/
package org.springframework.jms.core.support;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-
import java.util.ArrayList;
import java.util.List;
@@ -26,6 +23,9 @@
import org.junit.Test;
import org.springframework.jms.core.JmsTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Mark Pollack
* @since 24.9.2004
diff --git a/spring-jms/src/test/java/org/springframework/jms/listener/SimpleMessageListenerContainerTests.java b/spring-jms/src/test/java/org/springframework/jms/listener/SimpleMessageListenerContainerTests.java
index 8dad2a08e037..2dda59ceb137 100644
--- a/spring-jms/src/test/java/org/springframework/jms/listener/SimpleMessageListenerContainerTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/listener/SimpleMessageListenerContainerTests.java
@@ -16,15 +16,6 @@
package org.springframework.jms.listener;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.util.HashSet;
import javax.jms.Connection;
@@ -43,6 +34,9 @@
import org.springframework.jms.StubQueue;
import org.springframework.util.ErrorHandler;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
* @author Juergen Hoeller
diff --git a/spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapter102Tests.java b/spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapter102Tests.java
index 0781e2916d95..1d633b4e5f46 100644
--- a/spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapter102Tests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapter102Tests.java
@@ -16,13 +16,6 @@
package org.springframework.jms.listener.adapter;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayInputStream;
import javax.jms.BytesMessage;
@@ -42,6 +35,9 @@
import org.mockito.stubbing.Answer;
import org.springframework.jms.support.converter.SimpleMessageConverter102;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for the {@link MessageListenerAdapter102} class.
*
diff --git a/spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapterTests.java b/spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapterTests.java
index c673f51a4474..3fa9fe313a00 100644
--- a/spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapterTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/listener/adapter/MessageListenerAdapterTests.java
@@ -16,18 +16,6 @@
package org.springframework.jms.listener.adapter;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayInputStream;
import java.io.Serializable;
@@ -50,6 +38,9 @@
import org.springframework.jms.support.converter.MessageConversionException;
import org.springframework.jms.support.converter.SimpleMessageConverter;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
* @author Juergen Hoeller
diff --git a/spring-jms/src/test/java/org/springframework/jms/listener/endpoint/DefaultJmsActivationSpecFactoryTests.java b/spring-jms/src/test/java/org/springframework/jms/listener/endpoint/DefaultJmsActivationSpecFactoryTests.java
index ea98f9020678..1a78ba5f7918 100644
--- a/spring-jms/src/test/java/org/springframework/jms/listener/endpoint/DefaultJmsActivationSpecFactoryTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/listener/endpoint/DefaultJmsActivationSpecFactoryTests.java
@@ -16,9 +16,6 @@
package org.springframework.jms.listener.endpoint;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import javax.jms.Destination;
import javax.jms.Session;
@@ -28,6 +25,8 @@
import org.springframework.jms.StubQueue;
import org.springframework.jms.support.destination.DestinationResolver;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Agim Emruli
* @author Juergen Hoeller
diff --git a/spring-jms/src/test/java/org/springframework/jms/remoting/JmsInvokerTests.java b/spring-jms/src/test/java/org/springframework/jms/remoting/JmsInvokerTests.java
index 9cdbf3413686..4913da3e9026 100644
--- a/spring-jms/src/test/java/org/springframework/jms/remoting/JmsInvokerTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/remoting/JmsInvokerTests.java
@@ -16,12 +16,6 @@
package org.springframework.jms.remoting;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import java.io.Serializable;
import java.util.Arrays;
import java.util.Enumeration;
@@ -44,6 +38,9 @@
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
*/
diff --git a/spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverter102Tests.java b/spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverter102Tests.java
index 8ca5ad2e1f1a..153cf0dd7a92 100644
--- a/spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverter102Tests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverter102Tests.java
@@ -16,12 +16,6 @@
package org.springframework.jms.support;
-import static org.hamcrest.Matchers.equalTo;
-import static org.junit.Assert.assertThat;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-
import java.io.ByteArrayInputStream;
import java.util.Random;
@@ -35,6 +29,10 @@
import org.mockito.stubbing.Answer;
import org.springframework.jms.support.converter.SimpleMessageConverter102;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for the {@link SimpleMessageConverter102} class.
*
@@ -53,7 +51,7 @@ public void testByteArrayConversion102() throws JMSException {
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(content);
given(session.createBytesMessage()).willReturn(message);
- given(message.readBytes(any(byte[].class))).willAnswer(new Answer() {
+ given(message.readBytes((byte[]) anyObject())).willAnswer(new Answer() {
@Override
public Integer answer(InvocationOnMock invocation) throws Throwable {
return byteArrayInputStream.read((byte[])invocation.getArguments()[0]);
diff --git a/spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverterTests.java b/spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverterTests.java
index b903ff368686..3ea917f017c0 100644
--- a/spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverterTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/support/SimpleMessageConverterTests.java
@@ -16,14 +16,6 @@
package org.springframework.jms.support;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayInputStream;
import java.util.Collections;
import java.util.HashMap;
@@ -43,6 +35,9 @@
import org.springframework.jms.support.converter.MessageConversionException;
import org.springframework.jms.support.converter.SimpleMessageConverter;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for the {@link SimpleMessageConverter} class.
*
diff --git a/spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJackson2MessageConverterTests.java b/spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJackson2MessageConverterTests.java
index d2054d5bf2ce..bbb59cde21ec 100644
--- a/spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJackson2MessageConverterTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJackson2MessageConverterTests.java
@@ -16,13 +16,6 @@
package org.springframework.jms.support.converter;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayInputStream;
import java.util.Collections;
import java.util.Date;
@@ -38,6 +31,9 @@
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Arjen Poutsma
* @author Dave Syer
diff --git a/spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJacksonMessageConverterTests.java b/spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJacksonMessageConverterTests.java
index 0bce702aaad8..190d55cf5e7c 100644
--- a/spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJacksonMessageConverterTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJacksonMessageConverterTests.java
@@ -16,13 +16,6 @@
package org.springframework.jms.support.converter;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayInputStream;
import java.util.Collections;
import java.util.HashMap;
@@ -37,6 +30,9 @@
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Arjen Poutsma
* @author Dave Syer
diff --git a/spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java b/spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java
index 2f6a06199de1..65ed03ab2b25 100644
--- a/spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java
@@ -16,13 +16,6 @@
package org.springframework.jms.support.converter;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import javax.jms.BytesMessage;
import javax.jms.Session;
import javax.jms.TextMessage;
@@ -34,6 +27,9 @@
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Arjen Poutsma
*/
diff --git a/spring-jms/src/test/java/org/springframework/jms/support/destination/DynamicDestinationResolverTests.java b/spring-jms/src/test/java/org/springframework/jms/support/destination/DynamicDestinationResolverTests.java
index 504e247ee92d..aba6c9dee78f 100644
--- a/spring-jms/src/test/java/org/springframework/jms/support/destination/DynamicDestinationResolverTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/support/destination/DynamicDestinationResolverTests.java
@@ -16,9 +16,6 @@
package org.springframework.jms.support.destination;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Queue;
@@ -32,6 +29,8 @@
import org.springframework.jms.StubQueue;
import org.springframework.jms.StubTopic;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
*/
diff --git a/spring-jms/src/test/java/org/springframework/jms/support/destination/JmsDestinationAccessorTests.java b/spring-jms/src/test/java/org/springframework/jms/support/destination/JmsDestinationAccessorTests.java
index 2afd8e6f9c99..dd44cf3994be 100644
--- a/spring-jms/src/test/java/org/springframework/jms/support/destination/JmsDestinationAccessorTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/support/destination/JmsDestinationAccessorTests.java
@@ -16,14 +16,13 @@
package org.springframework.jms.support.destination;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.mock;
-
import javax.jms.ConnectionFactory;
import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
* @author Chris Beams
diff --git a/spring-jms/src/test/java/org/springframework/jms/support/destination/JndiDestinationResolverTests.java b/spring-jms/src/test/java/org/springframework/jms/support/destination/JndiDestinationResolverTests.java
index 548e0334d19e..9d54247d86a5 100644
--- a/spring-jms/src/test/java/org/springframework/jms/support/destination/JndiDestinationResolverTests.java
+++ b/spring-jms/src/test/java/org/springframework/jms/support/destination/JndiDestinationResolverTests.java
@@ -16,13 +16,6 @@
package org.springframework.jms.support.destination;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import javax.jms.Destination;
import javax.jms.Session;
import javax.naming.NamingException;
@@ -30,6 +23,9 @@
import org.junit.Test;
import org.springframework.jms.StubTopic;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rick Evans
* @author Chris Beams
diff --git a/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateInterceptorTests.java b/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateInterceptorTests.java
index 498005295ea0..16a7ed030cfb 100644
--- a/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateInterceptorTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateInterceptorTests.java
@@ -16,18 +16,6 @@
package org.springframework.orm.hibernate3;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.sql.SQLException;
import org.aopalliance.intercept.MethodInvocation;
@@ -46,6 +34,9 @@
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateJtaTransactionTests.java b/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateJtaTransactionTests.java
index 6f5ef6d62d2d..ff9c053d8191 100644
--- a/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateJtaTransactionTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateJtaTransactionTests.java
@@ -16,20 +16,6 @@
package org.springframework.orm.hibernate3;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willDoNothing;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Mockito.atLeastOnce;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.util.ArrayList;
import java.util.List;
@@ -62,6 +48,9 @@
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.support.TransactionTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateTemplateTests.java b/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateTemplateTests.java
index fd1ae832b38f..07fdf5e6b8e8 100644
--- a/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateTemplateTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateTemplateTests.java
@@ -16,20 +16,6 @@
package org.springframework.orm.hibernate3;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.same;
-import static org.mockito.Mockito.inOrder;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.verify;
-
import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.SQLException;
@@ -79,6 +65,9 @@
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/hibernate3/LocalSessionFactoryBeanTests.java b/spring-orm/src/test/java/org/springframework/orm/hibernate3/LocalSessionFactoryBeanTests.java
index 0b61d5916031..91972e57b093 100644
--- a/spring-orm/src/test/java/org/springframework/orm/hibernate3/LocalSessionFactoryBeanTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/hibernate3/LocalSessionFactoryBeanTests.java
@@ -16,13 +16,6 @@
package org.springframework.orm.hibernate3;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -63,6 +56,9 @@
import org.springframework.core.io.Resource;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/HibernateDaoSupportTests.java b/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/HibernateDaoSupportTests.java
index 8aa465e0e82f..85aa8db363ff 100644
--- a/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/HibernateDaoSupportTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/HibernateDaoSupportTests.java
@@ -16,9 +16,6 @@
package org.springframework.orm.hibernate3.support;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-
import java.util.ArrayList;
import java.util.List;
@@ -26,6 +23,9 @@
import org.junit.Test;
import org.springframework.orm.hibernate3.HibernateTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/LobTypeTests.java b/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/LobTypeTests.java
index ab82cbcf6382..f8b5d81194b8 100644
--- a/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/LobTypeTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/LobTypeTests.java
@@ -16,11 +16,6 @@
package org.springframework.orm.hibernate3.support;
-import static org.junit.Assert.*;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
@@ -48,6 +43,9 @@
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/OpenSessionInViewTests.java b/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/OpenSessionInViewTests.java
index a51fc633e9b0..0777c3ae11c2 100644
--- a/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/OpenSessionInViewTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/hibernate3/support/OpenSessionInViewTests.java
@@ -16,16 +16,6 @@
package org.springframework.orm.hibernate3.support;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.io.IOException;
import java.sql.Connection;
import java.util.concurrent.Callable;
@@ -64,6 +54,9 @@
import org.springframework.web.context.request.async.WebAsyncUtils;
import org.springframework.web.context.support.StaticWebApplicationContext;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
diff --git a/spring-orm/src/test/java/org/springframework/orm/ibatis/SqlMapClientTests.java b/spring-orm/src/test/java/org/springframework/orm/ibatis/SqlMapClientTests.java
index 91a7277e7832..802c0a2fa4c9 100644
--- a/spring-orm/src/test/java/org/springframework/orm/ibatis/SqlMapClientTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/ibatis/SqlMapClientTests.java
@@ -16,13 +16,6 @@
package org.springframework.orm.ibatis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
@@ -42,6 +35,9 @@
import com.ibatis.sqlmap.client.SqlMapSession;
import com.ibatis.sqlmap.client.event.RowHandler;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Alef Arendsen
diff --git a/spring-orm/src/test/java/org/springframework/orm/ibatis/support/LobTypeHandlerTests.java b/spring-orm/src/test/java/org/springframework/orm/ibatis/support/LobTypeHandlerTests.java
index 948c4e7ec26a..0eb1a5124389 100644
--- a/spring-orm/src/test/java/org/springframework/orm/ibatis/support/LobTypeHandlerTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/ibatis/support/LobTypeHandlerTests.java
@@ -16,13 +16,6 @@
package org.springframework.orm.ibatis.support;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
@@ -47,6 +40,9 @@
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jdo/JdoInterceptorTests.java b/spring-orm/src/test/java/org/springframework/orm/jdo/JdoInterceptorTests.java
index 1967c188d53e..0174445df2cf 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jdo/JdoInterceptorTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jdo/JdoInterceptorTests.java
@@ -16,11 +16,6 @@
package org.springframework.orm.jdo;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
@@ -33,6 +28,9 @@
import org.junit.Test;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jdo/JdoTemplateTests.java b/spring-orm/src/test/java/org/springframework/orm/jdo/JdoTemplateTests.java
index 29c882b2b638..de3c4d05fe32 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jdo/JdoTemplateTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jdo/JdoTemplateTests.java
@@ -16,13 +16,6 @@
package org.springframework.orm.jdo;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -41,12 +34,14 @@
import javax.jdo.PersistenceManagerFactory;
import javax.jdo.Query;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jdo/JdoTransactionManagerTests.java b/spring-orm/src/test/java/org/springframework/orm/jdo/JdoTransactionManagerTests.java
index 46003776b05a..f5fb828e49d3 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jdo/JdoTransactionManagerTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jdo/JdoTransactionManagerTests.java
@@ -23,6 +23,7 @@
import java.sql.Savepoint;
import java.util.ArrayList;
import java.util.List;
+
import javax.jdo.Constants;
import javax.jdo.JDOFatalDataStoreException;
import javax.jdo.PersistenceManager;
@@ -37,7 +38,6 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-
import org.springframework.jdbc.datasource.ConnectionHandle;
import org.springframework.jdbc.datasource.ConnectionHolder;
import org.springframework.jdbc.datasource.SimpleConnectionHandle;
@@ -56,9 +56,6 @@
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
/**
* @author Juergen Hoeller
diff --git a/spring-orm/src/test/java/org/springframework/orm/jdo/LocalPersistenceManagerFactoryTests.java b/spring-orm/src/test/java/org/springframework/orm/jdo/LocalPersistenceManagerFactoryTests.java
index 4b16a589caf5..8f4c921adfb6 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jdo/LocalPersistenceManagerFactoryTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jdo/LocalPersistenceManagerFactoryTests.java
@@ -16,11 +16,6 @@
package org.springframework.orm.jdo;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.mock;
-
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
@@ -31,6 +26,9 @@
import org.junit.Test;
import org.springframework.core.io.ClassPathResource;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jdo/support/JdoDaoSupportTests.java b/spring-orm/src/test/java/org/springframework/orm/jdo/support/JdoDaoSupportTests.java
index 529bdcabf1bd..d11d147ab174 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jdo/support/JdoDaoSupportTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jdo/support/JdoDaoSupportTests.java
@@ -16,9 +16,6 @@
package org.springframework.orm.jdo.support;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-
import java.util.ArrayList;
import java.util.List;
@@ -27,6 +24,9 @@
import org.junit.Test;
import org.springframework.orm.jdo.JdoTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jdo/support/OpenPersistenceManagerInViewTests.java b/spring-orm/src/test/java/org/springframework/orm/jdo/support/OpenPersistenceManagerInViewTests.java
index 2736e3b6da42..a3b75526d168 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jdo/support/OpenPersistenceManagerInViewTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jdo/support/OpenPersistenceManagerInViewTests.java
@@ -16,13 +16,6 @@
package org.springframework.orm.jdo.support;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.io.IOException;
import javax.jdo.PersistenceManager;
@@ -43,6 +36,9 @@
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.context.support.StaticWebApplicationContext;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @author Chris Beams
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/AbstractEntityManagerFactoryBeanTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/AbstractEntityManagerFactoryBeanTests.java
index cefae3bdf2ff..353ba458fa98 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/AbstractEntityManagerFactoryBeanTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/AbstractEntityManagerFactoryBeanTests.java
@@ -16,11 +16,6 @@
package org.springframework.orm.jpa;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceException;
import javax.persistence.spi.PersistenceUnitInfo;
@@ -29,6 +24,9 @@
import org.junit.Before;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Superclass for unit tests for EntityManagerFactory-creating beans.
* Note: Subclasses must set expectations on the mock EntityManagerFactory.
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/DefaultJpaDialectTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/DefaultJpaDialectTests.java
index 9102cd8645aa..f84155ecc6f8 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/DefaultJpaDialectTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/DefaultJpaDialectTests.java
@@ -16,11 +16,6 @@
package org.springframework.orm.jpa;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.OptimisticLockException;
@@ -30,6 +25,9 @@
import org.springframework.transaction.TransactionException;
import org.springframework.transaction.support.DefaultTransactionDefinition;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Costin Leau
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/EntityManagerFactoryBeanSupportTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/EntityManagerFactoryBeanSupportTests.java
index 0f21f02ea853..0380650be6d1 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/EntityManagerFactoryBeanSupportTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/EntityManagerFactoryBeanSupportTests.java
@@ -16,10 +16,10 @@
package org.springframework.orm.jpa;
-import static org.mockito.Mockito.verify;
-
import org.junit.Test;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/EntityManagerFactoryUtilsTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/EntityManagerFactoryUtilsTests.java
index 437713666367..7edab0c0ce1e 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/EntityManagerFactoryUtilsTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/EntityManagerFactoryUtilsTests.java
@@ -16,13 +16,6 @@
package org.springframework.orm.jpa;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-
import javax.persistence.EntityExistsException;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
@@ -41,6 +34,9 @@
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Costin Leau
* @author Rod Johnson
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/JpaInterceptorTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/JpaInterceptorTests.java
index 959fa0efe9b5..6e4eabe20642 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/JpaInterceptorTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/JpaInterceptorTests.java
@@ -16,15 +16,6 @@
package org.springframework.orm.jpa;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
@@ -40,6 +31,9 @@
import org.junit.Test;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Costin Leau
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/JpaTemplateTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/JpaTemplateTests.java
index 64828a431907..697cc6389b90 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/JpaTemplateTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/JpaTemplateTests.java
@@ -16,14 +16,6 @@
package org.springframework.orm.jpa;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -39,6 +31,9 @@
import org.springframework.dao.DataAccessException;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Costin Leau
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/JpaTransactionManagerTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/JpaTransactionManagerTests.java
index a343d215372a..f81d97dc2ea5 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/JpaTransactionManagerTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/JpaTransactionManagerTests.java
@@ -16,17 +16,6 @@
package org.springframework.orm.jpa;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@@ -51,6 +40,9 @@
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.support.TransactionTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Costin Leau
* @author Juergen Hoeller
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBeanTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBeanTests.java
index 5f20a375d4be..7ab71bc860a0 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBeanTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBeanTests.java
@@ -16,19 +16,6 @@
package org.springframework.orm.jpa;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.BDDMockito.willThrow;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import java.util.Map;
import java.util.Properties;
@@ -51,6 +38,9 @@
import org.springframework.transaction.interceptor.DefaultTransactionAttribute;
import org.springframework.util.SerializationTestUtils;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Juergen Hoeller
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/LocalEntityManagerFactoryBeanTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/LocalEntityManagerFactoryBeanTests.java
index de6667f543f1..bbf407b38075 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/LocalEntityManagerFactoryBeanTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/LocalEntityManagerFactoryBeanTests.java
@@ -16,10 +16,6 @@
package org.springframework.orm.jpa;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.mockito.Mockito.verify;
-
import java.util.Map;
import java.util.Properties;
@@ -30,6 +26,9 @@
import org.junit.After;
import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/support/JpaDaoSupportTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/support/JpaDaoSupportTests.java
index 4925258a6693..acb86b597a28 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/support/JpaDaoSupportTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/support/JpaDaoSupportTests.java
@@ -16,11 +16,6 @@
package org.springframework.orm.jpa.support;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.mock;
-
import java.util.ArrayList;
import java.util.List;
@@ -30,6 +25,9 @@
import org.junit.Test;
import org.springframework.orm.jpa.JpaTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Costin Leau
* @author Phillip Webb
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/support/OpenEntityManagerInViewTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/support/OpenEntityManagerInViewTests.java
index 8dd05c32b3d0..1859fd3acad3 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/support/OpenEntityManagerInViewTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/support/OpenEntityManagerInViewTests.java
@@ -16,17 +16,6 @@
package org.springframework.orm.jpa.support;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
import java.io.IOException;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicInteger;
@@ -56,6 +45,9 @@
import org.springframework.web.context.request.async.WebAsyncUtils;
import org.springframework.web.context.support.StaticWebApplicationContext;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Costin Leau
* @author Juergen Hoeller
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/support/PersistenceInjectionTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/support/PersistenceInjectionTests.java
index f7a26112fc51..9833c7146d7b 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/support/PersistenceInjectionTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/support/PersistenceInjectionTests.java
@@ -16,15 +16,6 @@
package org.springframework.orm.jpa.support;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.withSettings;
-
import java.io.Serializable;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
@@ -57,6 +48,9 @@
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.SerializationTestUtils;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Unit tests for persistence context and persistence unit injection.
*
diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/support/SharedEntityManagerFactoryTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/support/SharedEntityManagerFactoryTests.java
index 4a783c7d5d59..d185546a802c 100644
--- a/spring-orm/src/test/java/org/springframework/orm/jpa/support/SharedEntityManagerFactoryTests.java
+++ b/spring-orm/src/test/java/org/springframework/orm/jpa/support/SharedEntityManagerFactoryTests.java
@@ -16,14 +16,6 @@
package org.springframework.orm.jpa.support;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
@@ -32,6 +24,9 @@
import org.springframework.orm.jpa.EntityManagerProxy;
import org.springframework.transaction.support.TransactionSynchronizationManager;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Rod Johnson
* @author Juergen Hoeller
diff --git a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java
index 1ffc53630447..8178d7045225 100644
--- a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java
+++ b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,15 +16,6 @@
package org.springframework.oxm.castor;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
-import static org.easymock.EasyMock.aryEq;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-
import java.io.StringWriter;
import java.util.Arrays;
import java.util.HashMap;
@@ -39,6 +30,7 @@
import org.custommonkey.xmlunit.XpathEngine;
import org.junit.Assert;
import org.junit.Test;
+import org.mockito.InOrder;
import org.springframework.core.io.ClassPathResource;
import org.springframework.oxm.AbstractMarshallerTests;
import org.springframework.oxm.Marshaller;
@@ -47,6 +39,11 @@
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
+import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Tests the {@link CastorMarshaller} class.
*
@@ -126,26 +123,21 @@ protected Object createFlights() {
@Test
public void marshalSaxResult() throws Exception {
- ContentHandler handlerMock = createMock(ContentHandler.class);
- handlerMock.startDocument();
- handlerMock.startPrefixMapping("tns", "http://samples.springframework.org/flight");
- handlerMock.startElement(eq("http://samples.springframework.org/flight"), eq("flights"), eq("tns:flights"),
- isA(Attributes.class));
- handlerMock.startElement(eq("http://samples.springframework.org/flight"), eq("flight"), eq("tns:flight"),
- isA(Attributes.class));
- handlerMock.startElement(eq("http://samples.springframework.org/flight"), eq("number"), eq("tns:number"),
- isA(Attributes.class));
- handlerMock.characters(aryEq(new char[]{'4', '2'}), eq(0), eq(2));
- handlerMock.endElement("http://samples.springframework.org/flight", "number", "tns:number");
- handlerMock.endElement("http://samples.springframework.org/flight", "flight", "tns:flight");
- handlerMock.endElement("http://samples.springframework.org/flight", "flights", "tns:flights");
- handlerMock.endPrefixMapping("tns");
- handlerMock.endDocument();
-
- replay(handlerMock);
- SAXResult result = new SAXResult(handlerMock);
+ ContentHandler contentHandler = mock(ContentHandler.class);
+ SAXResult result = new SAXResult(contentHandler);
marshaller.marshal(flights, result);
- verify(handlerMock);
+ InOrder ordered = inOrder(contentHandler);
+ ordered.verify(contentHandler).startDocument();
+ ordered.verify(contentHandler).startPrefixMapping("tns", "http://samples.springframework.org/flight");
+ ordered.verify(contentHandler).startElement(eq("http://samples.springframework.org/flight"), eq("flights"), eq("tns:flights"), isA(Attributes.class));
+ ordered.verify(contentHandler).startElement(eq("http://samples.springframework.org/flight"), eq("flight"), eq("tns:flight"), isA(Attributes.class));
+ ordered.verify(contentHandler).startElement(eq("http://samples.springframework.org/flight"), eq("number"), eq("tns:number"), isA(Attributes.class));
+ ordered.verify(contentHandler).characters(eq(new char[]{'4', '2'}), eq(0), eq(2));
+ ordered.verify(contentHandler).endElement("http://samples.springframework.org/flight", "number", "tns:number");
+ ordered.verify(contentHandler).endElement("http://samples.springframework.org/flight", "flight", "tns:flight");
+ ordered.verify(contentHandler).endElement("http://samples.springframework.org/flight", "flights", "tns:flights");
+ ordered.verify(contentHandler).endPrefixMapping("tns");
+ ordered.verify(contentHandler).endDocument();
}
@Test
@@ -300,7 +292,6 @@ private void assertXpathEvaluatesTo(String msg, String expected, String xpath, S
Document doc = XMLUnit.buildControlDocument(xmlDoc);
NodeList node = engine.getMatchingNodes(xpath, doc);
-
assertEquals(msg, expected, node.item(0).getNodeValue());
}
diff --git a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java
index 43101e62d0a0..aa3eca07778f 100644
--- a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java
+++ b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java
@@ -16,19 +16,6 @@
package org.springframework.oxm.jaxb;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.createStrictMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
import java.io.ByteArrayOutputStream;
import java.io.StringWriter;
import java.lang.reflect.InvocationTargetException;
@@ -47,6 +34,7 @@
import javax.xml.transform.stream.StreamResult;
import org.junit.Test;
+import org.mockito.InOrder;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.oxm.AbstractMarshallerTests;
@@ -63,6 +51,10 @@
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
+import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
public class Jaxb2MarshallerTests extends AbstractMarshallerTests {
private static final String CONTEXT_PATH = "org.springframework.oxm.jaxb.test";
@@ -90,27 +82,22 @@ protected Object createFlights() {
@Test
public void marshalSAXResult() throws Exception {
- ContentHandler handlerMock = createStrictMock(ContentHandler.class);
- handlerMock.setDocumentLocator(isA(Locator.class));
- handlerMock.startDocument();
- handlerMock.startPrefixMapping("", "http://samples.springframework.org/flight");
- handlerMock.startElement(eq("http://samples.springframework.org/flight"), eq("flights"), eq("flights"),
- isA(Attributes.class));
- handlerMock.startElement(eq("http://samples.springframework.org/flight"), eq("flight"), eq("flight"),
- isA(Attributes.class));
- handlerMock.startElement(eq("http://samples.springframework.org/flight"), eq("number"), eq("number"),
- isA(Attributes.class));
- handlerMock.characters(isA(char[].class), eq(0), eq(2));
- handlerMock.endElement("http://samples.springframework.org/flight", "number", "number");
- handlerMock.endElement("http://samples.springframework.org/flight", "flight", "flight");
- handlerMock.endElement("http://samples.springframework.org/flight", "flights", "flights");
- handlerMock.endPrefixMapping("");
- handlerMock.endDocument();
- replay(handlerMock);
-
- SAXResult result = new SAXResult(handlerMock);
+ ContentHandler contentHandler = mock(ContentHandler.class);
+ SAXResult result = new SAXResult(contentHandler);
marshaller.marshal(flights, result);
- verify(handlerMock);
+ InOrder ordered = inOrder(contentHandler);
+ ordered.verify(contentHandler).setDocumentLocator(isA(Locator.class));
+ ordered.verify(contentHandler).startDocument();
+ ordered.verify(contentHandler).startPrefixMapping("", "http://samples.springframework.org/flight");
+ ordered.verify(contentHandler).startElement(eq("http://samples.springframework.org/flight"), eq("flights"), eq("flights"), isA(Attributes.class));
+ ordered.verify(contentHandler).startElement(eq("http://samples.springframework.org/flight"), eq("flight"), eq("flight"), isA(Attributes.class));
+ ordered.verify(contentHandler).startElement(eq("http://samples.springframework.org/flight"), eq("number"), eq("number"), isA(Attributes.class));
+ ordered.verify(contentHandler).characters(isA(char[].class), eq(0), eq(2));
+ ordered.verify(contentHandler).endElement("http://samples.springframework.org/flight", "number", "number");
+ ordered.verify(contentHandler).endElement("http://samples.springframework.org/flight", "flight", "flight");
+ ordered.verify(contentHandler).endElement("http://samples.springframework.org/flight", "flights", "flights");
+ ordered.verify(contentHandler).endPrefixMapping("");
+ ordered.verify(contentHandler).endDocument();
}
@Test
@@ -280,25 +267,22 @@ public void marshalAttachments() throws Exception {
marshaller.setClassesToBeBound(BinaryObject.class);
marshaller.setMtomEnabled(true);
marshaller.afterPropertiesSet();
- MimeContainer mimeContainer = createMock(MimeContainer.class);
+ MimeContainer mimeContainer = mock(MimeContainer.class);
Resource logo = new ClassPathResource("spring-ws.png", getClass());
DataHandler dataHandler = new DataHandler(new FileDataSource(logo.getFile()));
- expect(mimeContainer.convertToXopPackage()).andReturn(true);
- mimeContainer.addAttachment(isA(String.class), isA(DataHandler.class));
- expectLastCall().times(3);
-
- replay(mimeContainer);
+ given(mimeContainer.convertToXopPackage()).willReturn(true);
byte[] bytes = FileCopyUtils.copyToByteArray(logo.getInputStream());
BinaryObject object = new BinaryObject(bytes, dataHandler);
StringWriter writer = new StringWriter();
marshaller.marshal(object, new StreamResult(writer), mimeContainer);
- verify(mimeContainer);
assertTrue("No XML written", writer.toString().length() > 0);
+ verify(mimeContainer, times(3)).addAttachment(isA(String.class), isA(DataHandler.class));
}
@XmlRootElement
+ @SuppressWarnings("unused")
public static class DummyRootElement {
private DummyType t = new DummyType();
@@ -306,9 +290,11 @@ public static class DummyRootElement {
}
@XmlType
+ @SuppressWarnings("unused")
public static class DummyType {
private String s = "Hello";
+
}
@SuppressWarnings("unused")
diff --git a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java
index 8b4ce76a802e..55a3f8d22649 100644
--- a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java
+++ b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -17,6 +17,7 @@
package org.springframework.oxm.jaxb;
import java.io.StringReader;
+
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.xml.bind.JAXBElement;
@@ -25,10 +26,7 @@
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
import org.junit.Test;
-
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.oxm.AbstractUnmarshallerTests;
@@ -38,6 +36,9 @@
import org.springframework.oxm.mime.MimeContainer;
import org.springframework.util.xml.StaxUtils;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
public class Jaxb2UnmarshallerTests extends AbstractUnmarshallerTests {
private static final String INPUT_STRING = "" +
@@ -60,19 +61,15 @@ public void marshalAttachments() throws Exception {
unmarshaller.setClassesToBeBound(BinaryObject.class);
unmarshaller.setMtomEnabled(true);
unmarshaller.afterPropertiesSet();
- MimeContainer mimeContainer = createMock(MimeContainer.class);
+ MimeContainer mimeContainer = mock(MimeContainer.class);
Resource logo = new ClassPathResource("spring-ws.png", getClass());
DataHandler dataHandler = new DataHandler(new FileDataSource(logo.getFile()));
- expect(mimeContainer.isXopPackage()).andReturn(true);
- expect(mimeContainer.getAttachment(
- "<6b76528d-7a9c-4def-8e13-095ab89e9bb7@http://springframework.org/spring-ws>")).andReturn(dataHandler);
- expect(mimeContainer.getAttachment(
- "<99bd1592-0521-41a2-9688-a8bfb40192fb@http://springframework.org/spring-ws>")).andReturn(dataHandler);
- expect(mimeContainer.getAttachment("696cfb9a-4d2d-402f-bb5c-59fa69e7f0b3@spring-ws.png"))
- .andReturn(dataHandler);
- replay(mimeContainer);
+ given(mimeContainer.isXopPackage()).willReturn(true);
+ given(mimeContainer.getAttachment("<6b76528d-7a9c-4def-8e13-095ab89e9bb7@http://springframework.org/spring-ws>")).willReturn(dataHandler);
+ given(mimeContainer.getAttachment("<99bd1592-0521-41a2-9688-a8bfb40192fb@http://springframework.org/spring-ws>")).willReturn(dataHandler);
+ given(mimeContainer.getAttachment("696cfb9a-4d2d-402f-bb5c-59fa69e7f0b3@spring-ws.png")).willReturn(dataHandler);
String content = "" + "" +
"" +
"" + "" +
@@ -84,7 +81,6 @@ public void marshalAttachments() throws Exception {
StringReader reader = new StringReader(content);
Object result = unmarshaller.unmarshal(new StreamSource(reader), mimeContainer);
assertTrue("Result is not a BinaryObject", result instanceof BinaryObject);
- verify(mimeContainer);
BinaryObject object = (BinaryObject) result;
assertNotNull("bytes property not set", object.getBytes());
assertTrue("bytes property not set", object.getBytes().length > 0);
diff --git a/spring-oxm/src/test/java/org/springframework/oxm/xstream/XStreamMarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/xstream/XStreamMarshallerTests.java
index 7979e4d5c523..ce49ce166d79 100644
--- a/spring-oxm/src/test/java/org/springframework/oxm/xstream/XStreamMarshallerTests.java
+++ b/spring-oxm/src/test/java/org/springframework/oxm/xstream/XStreamMarshallerTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -25,6 +25,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.stream.XMLEventWriter;
@@ -36,26 +37,28 @@
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
-import com.thoughtworks.xstream.converters.Converter;
-import com.thoughtworks.xstream.converters.extended.EncodedByteArrayConverter;
-import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
-import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
-import com.thoughtworks.xstream.io.json.JsonHierarchicalStreamDriver;
-import com.thoughtworks.xstream.io.json.JsonWriter;
-import static org.custommonkey.xmlunit.XMLAssert.*;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.InOrder;
+import org.springframework.util.xml.StaxUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Text;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
-import org.springframework.util.xml.StaxUtils;
+import com.thoughtworks.xstream.converters.Converter;
+import com.thoughtworks.xstream.converters.extended.EncodedByteArrayConverter;
+import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
+import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
+import com.thoughtworks.xstream.io.json.JsonHierarchicalStreamDriver;
+import com.thoughtworks.xstream.io.json.JsonWriter;
+
+import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.custommonkey.xmlunit.XMLAssert.assertXpathExists;
+import static org.custommonkey.xmlunit.XMLAssert.assertXpathNotExists;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
/**
* @author Arjen Poutsma
@@ -143,19 +146,17 @@ public void marshalStreamResultOutputStream() throws Exception {
@Test
public void marshalSaxResult() throws Exception {
- ContentHandler handlerMock = createStrictMock(ContentHandler.class);
- handlerMock.startDocument();
- handlerMock.startElement(eq(""), eq("flight"), eq("flight"), isA(Attributes.class));
- handlerMock.startElement(eq(""), eq("flightNumber"), eq("flightNumber"), isA(Attributes.class));
- handlerMock.characters(isA(char[].class), eq(0), eq(2));
- handlerMock.endElement("", "flightNumber", "flightNumber");
- handlerMock.endElement("", "flight", "flight");
- handlerMock.endDocument();
-
- replay(handlerMock);
- SAXResult result = new SAXResult(handlerMock);
+ ContentHandler contentHandler = mock(ContentHandler.class);
+ SAXResult result = new SAXResult(contentHandler);
marshaller.marshal(flight, result);
- verify(handlerMock);
+ InOrder ordered = inOrder(contentHandler);
+ ordered.verify(contentHandler).startDocument();
+ ordered.verify(contentHandler).startElement(eq(""), eq("flight"), eq("flight"), isA(Attributes.class));
+ ordered.verify(contentHandler).startElement(eq(""), eq("flightNumber"), eq("flightNumber"), isA(Attributes.class));
+ ordered.verify(contentHandler).characters(isA(char[].class), eq(0), eq(2));
+ ordered.verify(contentHandler).endElement("", "flightNumber", "flightNumber");
+ ordered.verify(contentHandler).endElement("", "flight", "flight");
+ ordered.verify(contentHandler).endDocument();
}
@Test
diff --git a/spring-struts/src/test/java/org/springframework/web/struts/StrutsSupportTests.java b/spring-struts/src/test/java/org/springframework/web/struts/StrutsSupportTests.java
index ad97b300b558..22db7be93aac 100644
--- a/spring-struts/src/test/java/org/springframework/web/struts/StrutsSupportTests.java
+++ b/spring-struts/src/test/java/org/springframework/web/struts/StrutsSupportTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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,6 +19,7 @@
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
+
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -26,16 +27,16 @@
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.config.ModuleConfig;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
import org.junit.Test;
-
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.StaticWebApplicationContext;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Juergen Hoeller
* @since 09.04.2004
@@ -228,9 +229,8 @@ public ServletContext getServletContext() {
}
};
- ModuleConfig moduleConfig = createMock(ModuleConfig.class);
- expect(moduleConfig.getPrefix()).andReturn("").anyTimes();
- replay(moduleConfig);
+ ModuleConfig moduleConfig = mock(ModuleConfig.class);
+ given(moduleConfig.getPrefix()).willReturn("");
plugin.init(actionServlet, moduleConfig);
assertTrue(servletContext.getAttribute(ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX) != null);
@@ -249,8 +249,6 @@ public ServletContext getServletContext() {
proxy.setServlet(null);
plugin.destroy();
assertTrue(testAction.getServlet() == null);
-
- verify(moduleConfig);
}
@Test
@@ -270,9 +268,8 @@ public ServletContext getServletContext() {
}
};
- ModuleConfig moduleConfig = createMock(ModuleConfig.class);
- expect(moduleConfig.getPrefix()).andReturn("/module").anyTimes();
- replay(moduleConfig);
+ ModuleConfig moduleConfig = mock(ModuleConfig.class);
+ given(moduleConfig.getPrefix()).willReturn("/module");
plugin.init(actionServlet, moduleConfig);
assertTrue(servletContext.getAttribute(ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX) == null);
@@ -313,13 +310,12 @@ public ServletContext getServletContext() {
}
};
- ModuleConfig defaultModuleConfig = createMock(ModuleConfig.class);
- expect(defaultModuleConfig.getPrefix()).andReturn("").anyTimes();
+ ModuleConfig defaultModuleConfig = mock(ModuleConfig.class);
+ given(defaultModuleConfig.getPrefix()).willReturn("");
- ModuleConfig moduleConfig = createMock(ModuleConfig.class);
- expect(moduleConfig.getPrefix()).andReturn("/module").anyTimes();
+ ModuleConfig moduleConfig = mock(ModuleConfig.class);
+ given(moduleConfig.getPrefix()).willReturn("/module");
- replay(defaultModuleConfig, moduleConfig);
plugin.init(actionServlet, defaultModuleConfig);
assertTrue(servletContext.getAttribute(ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX) != null);
@@ -339,8 +335,6 @@ public ServletContext getServletContext() {
proxy.setServlet(null);
plugin.destroy();
assertTrue(testAction.getServlet() == null);
-
- verify(defaultModuleConfig, moduleConfig);
}
}
diff --git a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java
index 56d4c5b40ddd..b0488791f9f5 100644
--- a/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java
+++ b/spring-test-mvc/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -15,20 +15,17 @@
*/
package org.springframework.test.web.servlet;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.classextension.EasyMock.replay;
-import static org.easymock.classextension.EasyMock.verify;
-
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.servlet.AsyncContext;
-import org.easymock.classextension.EasyMock;
import org.junit.Before;
import org.junit.Test;
import org.springframework.mock.web.MockHttpServletRequest;
+import static org.mockito.BDDMockito.*;
+
/**
* Test fixture for {@link DefaultMvcResult}.
*
@@ -48,7 +45,7 @@ public void setup() {
ExtendedMockHttpServletRequest request = new ExtendedMockHttpServletRequest();
request.setAsyncStarted(true);
- this.countDownLatch = EasyMock.createMock(CountDownLatch.class);
+ this.countDownLatch = mock(CountDownLatch.class);
this.mvcResult = new DefaultMvcResult(request, null);
this.mvcResult.setAsyncResultLatch(this.countDownLatch);
@@ -57,50 +54,35 @@ public void setup() {
@Test
public void getAsyncResultWithTimeout() throws Exception {
long timeout = 1234L;
-
- expect(this.countDownLatch.await(timeout, TimeUnit.MILLISECONDS)).andReturn(true);
- replay(this.countDownLatch);
-
+ given(this.countDownLatch.await(timeout, TimeUnit.MILLISECONDS)).willReturn(true);
this.mvcResult.getAsyncResult(timeout);
-
- verify(this.countDownLatch);
+ verify(this.countDownLatch).await(timeout, TimeUnit.MILLISECONDS);
}
@Test
public void getAsyncResultWithTimeoutNegativeOne() throws Exception {
- expect(this.countDownLatch.await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS)).andReturn(true);
- replay(this.countDownLatch);
-
+ given(this.countDownLatch.await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS)).willReturn(true);
this.mvcResult.getAsyncResult(-1);
-
- verify(this.countDownLatch);
+ verify(this.countDownLatch).await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
}
@Test
public void getAsyncResultWithoutTimeout() throws Exception {
- expect(this.countDownLatch.await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS)).andReturn(true);
- replay(this.countDownLatch);
-
+ given(this.countDownLatch.await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS)).willReturn(true);
this.mvcResult.getAsyncResult();
-
- verify(this.countDownLatch);
+ verify(this.countDownLatch).await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
}
@Test
public void getAsyncResultWithTimeoutZero() throws Exception {
- replay(this.countDownLatch);
-
this.mvcResult.getAsyncResult(0);
-
- verify(this.countDownLatch);
+ verifyZeroInteractions(this.countDownLatch);
}
@Test(expected=IllegalStateException.class)
public void getAsyncResultAndTimeOut() throws Exception {
- expect(this.countDownLatch.await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS)).andReturn(false);
- replay(this.countDownLatch);
-
this.mvcResult.getAsyncResult(-1);
+ verify(this.countDownLatch).await(DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS);
}
@@ -111,9 +93,8 @@ private static class ExtendedMockHttpServletRequest extends MockHttpServletReque
public ExtendedMockHttpServletRequest() {
super();
- this.asyncContext = EasyMock.createMock(AsyncContext.class);
- expect(this.asyncContext.getTimeout()).andReturn(new Long(DEFAULT_TIMEOUT));
- replay(this.asyncContext);
+ this.asyncContext = mock(AsyncContext.class);
+ given(this.asyncContext.getTimeout()).willReturn(new Long(DEFAULT_TIMEOUT));
}
public void setAsyncStarted(boolean asyncStarted) {
diff --git a/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java b/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java
index a254398c4ed6..61240cb40216 100644
--- a/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java
+++ b/spring-test/src/test/java/org/springframework/mock/web/MockFilterChainTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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
@@ -12,10 +12,6 @@
*/
package org.springframework.mock.web;
-import static org.easymock.EasyMock.*;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.*;
-
import java.io.IOException;
import javax.servlet.Filter;
@@ -29,6 +25,10 @@
import org.junit.Before;
import org.junit.Test;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* Test fixture for {@link MockFilterChain}.
*
@@ -53,7 +53,7 @@ public void constructorNullServlet() {
@Test(expected=IllegalArgumentException.class)
public void constructorNullFilter() {
- new MockFilterChain(createMock(Servlet.class), (Filter) null);
+ new MockFilterChain(mock(Servlet.class), (Filter) null);
}
@Test(expected = IllegalArgumentException.class)
@@ -87,16 +87,10 @@ public void doFilterEmptyChain() throws Exception {
@Test
public void doFilterWithServlet() throws Exception {
- Servlet servlet = createMock(Servlet.class);
-
+ Servlet servlet = mock(Servlet.class);
MockFilterChain chain = new MockFilterChain(servlet);
- servlet.service(this.request, this.response);
- replay(servlet);
-
chain.doFilter(this.request, this.response);
-
- verify(servlet);
-
+ verify(servlet).service(this.request, this.response);
try {
chain.doFilter(this.request, this.response);
fail("Expected Exception");
@@ -108,9 +102,7 @@ public void doFilterWithServlet() throws Exception {
@Test
public void doFilterWithServletAndFilters() throws Exception {
- Servlet servlet = createMock(Servlet.class);
- servlet.service(this.request, this.response);
- replay(servlet);
+ Servlet servlet = mock(Servlet.class);
MockFilter filter2 = new MockFilter(servlet);
MockFilter filter1 = new MockFilter(null);
@@ -121,7 +113,7 @@ public void doFilterWithServletAndFilters() throws Exception {
assertTrue(filter1.invoked);
assertTrue(filter2.invoked);
- verify(servlet);
+ verify(servlet).service(this.request, this.response);
try {
chain.doFilter(this.request, this.response);
diff --git a/spring-tx/src/test/java/org/springframework/jca/cci/CciLocalTransactionTests.java b/spring-tx/src/test/java/org/springframework/jca/cci/CciLocalTransactionTests.java
index 2038b8ecc074..9a5b2c1243e3 100644
--- a/spring-tx/src/test/java/org/springframework/jca/cci/CciLocalTransactionTests.java
+++ b/spring-tx/src/test/java/org/springframework/jca/cci/CciLocalTransactionTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,9 +16,6 @@
package org.springframework.jca.cci;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.assertTrue;
-
import javax.resource.ResourceException;
import javax.resource.cci.Connection;
import javax.resource.cci.ConnectionFactory;
@@ -29,6 +26,7 @@
import org.junit.Test;
import org.springframework.dao.DataRetrievalFailureException;
+import org.springframework.jca.cci.connection.CciLocalTransactionManager;
import org.springframework.jca.cci.core.CciTemplate;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
@@ -36,6 +34,9 @@
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.transaction.support.TransactionTemplate;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Thierry Templier
* @author Chris Beams
@@ -49,34 +50,20 @@ public class CciLocalTransactionTests {
*/
@Test
public void testLocalTransactionCommit() throws ResourceException {
- final ConnectionFactory connectionFactory = createMock(ConnectionFactory.class);
- Connection connection = createMock(Connection.class);
- Interaction interaction = createMock(Interaction.class);
- LocalTransaction localTransaction = createMock(LocalTransaction.class);
- final Record record = createMock(Record.class);
- final InteractionSpec interactionSpec = createMock(InteractionSpec.class);
-
- expect(connectionFactory.getConnection()).andReturn(connection);
-
- expect(connection.getLocalTransaction()).andReturn(localTransaction);
-
- localTransaction.begin();
-
- expect(connection.createInteraction()).andReturn(interaction);
-
- expect(interaction.execute(interactionSpec, record, record)).andReturn(true);
-
- interaction.close();
-
- expect(connection.getLocalTransaction()).andReturn(localTransaction);
-
- localTransaction.commit();
-
- connection.close();
-
- replay(connectionFactory, connection, localTransaction, interaction, record);
-
- org.springframework.jca.cci.connection.CciLocalTransactionManager tm = new org.springframework.jca.cci.connection.CciLocalTransactionManager();
+ final ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
+ Connection connection = mock(Connection.class);
+ Interaction interaction = mock(Interaction.class);
+ LocalTransaction localTransaction = mock(LocalTransaction.class);
+ final Record record = mock(Record.class);
+ final InteractionSpec interactionSpec = mock(InteractionSpec.class);
+
+ given(connectionFactory.getConnection()).willReturn(connection);
+ given(connection.getLocalTransaction()).willReturn(localTransaction);
+ given(connection.createInteraction()).willReturn(interaction);
+ given(interaction.execute(interactionSpec, record, record)).willReturn(true);
+ given(connection.getLocalTransaction()).willReturn(localTransaction);
+
+ CciLocalTransactionManager tm = new CciLocalTransactionManager();
tm.setConnectionFactory(connectionFactory);
TransactionTemplate tt = new TransactionTemplate(tm);
@@ -89,7 +76,10 @@ protected void doInTransactionWithoutResult(TransactionStatus status) {
}
});
- verify(connectionFactory, connection, localTransaction, interaction, record);
+ verify(localTransaction).begin();
+ verify(interaction).close();
+ verify(localTransaction).commit();
+ verify(connection).close();
}
/**
@@ -99,34 +89,20 @@ protected void doInTransactionWithoutResult(TransactionStatus status) {
*/
@Test
public void testLocalTransactionRollback() throws ResourceException {
- final ConnectionFactory connectionFactory = createMock(ConnectionFactory.class);
- Connection connection = createMock(Connection.class);
- Interaction interaction = createMock(Interaction.class);
- LocalTransaction localTransaction = createMock(LocalTransaction.class);
- final Record record = createMock(Record.class);
- final InteractionSpec interactionSpec = createMock(InteractionSpec.class);
-
- expect(connectionFactory.getConnection()).andReturn(connection);
-
- expect(connection.getLocalTransaction()).andReturn(localTransaction);
-
- localTransaction.begin();
-
- expect(connection.createInteraction()).andReturn(interaction);
-
- expect(interaction.execute(interactionSpec, record, record)).andReturn(true);
-
- interaction.close();
-
- expect(connection.getLocalTransaction()).andReturn(localTransaction);
-
- localTransaction.rollback();
-
- connection.close();
-
- replay(connectionFactory, connection, localTransaction, interaction, record);
-
- org.springframework.jca.cci.connection.CciLocalTransactionManager tm = new org.springframework.jca.cci.connection.CciLocalTransactionManager();
+ final ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
+ Connection connection = mock(Connection.class);
+ Interaction interaction = mock(Interaction.class);
+ LocalTransaction localTransaction = mock(LocalTransaction.class);
+ final Record record = mock(Record.class);
+ final InteractionSpec interactionSpec = mock(InteractionSpec.class);
+
+ given(connectionFactory.getConnection()).willReturn(connection);
+ given(connection.getLocalTransaction()).willReturn(localTransaction);
+ given(connection.createInteraction()).willReturn(interaction);
+ given(interaction.execute(interactionSpec, record, record)).willReturn(true);
+ given(connection.getLocalTransaction()).willReturn(localTransaction);
+
+ CciLocalTransactionManager tm = new CciLocalTransactionManager();
tm.setConnectionFactory(connectionFactory);
TransactionTemplate tt = new TransactionTemplate(tm);
@@ -144,6 +120,9 @@ public Object doInTransaction(TransactionStatus status) {
catch (Exception ex) {
}
- verify(connectionFactory, connection, localTransaction, interaction, record);
+ verify(localTransaction).begin();
+ verify(interaction).close();
+ verify(localTransaction).rollback();
+ verify(connection).close();
}
}
diff --git a/spring-tx/src/test/java/org/springframework/jca/cci/CciTemplateTests.java b/spring-tx/src/test/java/org/springframework/jca/cci/CciTemplateTests.java
index ddbdc8006939..f934ebe7976d 100644
--- a/spring-tx/src/test/java/org/springframework/jca/cci/CciTemplateTests.java
+++ b/spring-tx/src/test/java/org/springframework/jca/cci/CciTemplateTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 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.
@@ -16,14 +16,6 @@
package org.springframework.jca.cci;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
import java.sql.SQLException;
import javax.resource.NotSupportedException;
@@ -48,6 +40,9 @@
import org.springframework.jca.cci.core.RecordCreator;
import org.springframework.jca.cci.core.RecordExtractor;
+import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.*;
+
/**
* @author Thierry Templier
* @author Juergen Hoeller
@@ -57,99 +52,73 @@ public class CciTemplateTests {
@Test
public void testCreateIndexedRecord() throws ResourceException {
- ConnectionFactory connectionFactory = createMock(ConnectionFactory.class);
- RecordFactory recordFactory = createMock(RecordFactory.class);
- IndexedRecord indexedRecord = createMock(IndexedRecord.class);
-
- expect(connectionFactory.getRecordFactory()).andReturn(recordFactory);
-
- expect(recordFactory.createIndexedRecord("name")).andReturn(
- indexedRecord);
-
- replay(connectionFactory, recordFactory);
+ ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
+ RecordFactory recordFactory = mock(RecordFactory.class);
+ IndexedRecord indexedRecord = mock(IndexedRecord.class);
+ given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
+ given(recordFactory.createIndexedRecord("name")).willReturn(indexedRecord);
CciTemplate ct = new CciTemplate(connectionFactory);
ct.createIndexedRecord("name");
- verify(connectionFactory, recordFactory);
+ verify(recordFactory).createIndexedRecord("name");
}
@Test
public void testCreateMappedRecord() throws ResourceException {
- ConnectionFactory connectionFactory = createMock(ConnectionFactory.class);
- RecordFactory recordFactory = createMock(RecordFactory.class);
- MappedRecord mappedRecord = createMock(MappedRecord.class);
-
- expect(connectionFactory.getRecordFactory()).andReturn(recordFactory);
+ ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
+ RecordFactory recordFactory = mock(RecordFactory.class);
+ MappedRecord mappedRecord = mock(MappedRecord.class);
- expect(recordFactory.createMappedRecord("name"))
- .andReturn(mappedRecord);
-
- replay(connectionFactory, recordFactory);
+ given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
+ given(recordFactory.createMappedRecord("name")).willReturn(mappedRecord);
CciTemplate ct = new CciTemplate(connectionFactory);
ct.createMappedRecord("name");
- verify(connectionFactory, recordFactory);
+ verify(recordFactory).createMappedRecord("name");
}
@Test
public void testTemplateExecuteInputOutput() throws ResourceException {
- ConnectionFactory connectionFactory = createMock(ConnectionFactory.class);
- Connection connection = createMock(Connection.class);
- Interaction interaction = createMock(Interaction.class);
-
- Record inputRecord = createMock(Record.class);
- Record outputRecord = createMock(Record.class);
+ ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
+ Connection connection = mock(Connection.class);
+ Interaction interaction = mock(Interaction.class);
- InteractionSpec interactionSpec = createMock(InteractionSpec.class);
+ Record inputRecord = mock(Record.class);
+ Record outputRecord = mock(Record.class);
- expect(connectionFactory.getConnection()).andReturn(connection);
+ InteractionSpec interactionSpec = mock(InteractionSpec.class);
- expect(connection.createInteraction()).andReturn(interaction);
+ given(connectionFactory.getConnection()).willReturn(connection);
+ given(connection.createInteraction()).willReturn(interaction);
+ given(interaction.execute(interactionSpec, inputRecord, outputRecord)).willReturn(true);
- expect(interaction.execute(interactionSpec, inputRecord, outputRecord))
- .andReturn(true);
-
- interaction.close();
-
- connection.close();
-
- replay(connectionFactory, connection, interaction);
CciTemplate ct = new CciTemplate(connectionFactory);
ct.execute(interactionSpec, inputRecord, outputRecord);
- verify(connectionFactory, connection, interaction);
+ verify(interaction).execute(interactionSpec, inputRecord, outputRecord);
+ verify(interaction).close();
+ verify(connection).close();
}
@Test
public void testTemplateExecuteWithCreatorAndRecordFactoryNotSupported()
throws ResourceException {
- ConnectionFactory connectionFactory = createMock(ConnectionFactory.class);
- Connection connection = createMock(Connection.class);
- Interaction interaction = createMock(Interaction.class);
-
- Record inputRecord = createMock(Record.class);
- final Record outputRecord = createMock(Record.class);
-
- InteractionSpec interactionSpec = createMock(InteractionSpec.class);
-
- expect(connectionFactory.getConnection()).andReturn(connection);
-
- expect(connectionFactory.getRecordFactory()).andThrow(
- new NotSupportedException("not supported"));
+ ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
+ Connection connection = mock(Connection.class);
+ Interaction interaction = mock(Interaction.class);
- expect(connection.createInteraction()).andReturn(interaction);
+ Record inputRecord = mock(Record.class);
+ final Record outputRecord = mock(Record.class);
- expect(interaction.execute(interactionSpec, inputRecord, outputRecord))
- .andReturn(true);
+ InteractionSpec interactionSpec = mock(InteractionSpec.class);
- interaction.close();
-
- connection.close();
-
- replay(connectionFactory, connection, interaction);
+ given(connectionFactory.getConnection()).willReturn(connection);
+ given(connectionFactory.getRecordFactory()).willThrow(new NotSupportedException("not supported"));
+ given(connection.createInteraction()).willReturn(interaction);
+ given(interaction.execute(interactionSpec, inputRecord, outputRecord)).willReturn(true);
CciTemplate ct = new CciTemplate(connectionFactory);
ct.setOutputRecordCreator(new RecordCreator() {
@@ -161,352 +130,265 @@ public Record createRecord(RecordFactory recordFactory) {
});
ct.execute(interactionSpec, inputRecord);
- verify(connectionFactory, connection, interaction);
+ verify(interaction).execute(interactionSpec, inputRecord, outputRecord);
+ verify(interaction).close();
+ verify(connection).close();
}
@Test
public void testTemplateExecuteInputTrueWithCreator2()
throws ResourceException {
- ConnectionFactory connectionFactory = createMock(ConnectionFactory.class);
- RecordFactory recordFactory = createMock(RecordFactory.class);
- Connection connection = createMock(Connection.class);
- Interaction interaction = createMock(Interaction.class);
- RecordCreator creator = createMock(RecordCreator.class);
-
- Record inputRecord = createMock(Record.class);
- final Record outputRecord = createMock(Record.class);
-
- InteractionSpec interactionSpec = createMock(InteractionSpec.class);
-
- expect(connectionFactory.getConnection()).andReturn(connection);
-
- expect(connectionFactory.getRecordFactory()).andReturn(recordFactory);
-
- expect(connection.createInteraction()).andReturn(interaction);
-
- expect(creator.createRecord(recordFactory)).andReturn(outputRecord);
+ ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
+ RecordFactory recordFactory = mock(RecordFactory.class);
+ Connection connection = mock(Connection.class);
+ Interaction interaction = mock(Interaction.class);
+ RecordCreator creator = mock(RecordCreator.class);
- expect(interaction.execute(interactionSpec, inputRecord, outputRecord))
- .andReturn(true);
+ Record inputRecord = mock(Record.class);
+ final Record outputRecord = mock(Record.class);
- interaction.close();
+ InteractionSpec interactionSpec = mock(InteractionSpec.class);
- connection.close();
-
- replay(connectionFactory, connection, interaction, creator);
+ given(connectionFactory.getConnection()).willReturn(connection);
+ given(connectionFactory.getRecordFactory()).willReturn(recordFactory);
+ given(connection.createInteraction()).willReturn(interaction);
+ given(creator.createRecord(recordFactory)).willReturn(outputRecord);
+ given(interaction.execute(interactionSpec, inputRecord, outputRecord)).willReturn(true);
CciTemplate ct = new CciTemplate(connectionFactory);
ct.setOutputRecordCreator(creator);
ct.execute(interactionSpec, inputRecord);
- verify(connectionFactory, connection, interaction, creator);
+ verify(interaction).execute(interactionSpec, inputRecord, outputRecord);
+ verify(interaction).close();
+ verify(connection).close();
}
@Test
public void testTemplateExecuteInputFalse() throws ResourceException {
- ConnectionFactory connectionFactory = createMock(ConnectionFactory.class);
- Connection connection = createMock(Connection.class);
- Interaction interaction = createMock(Interaction.class);
-
- Record inputRecord = createMock(Record.class);
- Record outputRecord = createMock(Record.class);
-
- InteractionSpec interactionSpec = createMock(InteractionSpec.class);
-
- expect(connectionFactory.getConnection()).andReturn(connection);
+ ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
+ Connection connection = mock(Connection.class);
+ Interaction interaction = mock(Interaction.class);
- expect(connection.createInteraction()).andReturn(interaction);
+ Record inputRecord = mock(Record.class);
+ Record outputRecord = mock(Record.class);
- expect(interaction.execute(interactionSpec, inputRecord)).andReturn(
- outputRecord);
+ InteractionSpec interactionSpec = mock(InteractionSpec.class);
- interaction.close();
-
- connection.close();
-
- replay(connectionFactory, connection, interaction);
+ given(connectionFactory.getConnection()).willReturn(connection);
+ given(connection.createInteraction()).willReturn(interaction);
+ given(interaction.execute(interactionSpec, inputRecord)).willReturn(outputRecord);
CciTemplate ct = new CciTemplate(connectionFactory);
ct.execute(interactionSpec, inputRecord);
- verify(connectionFactory, connection, interaction);
+ verify(interaction).execute(interactionSpec, inputRecord);
+ verify(interaction).close();
+ verify(connection).close();
}
@SuppressWarnings("unchecked")
@Test
public void testTemplateExecuteInputExtractorTrueWithCreator()
throws ResourceException, SQLException {
- ConnectionFactory connectionFactory = createMock(ConnectionFactory.class);
- RecordFactory recordFactory = createMock(RecordFactory.class);
- Connection connection = createMock(Connection.class);
- Interaction interaction = createMock(Interaction.class);
- RecordExtractor