diff --git a/build.gradle b/build.gradle index 22bc5e6c..f2be08cc 100644 --- a/build.gradle +++ b/build.gradle @@ -73,6 +73,7 @@ configure(subprojects.findAll { hibernate5Version = "5.2.17.Final" tiles3Version = "3.0.8" log4jVersion = "2.11.1" + junit5Version = "5.5.1" } configurations.all { @@ -95,9 +96,7 @@ configure(subprojects.findAll { compile("org.springframework:spring-core:$springVersion") compile("org.springframework:spring-expression:$springVersion") compileOnly("javax.el:javax.el-api:3.0.1-b04") - testCompile("junit:junit:4.12") { - exclude group:'org.hamcrest', module:'hamcrest-core' - } + testCompile("org.junit.jupiter:junit-jupiter:${junit5Version}") testCompile("org.hamcrest:hamcrest-all:1.3") testCompile("org.easymock:easymock:3.5.1") testCompile("org.apache.tomcat:tomcat-jasper-el:8.5.27") diff --git a/spring-binding/src/test/java/org/springframework/binding/collection/MapAccessorTests.java b/spring-binding/src/test/java/org/springframework/binding/collection/MapAccessorTests.java index 3b9d6b8e..9ffe06b0 100644 --- a/spring-binding/src/test/java/org/springframework/binding/collection/MapAccessorTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/collection/MapAccessorTests.java @@ -1,17 +1,17 @@ package org.springframework.binding.collection; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.HashMap; import java.util.Map; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class MapAccessorTests { private MapAccessor accessor; - @Before + @BeforeEach public void setUp() { Map map = new HashMap<>(); map.put("string", "hello"); diff --git a/spring-binding/src/test/java/org/springframework/binding/collection/SharedMapDecoratorTests.java b/spring-binding/src/test/java/org/springframework/binding/collection/SharedMapDecoratorTests.java index 8fc71bc2..8892ac05 100644 --- a/spring-binding/src/test/java/org/springframework/binding/collection/SharedMapDecoratorTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/collection/SharedMapDecoratorTests.java @@ -15,18 +15,18 @@ */ package org.springframework.binding.collection; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link org.springframework.binding.collection.SharedMapDecorator}. diff --git a/spring-binding/src/test/java/org/springframework/binding/collection/StringKeyedMapAdapterTests.java b/spring-binding/src/test/java/org/springframework/binding/collection/StringKeyedMapAdapterTests.java index a9afa0c1..9dc3a7a0 100644 --- a/spring-binding/src/test/java/org/springframework/binding/collection/StringKeyedMapAdapterTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/collection/StringKeyedMapAdapterTests.java @@ -15,11 +15,11 @@ */ package org.springframework.binding.collection; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Collection; import java.util.HashMap; @@ -27,7 +27,7 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link org.springframework.binding.collection.StringKeyedMapAdapter}. diff --git a/spring-binding/src/test/java/org/springframework/binding/convert/service/DefaultConversionServiceTests.java b/spring-binding/src/test/java/org/springframework/binding/convert/service/DefaultConversionServiceTests.java index bde31575..1a80f02c 100644 --- a/spring-binding/src/test/java/org/springframework/binding/convert/service/DefaultConversionServiceTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/convert/service/DefaultConversionServiceTests.java @@ -15,10 +15,10 @@ */ package org.springframework.binding.convert.service; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.security.Principal; import java.util.AbstractList; @@ -32,7 +32,7 @@ import java.util.Locale; import java.util.Set; import java.util.StringTokenizer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.convert.ConversionException; import org.springframework.binding.convert.ConversionExecutionException; import org.springframework.binding.convert.ConversionExecutor; diff --git a/spring-binding/src/test/java/org/springframework/binding/convert/service/StaticConversionExecutorImplTests.java b/spring-binding/src/test/java/org/springframework/binding/convert/service/StaticConversionExecutorImplTests.java index c8364ac7..0d0bef7c 100644 --- a/spring-binding/src/test/java/org/springframework/binding/convert/service/StaticConversionExecutorImplTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/convert/service/StaticConversionExecutorImplTests.java @@ -15,15 +15,15 @@ */ package org.springframework.binding.convert.service; -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.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.Date; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.convert.ConversionExecutionException; import org.springframework.binding.convert.converters.StringToDate; @@ -31,7 +31,7 @@ public class StaticConversionExecutorImplTests { private StaticConversionExecutor conversionExecutor; - @Before + @BeforeEach public void setUp() { StringToDate stringToDate = new StringToDate(); conversionExecutor = new StaticConversionExecutor(String.class, Date.class, stringToDate); diff --git a/spring-binding/src/test/java/org/springframework/binding/expression/beanwrapper/BeanWrapperExpressionParserTests.java b/spring-binding/src/test/java/org/springframework/binding/expression/beanwrapper/BeanWrapperExpressionParserTests.java index a815dae5..e324ac30 100644 --- a/spring-binding/src/test/java/org/springframework/binding/expression/beanwrapper/BeanWrapperExpressionParserTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/expression/beanwrapper/BeanWrapperExpressionParserTests.java @@ -15,13 +15,13 @@ */ package org.springframework.binding.expression.beanwrapper; -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.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.beans.TypeMismatchException; import org.springframework.binding.convert.converters.StringToDate; import org.springframework.binding.convert.service.GenericConversionService; diff --git a/spring-binding/src/test/java/org/springframework/binding/expression/el/ELExpressionParserTests.java b/spring-binding/src/test/java/org/springframework/binding/expression/el/ELExpressionParserTests.java index cdc606e4..6e7a3354 100644 --- a/spring-binding/src/test/java/org/springframework/binding/expression/el/ELExpressionParserTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/expression/el/ELExpressionParserTests.java @@ -1,7 +1,7 @@ package org.springframework.binding.expression.el; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.beans.FeatureDescriptor; import java.util.Iterator; @@ -12,8 +12,8 @@ import javax.el.FunctionMapper; import javax.el.VariableMapper; import org.apache.el.ExpressionFactoryImpl; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.EvaluationException; import org.springframework.binding.expression.Expression; import org.springframework.binding.expression.ExpressionVariable; @@ -25,7 +25,7 @@ public class ELExpressionParserTests { private ELExpressionParser parser = new ELExpressionParser(new ExpressionFactoryImpl()); - @Before + @BeforeEach public void setUp() { parser.putContextFactory(TestBean.class, new TestELContextFactory()); } diff --git a/spring-binding/src/test/java/org/springframework/binding/expression/el/MapAdaptableELResolverTests.java b/spring-binding/src/test/java/org/springframework/binding/expression/el/MapAdaptableELResolverTests.java index 34f32bc2..ac01d3fe 100644 --- a/spring-binding/src/test/java/org/springframework/binding/expression/el/MapAdaptableELResolverTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/expression/el/MapAdaptableELResolverTests.java @@ -1,22 +1,22 @@ package org.springframework.binding.expression.el; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.HashMap; import java.util.Map; import javax.el.ELContext; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.collection.MapAdaptable; public class MapAdaptableELResolverTests { private ELContext context; - @Before + @BeforeEach public void setUp() { context = new DefaultELContext(new MapAdaptableELResolver(), null, null); } diff --git a/spring-binding/src/test/java/org/springframework/binding/expression/spel/ELExpressionParserCompatibilityTests.java b/spring-binding/src/test/java/org/springframework/binding/expression/spel/ELExpressionParserCompatibilityTests.java index 433dad29..9d760d01 100644 --- a/spring-binding/src/test/java/org/springframework/binding/expression/spel/ELExpressionParserCompatibilityTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/expression/spel/ELExpressionParserCompatibilityTests.java @@ -15,12 +15,12 @@ */ package org.springframework.binding.expression.spel; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.EvaluationException; import org.springframework.binding.expression.Expression; import org.springframework.binding.expression.ExpressionVariable; @@ -48,7 +48,7 @@ public class ELExpressionParserCompatibilityTests { private SpringELExpressionParser parser = new SpringELExpressionParser(new SpelExpressionParser()); - @Before + @BeforeEach public void setUp() { parser.addPropertyAccessor(new SpecialPropertyAccessor()); } diff --git a/spring-binding/src/test/java/org/springframework/binding/mapping/DefaultMapperTests.java b/spring-binding/src/test/java/org/springframework/binding/mapping/DefaultMapperTests.java index 429acea5..de2eb888 100644 --- a/spring-binding/src/test/java/org/springframework/binding/mapping/DefaultMapperTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/mapping/DefaultMapperTests.java @@ -1,14 +1,14 @@ package org.springframework.binding.mapping; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; import java.util.HashMap; import java.util.Locale; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.ExpressionParser; import org.springframework.binding.expression.spel.SpringELExpressionParser; import org.springframework.binding.mapping.impl.DefaultMapper; diff --git a/spring-binding/src/test/java/org/springframework/binding/message/DefaultMessageContextTests.java b/spring-binding/src/test/java/org/springframework/binding/message/DefaultMessageContextTests.java index 902ddf52..4c70d3a6 100644 --- a/spring-binding/src/test/java/org/springframework/binding/message/DefaultMessageContextTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/message/DefaultMessageContextTests.java @@ -1,18 +1,18 @@ package org.springframework.binding.message; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.Serializable; import java.util.Locale; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.support.StaticMessageSource; public class DefaultMessageContextTests { private DefaultMessageContext context; - @Before + @BeforeEach public void setUp() { StaticMessageSource messageSource = new StaticMessageSource(); messageSource.addMessage("message", Locale.getDefault(), "Hello world resolved!"); diff --git a/spring-binding/src/test/java/org/springframework/binding/message/MessageBuilderTests.java b/spring-binding/src/test/java/org/springframework/binding/message/MessageBuilderTests.java index ec568af2..aaa68216 100644 --- a/spring-binding/src/test/java/org/springframework/binding/message/MessageBuilderTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/message/MessageBuilderTests.java @@ -1,13 +1,13 @@ package org.springframework.binding.message; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; import java.util.Locale; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.NoSuchMessageException; import org.springframework.context.support.StaticMessageSource; @@ -16,7 +16,7 @@ public class MessageBuilderTests { private Locale locale = Locale.getDefault(); private MessageBuilder builder = new MessageBuilder(); - @Before + @BeforeEach public void setUp() { messageSource.addMessage("foo", locale, "bar"); messageSource.addMessage("bar", locale, "{0}"); diff --git a/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsMessageCodesTests.java b/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsMessageCodesTests.java index 0e4fc56b..eb0bccde 100644 --- a/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsMessageCodesTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsMessageCodesTests.java @@ -3,8 +3,8 @@ package org.springframework.binding.message; import java.util.Locale; import org.easymock.EasyMock; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.support.StaticMessageSource; import org.springframework.validation.MessageCodesResolver; @@ -18,7 +18,7 @@ public class MessageContextErrorsMessageCodesTests { private MessageCodesResolver resolver; - @Before + @BeforeEach public void setUp() { StaticMessageSource messageSource = new StaticMessageSource(); messageSource.addMessage(errorCode, Locale.getDefault(), "doesntmatter"); diff --git a/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsTests.java b/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsTests.java index 4e645438..ed12334a 100644 --- a/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/message/MessageContextErrorsTests.java @@ -1,12 +1,12 @@ package org.springframework.binding.message; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.HashMap; import java.util.Locale; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.spel.SpringELExpressionParser; import org.springframework.context.support.StaticMessageSource; import org.springframework.expression.spel.standard.SpelExpressionParser; @@ -18,7 +18,7 @@ public class MessageContextErrorsTests { private DefaultMessageContext context; private MessageContextErrors errors; - @Before + @BeforeEach public void setUp() { StaticMessageSource messageSource = new StaticMessageSource(); messageSource.addMessage("foo", Locale.getDefault(), "bar"); diff --git a/spring-binding/src/test/java/org/springframework/binding/method/MethodInvocationExceptionTests.java b/spring-binding/src/test/java/org/springframework/binding/method/MethodInvocationExceptionTests.java index 883f0350..26da71a1 100644 --- a/spring-binding/src/test/java/org/springframework/binding/method/MethodInvocationExceptionTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/method/MethodInvocationExceptionTests.java @@ -15,12 +15,12 @@ */ package org.springframework.binding.method; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertSame; import java.io.IOException; import java.lang.reflect.InvocationTargetException; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Test case for {@link MethodInvocationException}. diff --git a/spring-binding/src/test/java/org/springframework/binding/method/MethodInvokerTests.java b/spring-binding/src/test/java/org/springframework/binding/method/MethodInvokerTests.java index ccbed0d9..3ab7ce7d 100644 --- a/spring-binding/src/test/java/org/springframework/binding/method/MethodInvokerTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/method/MethodInvokerTests.java @@ -15,13 +15,13 @@ */ package org.springframework.binding.method; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.support.StaticExpression; /** @@ -34,7 +34,7 @@ public class MethodInvokerTests { private MethodInvoker methodInvoker; - @Before + @BeforeEach public void setUp() { this.methodInvoker = new MethodInvoker(); } diff --git a/spring-binding/src/test/java/org/springframework/binding/method/MethodKeyTests.java b/spring-binding/src/test/java/org/springframework/binding/method/MethodKeyTests.java index afce7ec7..b3629f0f 100644 --- a/spring-binding/src/test/java/org/springframework/binding/method/MethodKeyTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/method/MethodKeyTests.java @@ -15,13 +15,13 @@ */ package org.springframework.binding.method; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; import java.io.FilenameFilter; import java.lang.reflect.Method; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * @author Rob Harrop diff --git a/spring-faces/src/test/java/org/springframework/faces/config/AbstractFacesFlowBuilderServicesConfigurationTests.java b/spring-faces/src/test/java/org/springframework/faces/config/AbstractFacesFlowBuilderServicesConfigurationTests.java index 21466f19..b1830df9 100644 --- a/spring-faces/src/test/java/org/springframework/faces/config/AbstractFacesFlowBuilderServicesConfigurationTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/config/AbstractFacesFlowBuilderServicesConfigurationTests.java @@ -1,12 +1,12 @@ package org.springframework.faces.config; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.convert.ConversionException; import org.springframework.binding.convert.ConversionExecutionException; import org.springframework.binding.convert.ConversionExecutor; @@ -36,7 +36,7 @@ public abstract class AbstractFacesFlowBuilderServicesConfigurationTests { protected final JSFMockHelper jsf = new JSFMockHelper(); - @Before + @BeforeEach public void setUp() throws Exception { this.jsf.setUp(); this.context = initApplicationContext(); @@ -44,7 +44,7 @@ public abstract class AbstractFacesFlowBuilderServicesConfigurationTests { protected abstract ApplicationContext initApplicationContext(); - @After + @AfterEach public void tearDown() throws Exception { this.jsf.tearDown(); } diff --git a/spring-faces/src/test/java/org/springframework/faces/config/AbstractResourcesConfigurationTests.java b/spring-faces/src/test/java/org/springframework/faces/config/AbstractResourcesConfigurationTests.java index b0433d70..8a76b7fd 100644 --- a/spring-faces/src/test/java/org/springframework/faces/config/AbstractResourcesConfigurationTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/config/AbstractResourcesConfigurationTests.java @@ -1,15 +1,15 @@ package org.springframework.faces.config; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Map; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.ApplicationContext; import org.springframework.faces.webflow.JsfResourceRequestHandler; import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; @@ -19,14 +19,14 @@ public abstract class AbstractResourcesConfigurationTests { protected ApplicationContext context; - @Before + @BeforeEach public void setUp() throws Exception { this.context = initApplicationContext(); } protected abstract ApplicationContext initApplicationContext(); - @After + @AfterEach public void tearDown() throws Exception { } diff --git a/spring-faces/src/test/java/org/springframework/faces/config/ResourcesBeanDefinitionParserTests.java b/spring-faces/src/test/java/org/springframework/faces/config/ResourcesBeanDefinitionParserTests.java index b877b0b6..7806e6b3 100644 --- a/spring-faces/src/test/java/org/springframework/faces/config/ResourcesBeanDefinitionParserTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/config/ResourcesBeanDefinitionParserTests.java @@ -1,7 +1,7 @@ package org.springframework.faces.config; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.faces.webflow.JSFMockHelper; @@ -14,14 +14,14 @@ public class ResourcesBeanDefinitionParserTests extends AbstractResourcesConfigu private final JSFMockHelper jsfMockHelper = new JSFMockHelper(); @Override - @Before + @BeforeEach public void setUp() throws Exception { this.jsfMockHelper.setUp(); super.setUp(); } @Override - @After + @AfterEach public void tearDown() throws Exception { super.tearDown(); this.jsfMockHelper.tearDown(); diff --git a/spring-faces/src/test/java/org/springframework/faces/model/SelectionTrackingActionListenerTests.java b/spring-faces/src/test/java/org/springframework/faces/model/SelectionTrackingActionListenerTests.java index 1028675c..ae6ca863 100644 --- a/spring-faces/src/test/java/org/springframework/faces/model/SelectionTrackingActionListenerTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/model/SelectionTrackingActionListenerTests.java @@ -1,8 +1,8 @@ package org.springframework.faces.model; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.lang.reflect.Method; import java.util.ArrayList; @@ -19,9 +19,9 @@ import javax.faces.event.ActionListener; import org.apache.myfaces.test.mock.MockFacesContext; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.faces.webflow.JSFMockHelper; import org.springframework.util.ReflectionUtils; @@ -54,7 +54,7 @@ public class SelectionTrackingActionListenerTests { */ private final ActionListener selectionTrackingListener = new SelectionTrackingActionListener(this.delegateListener); - @Before + @BeforeEach public void setUp() throws Exception { this.jsfMockHelper.setUp(); this.viewToTest = new UIViewRoot(); @@ -65,7 +65,7 @@ public class SelectionTrackingActionListenerTests { this.dataModel = new OneSelectionTrackingListDataModel<>(rows); } - @After + @AfterEach public void tearDown() throws Exception { this.jsfMockHelper.tearDown(); } diff --git a/spring-faces/src/test/java/org/springframework/faces/model/converter/DataModelConverterTests.java b/spring-faces/src/test/java/org/springframework/faces/model/converter/DataModelConverterTests.java index ac93dacc..f4af4560 100644 --- a/spring-faces/src/test/java/org/springframework/faces/model/converter/DataModelConverterTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/model/converter/DataModelConverterTests.java @@ -1,9 +1,9 @@ package org.springframework.faces.model.converter; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.Serializable; import java.util.ArrayList; @@ -12,7 +12,7 @@ import java.util.List; import javax.faces.model.DataModel; import javax.faces.model.ListDataModel; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.convert.converters.Converter; import org.springframework.faces.model.SerializableListDataModel; diff --git a/spring-faces/src/test/java/org/springframework/faces/model/converter/FacesConversionServiceTests.java b/spring-faces/src/test/java/org/springframework/faces/model/converter/FacesConversionServiceTests.java index 1d350c74..6355e626 100644 --- a/spring-faces/src/test/java/org/springframework/faces/model/converter/FacesConversionServiceTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/model/converter/FacesConversionServiceTests.java @@ -5,14 +5,14 @@ import java.util.List; import javax.faces.model.DataModel; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.convert.ConversionExecutor; public class FacesConversionServiceTests { private FacesConversionService service; - @Before + @BeforeEach public void setUp() throws Exception { this.service = new FacesConversionService(); } diff --git a/spring-faces/src/test/java/org/springframework/faces/mvc/JsfViewTests.java b/spring-faces/src/test/java/org/springframework/faces/mvc/JsfViewTests.java index b9cba9be..577500e6 100644 --- a/spring-faces/src/test/java/org/springframework/faces/mvc/JsfViewTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/mvc/JsfViewTests.java @@ -1,8 +1,8 @@ package org.springframework.faces.mvc; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.HashMap; import java.util.Locale; @@ -10,9 +10,9 @@ import java.util.Locale; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.faces.webflow.JSFMockHelper; import org.springframework.faces.webflow.MockViewHandler; import org.springframework.mock.web.MockHttpServletRequest; @@ -28,7 +28,7 @@ public class JsfViewTests { private final JSFMockHelper jsfMock = new JSFMockHelper(); - @Before + @BeforeEach public void setUp() throws Exception { this.jsfMock.setUp(); this.jsfMock.facesContext().getApplication().setViewHandler(new ResourceCheckingViewHandler()); @@ -40,7 +40,7 @@ public class JsfViewTests { this.resolver.setApplicationContext(new StaticWebApplicationContext()); } - @After + @AfterEach public void tearDown() throws Exception { this.jsfMock.tearDown(); } diff --git a/spring-faces/src/test/java/org/springframework/faces/security/FaceletsAuthorizeTagTests.java b/spring-faces/src/test/java/org/springframework/faces/security/FaceletsAuthorizeTagTests.java index 91ce2108..7d8ee796 100644 --- a/spring-faces/src/test/java/org/springframework/faces/security/FaceletsAuthorizeTagTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/security/FaceletsAuthorizeTagTests.java @@ -15,9 +15,9 @@ */ package org.springframework.faces.security; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link FaceletsAuthorizeTag}. diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowActionListenerTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowActionListenerTests.java index 973d5040..cd448934 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowActionListenerTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowActionListenerTests.java @@ -1,8 +1,8 @@ package org.springframework.faces.webflow; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import javax.el.ELContext; import javax.el.MethodExpression; @@ -11,9 +11,9 @@ import javax.faces.component.UICommand; import javax.faces.event.ActionEvent; import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.core.collection.LocalAttributeMap; import org.springframework.webflow.engine.Flow; import org.springframework.webflow.engine.ViewState; @@ -28,7 +28,7 @@ public class FlowActionListenerTests { RequestContext context = EasyMock.createMock(RequestContext.class); - @Before + @BeforeEach public void setUp() throws Exception { this.jsfMock.setUp(); @@ -40,7 +40,7 @@ public class FlowActionListenerTests { EasyMock.replay(this.context); } - @After + @AfterEach public void tearDown() throws Exception { this.jsfMock.tearDown(); RequestContextHolder.setRequestContext(null); @@ -57,10 +57,10 @@ public class FlowActionListenerTests { this.listener.processAction(event); - assertTrue("The event was not signaled", - this.jsfMock.externalContext().getRequestMap().containsKey(JsfView.EVENT_KEY)); - assertEquals("The event should be " + outcome, outcome, - this.jsfMock.externalContext().getRequestMap().get(JsfView.EVENT_KEY)); + assertTrue(this.jsfMock.externalContext().getRequestMap().containsKey(JsfView.EVENT_KEY), + "The event was not signaled"); + assertEquals(outcome, this.jsfMock.externalContext().getRequestMap().get(JsfView.EVENT_KEY), + "The event should be " + outcome); } @Test @@ -74,8 +74,8 @@ public class FlowActionListenerTests { this.listener.processAction(event); - assertFalse("An unexpected event was signaled", - this.jsfMock.externalContext().getRequestMap().containsKey(JsfView.EVENT_KEY)); + assertFalse(this.jsfMock.externalContext().getRequestMap().containsKey(JsfView.EVENT_KEY), + "An unexpected event was signaled"); } private class MethodExpressionStub extends MethodExpression { diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowELResolverTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowELResolverTests.java index 21f4fba8..021afa9e 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowELResolverTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowELResolverTests.java @@ -1,18 +1,18 @@ package org.springframework.faces.webflow; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import javax.el.ELContext; import org.apache.myfaces.test.el.MockELContext; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.ApplicationContext; import org.springframework.web.context.support.StaticWebApplicationContext; import org.springframework.webflow.core.collection.LocalAttributeMap; @@ -34,12 +34,12 @@ public class FlowELResolverTests { private final ELContext elContext = new MockELContext(); - @Before + @BeforeEach public void setUp() { RequestContextHolder.setRequestContext(this.requestContext); } - @After + @AfterEach public void tearDown() { RequestContextHolder.setRequestContext(null); } diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java index e8d42a0f..a2500c78 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java @@ -1,9 +1,9 @@ package org.springframework.faces.webflow; -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.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -18,9 +18,9 @@ import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.message.DefaultMessageContext; import org.springframework.binding.message.Message; import org.springframework.binding.message.MessageBuilder; @@ -41,7 +41,7 @@ public class FlowFacesContextTests { MessageContext prepopulatedMessageContext; @SuppressWarnings("cast") - @Before + @BeforeEach public void setUp() throws Exception { this.jsf.setUp(); this.requestContext = (RequestContext) EasyMock.createMock(RequestContext.class); @@ -49,7 +49,7 @@ public class FlowFacesContextTests { setupMessageContext(); } - @After + @AfterEach public void tearDown() throws Exception { this.jsf.tearDown(); } @@ -67,7 +67,7 @@ public class FlowFacesContextTests { this.facesContext.addMessage("foo", new FacesMessage(FacesMessage.SEVERITY_INFO, "foo", "bar")); - assertEquals("Message count is incorrect", 1, this.messageContext.getAllMessages().length); + assertEquals(1, this.messageContext.getAllMessages().length, "Message count is incorrect"); Message message = this.messageContext.getMessagesBySource(new FacesMessageSource("foo"))[0]; assertEquals("foo : bar", message.getText()); } @@ -119,7 +119,7 @@ public class FlowFacesContextTests { this.facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "foo", "bar")); this.facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "zoo", "zar")); - assertEquals("Message count is incorrect", 2, this.messageContext.getAllMessages().length); + assertEquals(2, this.messageContext.getAllMessages().length, "Message count is incorrect"); Message[] messages = this.messageContext.getMessagesBySource(new FacesMessageSource(null)); assertEquals("foo : bar", messages[0].getText()); assertEquals("zoo : zar", messages[1].getText()); @@ -137,7 +137,7 @@ public class FlowFacesContextTests { assertNotNull(i.next()); iterationCount++; } - assertEquals("There should be 6 messages to iterate", 6, iterationCount); + assertEquals(6, iterationCount, "There should be 6 messages to iterate"); } @Test @@ -220,7 +220,7 @@ public class FlowFacesContextTests { Iterator i = this.facesContext.getClientIdsWithMessages(); while (i.hasNext()) { String clientId = i.next(); - assertEquals("Client id not expected", expectedOrderedIds.get(iterationCount), clientId); + assertEquals(expectedOrderedIds.get(iterationCount), clientId, "Client id not expected"); iterationCount++; } assertEquals(3, iterationCount); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowPartialViewContextTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowPartialViewContextTests.java index 40c421cf..00d88fe4 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowPartialViewContextTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowPartialViewContextTests.java @@ -1,6 +1,6 @@ package org.springframework.faces.webflow; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.Arrays; import java.util.Collection; @@ -9,8 +9,8 @@ import java.util.List; import javax.faces.context.PartialViewContext; import javax.faces.context.PartialViewContextWrapper; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.RequestContext; import org.springframework.webflow.execution.RequestContextHolder; import org.springframework.webflow.execution.View; @@ -18,7 +18,7 @@ import org.springframework.webflow.test.MockRequestContext; public class FlowPartialViewContextTests { - @After + @AfterEach public void tearDown() throws Exception { RequestContextHolder.setRequestContext(null); } diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowResponseStateManagerTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowResponseStateManagerTests.java index 40952abe..ee9b7846 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowResponseStateManagerTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowResponseStateManagerTests.java @@ -1,14 +1,14 @@ package org.springframework.faces.webflow; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; import java.io.IOException; import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.web.context.support.StaticWebApplicationContext; import org.springframework.webflow.core.collection.LocalAttributeMap; import org.springframework.webflow.execution.FlowExecutionContext; @@ -28,7 +28,7 @@ public class FlowResponseStateManagerTests { private FlowExecutionContext flowExecutionContext; - @Before + @BeforeEach public void setUp() throws Exception { this.jsfMock.setUp(); this.webappContext = new StaticWebApplicationContext(); @@ -41,7 +41,7 @@ public class FlowResponseStateManagerTests { this.responseStateManager = new FlowResponseStateManager(null); } - @After + @AfterEach public void tearDown() throws Exception { this.webappContext.close(); this.jsfMock.tearDown(); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfAjaxHandlerTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfAjaxHandlerTests.java index 8c95c290..4d434c50 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfAjaxHandlerTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfAjaxHandlerTests.java @@ -1,11 +1,11 @@ package org.springframework.faces.webflow; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.web.context.support.StaticWebApplicationContext; public class JsfAjaxHandlerTests { @@ -13,7 +13,7 @@ public class JsfAjaxHandlerTests { private final JSFMockHelper jsfMock = new JSFMockHelper(); private JsfAjaxHandler ajaxHandler; - @Before + @BeforeEach public void setUp() throws Exception { this.jsfMock.setUp(); StaticWebApplicationContext webappContext = new StaticWebApplicationContext(); @@ -22,7 +22,7 @@ public class JsfAjaxHandlerTests { this.ajaxHandler.setApplicationContext(webappContext); } - @After + @AfterEach public void tearDown() throws Exception { this.jsfMock.tearDown(); } diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java index edecea83..8aead521 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java @@ -1,7 +1,7 @@ package org.springframework.faces.webflow; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.ArrayList; @@ -18,9 +18,9 @@ import javax.faces.event.PhaseListener; import javax.faces.lifecycle.Lifecycle; import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.apache.el.ExpressionFactoryImpl; import org.springframework.binding.expression.ExpressionParser; import org.springframework.binding.expression.support.FluentParserContext; @@ -53,12 +53,12 @@ public class JsfFinalResponseActionTests { ExpressionParser parser = new WebFlowELExpressionParser(new ExpressionFactoryImpl()); - @Before + @BeforeEach public void setUp() throws Exception { configureJsf(); } - @After + @AfterEach public void tearDown() throws Exception { this.jsfMock.tearDown(); RequestContextHolder.setRequestContext(null); @@ -116,7 +116,7 @@ public class JsfFinalResponseActionTests { } public void execute(FacesContext context) throws FacesException { - assertFalse("Lifecycle executed more than once", this.executed); + assertFalse(this.executed, "Lifecycle executed more than once"); super.execute(context); this.executed = true; } @@ -129,15 +129,15 @@ public class JsfFinalResponseActionTests { public void afterPhase(PhaseEvent event) { String phaseCallback = "AFTER_" + event.getPhaseId(); - assertFalse("Phase callback " + phaseCallback + " already executed.", - this.phaseCallbacks.contains(phaseCallback)); + assertFalse(this.phaseCallbacks.contains(phaseCallback), + "Phase callback " + phaseCallback + " already executed."); this.phaseCallbacks.add(phaseCallback); } public void beforePhase(PhaseEvent event) { String phaseCallback = "BEFORE_" + event.getPhaseId(); - assertFalse("Phase callback " + phaseCallback + " already executed.", - this.phaseCallbacks.contains(phaseCallback)); + assertFalse(this.phaseCallbacks.contains(phaseCallback), + "Phase callback " + phaseCallback + " already executed."); this.phaseCallbacks.add(phaseCallback); } diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFlowHandlerAdapterTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFlowHandlerAdapterTests.java index 4707aee8..227603d1 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFlowHandlerAdapterTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFlowHandlerAdapterTests.java @@ -3,11 +3,11 @@ package org.springframework.faces.webflow; import org.springframework.webflow.context.servlet.AjaxHandler; import org.springframework.webflow.context.servlet.DefaultAjaxHandler; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockServletContext; import org.springframework.web.context.support.StaticWebApplicationContext; import org.springframework.webflow.context.ExternalContext; @@ -20,7 +20,7 @@ public class JsfFlowHandlerAdapterTests { private JsfFlowHandlerAdapter handlerAdapter; - @Before + @BeforeEach public void setUp() throws Exception { StaticWebApplicationContext context = new StaticWebApplicationContext(); context.setServletContext(new MockServletContext()); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfManagedBeanAwareELExpressionParserTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfManagedBeanAwareELExpressionParserTests.java index 8b868143..b76a12f3 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfManagedBeanAwareELExpressionParserTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfManagedBeanAwareELExpressionParserTests.java @@ -1,11 +1,11 @@ package org.springframework.faces.webflow; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; import org.apache.el.ExpressionFactoryImpl; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.Expression; import org.springframework.binding.expression.ExpressionParser; import org.springframework.binding.expression.support.FluentParserContext; @@ -21,14 +21,14 @@ public class JsfManagedBeanAwareELExpressionParserTests { ExpressionParser parser; - @Before + @BeforeEach public void setUp() throws Exception { this.jsfMock.setUp(); RequestContextHolder.setRequestContext(this.requestContext); this.parser = new JsfManagedBeanAwareELExpressionParser(new ExpressionFactoryImpl()); } - @After + @AfterEach public void tearDown() throws Exception { this.jsfMock.tearDown(); RequestContextHolder.setRequestContext(null); @@ -40,6 +40,6 @@ public class JsfManagedBeanAwareELExpressionParserTests { this.jsfMock.externalContext().getRequestMap().put("myJsfBean", new Object()); Expression expr = this.parser.parseExpression("myJsfBean", new FluentParserContext().evaluate(RequestContext.class)); Object result = expr.getValue(this.requestContext); - assertNotNull("The JSF Bean should not be null.", result); + assertNotNull(result, "The JSF Bean should not be null."); } } diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfManagedBeanPropertyAccessorTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfManagedBeanPropertyAccessorTests.java index 81102080..72570e85 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfManagedBeanPropertyAccessorTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfManagedBeanPropertyAccessorTests.java @@ -15,14 +15,14 @@ */ package org.springframework.faces.webflow; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.core.collection.MutableAttributeMap; import org.springframework.webflow.execution.RequestContextHolder; import org.springframework.webflow.test.MockRequestContext; @@ -35,14 +35,14 @@ public class JsfManagedBeanPropertyAccessorTests { private MockRequestContext requestContext; - @Before + @BeforeEach public void setUp() throws Exception { this.jsfMock.setUp(); this.requestContext = new MockRequestContext(); RequestContextHolder.setRequestContext(this.requestContext); } - @After + @AfterEach public void tearDown() throws Exception { this.jsfMock.tearDown(); RequestContextHolder.setRequestContext(null); @@ -90,7 +90,7 @@ public class JsfManagedBeanPropertyAccessorTests { MutableAttributeMap map = this.requestContext.getExternalContext().getRequestMap(); this.accessor.write(null, null, "myJsfBean", jsfBean1); - assertNull("Write occurs only if bean is present in the map", map.get("myJsfBean")); + assertNull(map.get("myJsfBean"), "Write occurs only if bean is present in the map"); map.put("myJsfBean", jsfBean1); this.accessor.write(null, null, "myJsfBean", jsfBean2); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfUtilsTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfUtilsTests.java index b887b289..f28161bf 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfUtilsTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfUtilsTests.java @@ -19,7 +19,7 @@ import org.apache.myfaces.test.mock.MockFacesContextFactory; import org.apache.myfaces.test.mock.MockRenderKitFactory; import org.apache.myfaces.test.mock.lifecycle.MockLifecycle; import org.apache.myfaces.test.mock.lifecycle.MockLifecycleFactory; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class JsfUtilsTests extends AbstractJsfTestCase { diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java index 67726baa..3dd70af4 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java @@ -1,11 +1,11 @@ package org.springframework.faces.webflow; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.ArrayList; import java.util.HashMap; @@ -31,9 +31,9 @@ import javax.faces.lifecycle.Lifecycle; import org.apache.el.ExpressionFactoryImpl; import org.apache.myfaces.test.mock.MockApplication20; import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.ExpressionParser; import org.springframework.binding.expression.support.FluentParserContext; import org.springframework.mock.web.MockHttpServletRequest; @@ -77,7 +77,7 @@ public class JsfViewFactoryTests { private final MockHttpServletResponse response = new MockHttpServletResponse(); - @Before + @BeforeEach public void setUp() throws Exception { configureJsf(); this.extContext.setNativeContext(this.servletContext); @@ -90,7 +90,7 @@ public class JsfViewFactoryTests { new LocalParameterMap(new HashMap<>())); } - @After + @AfterEach public void tearDown() throws Exception { this.jsfMock.tearDown(); RequestContextHolder.setRequestContext(null); @@ -127,10 +127,10 @@ public class JsfViewFactoryTests { View newView = this.factory.getView(this.context); - assertNotNull("A View was not created", newView); - assertTrue("A JsfView was expected", newView instanceof JsfView); - assertEquals("View name did not match", VIEW_ID, ((JsfView) newView).getViewRoot().getViewId()); - assertFalse("An unexpected event was signaled,", newView.hasFlowEvent()); + assertNotNull(newView, "A View was not created"); + assertTrue(newView instanceof JsfView, "A JsfView was expected"); + assertEquals(VIEW_ID, ((JsfView) newView).getViewRoot().getViewId(), "View name did not match"); + assertFalse(newView.hasFlowEvent(), "An unexpected event was signaled,"); } /** @@ -159,12 +159,12 @@ public class JsfViewFactoryTests { View restoredView = this.factory.getView(this.context); - assertNotNull("A View was not restored", restoredView); - assertTrue("A JsfView was expected", restoredView instanceof JsfView); - assertEquals("View name did not match", VIEW_ID, ((JsfView) restoredView).getViewRoot().getViewId()); - assertFalse("An unexpected event was signaled,", restoredView.hasFlowEvent()); - assertTrue("The input component's valid flag was not reset", input.isValid()); - assertTrue("The PostRestoreViewEvent was not seen", existingRoot.isPostRestoreStateEventSeen()); + assertNotNull(restoredView, "A View was not restored"); + assertTrue(restoredView instanceof JsfView, "A JsfView was expected"); + assertEquals(VIEW_ID, ((JsfView) restoredView).getViewRoot().getViewId(), "View name did not match"); + assertFalse(restoredView.hasFlowEvent(), "An unexpected event was signaled,"); + assertTrue(input.isValid(), "The input component's valid flag was not reset"); + assertTrue(existingRoot.isPostRestoreStateEventSeen(), "The PostRestoreViewEvent was not seen"); } /** @@ -207,13 +207,13 @@ public class JsfViewFactoryTests { View restoredView = this.factory.getView(this.context); - assertNotNull("A View was not restored", restoredView); - assertTrue("A JsfView was expected", restoredView instanceof JsfView); - assertEquals("View name did not match", VIEW_ID, ((JsfView) restoredView).getViewRoot().getViewId()); - assertFalse("An unexpected event was signaled,", restoredView.hasFlowEvent()); - assertSame("The UIInput binding was not restored properly", input, testBean.getInput()); - assertSame("The faceted UIOutput binding was not restored properly", output, testBean.getOutput()); - assertTrue("The PostRestoreViewEvent was not seen", existingRoot.isPostRestoreStateEventSeen()); + assertNotNull(restoredView, "A View was not restored"); + assertTrue(restoredView instanceof JsfView, "A JsfView was expected"); + assertEquals(VIEW_ID, ((JsfView) restoredView).getViewRoot().getViewId(), "View name did not match"); + assertFalse(restoredView.hasFlowEvent(), "An unexpected event was signaled,"); + assertSame(input, testBean.getInput(), "The UIInput binding was not restored properly"); + assertSame(output, testBean.getOutput(), "The faceted UIOutput binding was not restored properly"); + assertTrue(existingRoot.isPostRestoreStateEventSeen(), "The PostRestoreViewEvent was not seen"); } /** @@ -243,12 +243,12 @@ public class JsfViewFactoryTests { View restoredView = this.factory.getView(this.context); - assertNotNull("A View was not restored", restoredView); - assertTrue("A JsfView was expected", restoredView instanceof JsfView); - assertTrue("An ViewRoot was not set", ((JsfView) restoredView).getViewRoot() != null); - assertEquals("View name did not match", VIEW_ID, ((JsfView) restoredView).getViewRoot().getViewId()); - assertFalse("An unexpected event was signaled,", restoredView.hasFlowEvent()); - assertTrue("The PostRestoreViewEvent was not seen", existingRoot.isPostRestoreStateEventSeen()); + assertNotNull(restoredView, "A View was not restored"); + assertTrue(restoredView instanceof JsfView, "A JsfView was expected"); + assertTrue(((JsfView) restoredView).getViewRoot() != null, "An ViewRoot was not set"); + assertEquals(VIEW_ID, ((JsfView) restoredView).getViewRoot().getViewId(), "View name did not match"); + assertFalse(restoredView.hasFlowEvent(), "An unexpected event was signaled,"); + assertTrue(existingRoot.isPostRestoreStateEventSeen(), "The PostRestoreViewEvent was not seen"); } /** @@ -270,12 +270,12 @@ public class JsfViewFactoryTests { View newView = this.factory.getView(this.context); - assertNotNull("A View was not created", newView); - assertTrue("A JsfView was expected", newView instanceof JsfView); - assertEquals("View name did not match", VIEW_ID, ((JsfView) newView).getViewRoot().getViewId()); - assertSame("View root was not the third party instance", newRoot, ((JsfView) newView).getViewRoot()); - assertFalse("An unexpected event was signaled,", newView.hasFlowEvent()); - assertTrue("The PostRestoreViewEvent was not seen", newRoot.isPostRestoreStateEventSeen()); + assertNotNull(newView, "A View was not created"); + assertTrue(newView instanceof JsfView, "A JsfView was expected"); + assertEquals(VIEW_ID, ((JsfView) newView).getViewRoot().getViewId(), "View name did not match"); + assertSame(newRoot, ((JsfView) newView).getViewRoot(), "View root was not the third party instance"); + assertFalse(newView.hasFlowEvent(), "An unexpected event was signaled,"); + assertTrue(newRoot.isPostRestoreStateEventSeen(), "The PostRestoreViewEvent was not seen"); } @Test @@ -297,9 +297,9 @@ public class JsfViewFactoryTests { this.factory.getView(this.context); ExceptionEventAwareMockApplication application = (ExceptionEventAwareMockApplication) FlowFacesContext .getCurrentInstance().getApplication(); - assertNotNull("Expected exception event", application.getExceptionQueuedEventContext()); - assertSame("Expected same exception", existingRoot.getAbortProcessingException(), application - .getExceptionQueuedEventContext().getException()); + assertNotNull(application.getExceptionQueuedEventContext(), "Expected exception event"); + assertSame(existingRoot.getAbortProcessingException(), + application.getExceptionQueuedEventContext().getException(), "Expected same exception"); } private class NoExecutionLifecycle extends FlowLifecycle { @@ -319,15 +319,15 @@ public class JsfViewFactoryTests { public void afterPhase(PhaseEvent event) { String phaseCallback = "AFTER_" + event.getPhaseId(); - assertFalse("Phase callback " + phaseCallback + " already executed.", - this.phaseCallbacks.contains(phaseCallback)); + assertFalse(this.phaseCallbacks.contains(phaseCallback), + "Phase callback " + phaseCallback + " already executed."); this.phaseCallbacks.add(phaseCallback); } public void beforePhase(PhaseEvent event) { String phaseCallback = "BEFORE_" + event.getPhaseId(); - assertFalse("Phase callback " + phaseCallback + " already executed.", - this.phaseCallbacks.contains(phaseCallback)); + assertFalse(this.phaseCallbacks.contains(phaseCallback), + "Phase callback " + phaseCallback + " already executed."); this.phaseCallbacks.add(phaseCallback); } @@ -393,7 +393,7 @@ public class JsfViewFactoryTests { public void processEvent(ComponentSystemEvent event) throws AbortProcessingException { if (event instanceof PostRestoreStateEvent) { - assertSame("Component did not match", this, event.getComponent()); + assertSame(this, event.getComponent(), "Component did not match"); this.postRestoreStateEventSeen = true; if (this.throwOnPostRestoreStateEvent) { this.abortProcessingException = new AbortProcessingException(); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewTests.java index d8e13442..e24a3954 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewTests.java @@ -1,8 +1,8 @@ package org.springframework.faces.webflow; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.io.StringWriter; @@ -17,9 +17,9 @@ import javax.faces.lifecycle.Lifecycle; import org.apache.myfaces.test.mock.MockResponseWriter; import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.core.collection.MutableAttributeMap; import org.springframework.webflow.execution.FlowExecutionContext; import org.springframework.webflow.execution.FlowExecutionKey; @@ -64,7 +64,7 @@ public class JsfViewTests { } }; - @Before + @BeforeEach public void setUp() throws Exception { this.jsfMock.setUp(); @@ -95,7 +95,7 @@ public class JsfViewTests { this.view = new JsfView(viewToRender, this.jsfMock.lifecycle(), this.context); } - @After + @AfterEach public void tearDown() throws Exception { this.jsfMock.tearDown(); RequestContextHolder.setRequestContext(null); @@ -156,8 +156,8 @@ public class JsfViewTests { restoredView.processUserEvent(); - assertFalse("An unexpected event was signaled,", restoredView.hasFlowEvent()); - assertTrue("The lifecycle should have been invoked", ((NoEventLifecycle) lifecycle).executed); + assertFalse(restoredView.hasFlowEvent(), "An unexpected event was signaled,"); + assertTrue(((NoEventLifecycle) lifecycle).executed, "The lifecycle should have been invoked"); } /** @@ -182,9 +182,9 @@ public class JsfViewTests { restoredView.processUserEvent(); - assertTrue("No event was signaled,", restoredView.hasFlowEvent()); - assertEquals("Event should be " + this.event, this.event, restoredView.getFlowEvent().getId()); - assertTrue("The lifecycle should have been invoked", ((EventSignalingLifecycle) lifecycle).executed); + assertTrue(restoredView.hasFlowEvent(), "No event was signaled,"); + assertEquals(this.event, restoredView.getFlowEvent().getId(), "Event should be " + this.event); + assertTrue(((EventSignalingLifecycle) lifecycle).executed, "The lifecycle should have been invoked"); } @Test @@ -198,7 +198,7 @@ public class JsfViewTests { JsfView createdView = new JsfView(new UIViewRoot(), this.jsfMock.lifecycle(), this.context); - assertFalse("No user event should be queued", createdView.userEventQueued()); + assertFalse(createdView.userEventQueued(), "No user event should be queued"); } @Test @@ -211,7 +211,7 @@ public class JsfViewTests { JsfView createdView = new JsfView(new UIViewRoot(), this.jsfMock.lifecycle(), this.context); - assertTrue("User event should be queued", createdView.userEventQueued()); + assertTrue(createdView.userEventQueued(), "User event should be queued"); } private class ExceptionalViewHandler extends MockViewHandler { @@ -229,7 +229,7 @@ public class JsfViewTests { } public void execute(FacesContext context) throws FacesException { - assertFalse("Lifecycle executed more than once", this.executed); + assertFalse(this.executed, "Lifecycle executed more than once"); super.execute(context); this.executed = true; } @@ -244,7 +244,7 @@ public class JsfViewTests { } public void execute(FacesContext context) throws FacesException { - assertFalse("Lifecycle executed more than once", this.executed); + assertFalse(this.executed, "Lifecycle executed more than once"); super.execute(context); JsfViewTests.this.extContext.getRequestMap().put(JsfView.EVENT_KEY, JsfViewTests.this.event); this.executed = true; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/UnitTestTemplate.java b/spring-webflow/src/test/java/org/springframework/webflow/UnitTestTemplate.java index af12919b..d6585443 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/UnitTestTemplate.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/UnitTestTemplate.java @@ -15,25 +15,25 @@ */ package org.springframework.webflow; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Keith likes to have these little cut & paste examples in the source repositories. If only he knew the power of code * templates in Eclipse... */ -public class UnitTestTemplate { +class UnitTestTemplate { - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { } @Test - public void testScenario1() { + void scenario1() { } @Test - public void testScenario2() { + void scenario2() { } } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/AbstractActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/AbstractActionTests.java index a38c3f58..dbbab0a1 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/AbstractActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/AbstractActionTests.java @@ -15,13 +15,13 @@ */ package org.springframework.webflow.action; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.BeanInitializationException; import org.springframework.webflow.core.collection.LocalAttributeMap; import org.springframework.webflow.execution.Event; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/CompositeActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/CompositeActionTests.java index ac1b57ff..e4c4d640 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/CompositeActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/CompositeActionTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.easymock.EasyMock; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.core.collection.LocalAttributeMap; import org.springframework.webflow.execution.Action; import org.springframework.webflow.execution.Event; @@ -37,7 +37,7 @@ public class CompositeActionTests { private Action actionMock; - @Before + @BeforeEach public void setUp() throws Exception { actionMock = EasyMock.createMock(Action.class); Action[] actions = new Action[] { actionMock }; @@ -76,7 +76,7 @@ public class CompositeActionTests { EasyMock.replay(actionMock); Event result = tested.doExecute(mockRequestContext); EasyMock.verify(actionMock); - assertEquals("Expecting success since no check is performed if null result,", "success", result.getId()); + assertEquals("success", result.getId(), "Expecting success since no check is performed if null result,"); } @Test @@ -92,7 +92,7 @@ public class CompositeActionTests { return new Event(this, "bar"); } }); - assertEquals("Result of last executed action should be returned", "bar", ca.execute(new MockRequestContext()) - .getId()); + assertEquals("bar", ca.execute(new MockRequestContext()).getId(), + "Result of last executed action should be returned"); } } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/DispatchMethodInvokerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/DispatchMethodInvokerTests.java index 15a9d78d..33eb0db1 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/DispatchMethodInvokerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/DispatchMethodInvokerTests.java @@ -15,17 +15,17 @@ */ package org.springframework.webflow.action; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class DispatchMethodInvokerTests { private MockClass mockClass; - @Before + @BeforeEach public void setUp() { mockClass = new MockClass(); } @@ -34,21 +34,21 @@ public class DispatchMethodInvokerTests { public void testInvokeWithExplicitParameters() throws Exception { DispatchMethodInvoker invoker = new DispatchMethodInvoker(mockClass, Object.class); invoker.invoke("argumentMethod", "testValue"); - assertTrue("Method should have been called successfully", mockClass.getMethodCalled()); + assertTrue(mockClass.getMethodCalled(), "Method should have been called successfully"); } @Test public void testInvokeWithAssignableParameters() throws Exception { DispatchMethodInvoker invoker = new DispatchMethodInvoker(mockClass, String.class); invoker.invoke("argumentMethod", "testValue"); - assertTrue("Method should have been called successfully", mockClass.getMethodCalled()); + assertTrue(mockClass.getMethodCalled(), "Method should have been called successfully"); } @Test public void testInvokeWithNoParameters() throws Exception { DispatchMethodInvoker invoker = new DispatchMethodInvoker(mockClass); invoker.invoke("noArgumentMethod"); - assertTrue("Method should have been called successfully", mockClass.getMethodCalled()); + assertTrue(mockClass.getMethodCalled(), "Method should have been called successfully"); } @Test diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/EvaluateActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/EvaluateActionTests.java index e291dd34..f15cdc2a 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/EvaluateActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/EvaluateActionTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.support.StaticExpression; import org.springframework.webflow.execution.Event; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/EventFactorySupportTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/EventFactorySupportTests.java index 9d4e5c62..a5a575f3 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/EventFactorySupportTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/EventFactorySupportTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.Event; /** @@ -31,7 +31,7 @@ public class EventFactorySupportTests { private Object source = new Object(); - @Before + @BeforeEach public void setUp() throws Exception { } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/ExternalRedirectActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/ExternalRedirectActionTests.java index b5cbbcfa..8a45de9b 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/ExternalRedirectActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/ExternalRedirectActionTests.java @@ -1,9 +1,9 @@ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.support.StaticExpression; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/FlowDefinitionRedirectActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/FlowDefinitionRedirectActionTests.java index 1786fccc..40d5a04a 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/FlowDefinitionRedirectActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/FlowDefinitionRedirectActionTests.java @@ -1,9 +1,9 @@ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.Expression; import org.springframework.binding.expression.support.StaticExpression; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/FormActionBindingTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/FormActionBindingTests.java index 29240a93..317f064e 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/FormActionBindingTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/FormActionBindingTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.mock.web.MockServletContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/FormActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/FormActionTests.java index cbf211e6..455bc83f 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/FormActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/FormActionTests.java @@ -15,16 +15,16 @@ */ package org.springframework.webflow.action; -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.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.validation.BindException; import org.springframework.validation.BindingResult; import org.springframework.validation.Errors; @@ -88,7 +88,7 @@ public class FormActionTests { private FormAction action; - @Before + @BeforeEach public void setUp() throws Exception { action = createFormAction("test"); } @@ -368,8 +368,8 @@ public class FormActionTests { assertTrue(formObject instanceof OtherTestBean); assertSame(freshBean, formObject); - assertTrue("Expected OtherTestBean, but was " + errors.getTarget().getClass(), - errors.getTarget() instanceof OtherTestBean); + assertTrue(errors.getTarget() instanceof OtherTestBean, + "Expected OtherTestBean, but was " + errors.getTarget().getClass()); assertSame(formObject, errors.getTarget()); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/MultiActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/MultiActionTests.java index 6486d3be..221deb1e 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/MultiActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/MultiActionTests.java @@ -15,10 +15,10 @@ */ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.action.DispatchMethodInvoker.MethodLookupException; import org.springframework.webflow.action.MultiAction.MethodResolver; import org.springframework.webflow.engine.StubViewFactory; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/RenderActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/RenderActionTests.java index 9cfc382c..da6b48ae 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/RenderActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/RenderActionTests.java @@ -1,9 +1,9 @@ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.Expression; import org.springframework.binding.expression.support.StaticExpression; import org.springframework.webflow.execution.Event; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/ResultObjectBasedEventFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/ResultObjectBasedEventFactoryTests.java index 97c57dcb..975443ea 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/ResultObjectBasedEventFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/ResultObjectBasedEventFactoryTests.java @@ -15,13 +15,13 @@ */ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.fail; import java.util.Date; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.Event; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/ResultObjectEventFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/ResultObjectEventFactoryTests.java index 8e96ccce..08b6c890 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/ResultObjectEventFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/ResultObjectEventFactoryTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.action; -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.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.Event; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/SetActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/SetActionTests.java index 6bf072a0..fd92cfb0 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/SetActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/SetActionTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.support.StaticExpression; import org.springframework.webflow.execution.Event; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/action/SuccessEventFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/action/SuccessEventFactoryTests.java index df772153..0ea5517f 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/action/SuccessEventFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/action/SuccessEventFactoryTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.action; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.Event; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowBuilderServicesConfigurationTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowBuilderServicesConfigurationTests.java index 0292eabc..2fca5383 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowBuilderServicesConfigurationTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowBuilderServicesConfigurationTests.java @@ -1,14 +1,14 @@ package org.springframework.webflow.config; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.convert.ConversionException; import org.springframework.binding.convert.ConversionExecutionException; import org.springframework.binding.convert.ConversionExecutor; @@ -33,7 +33,7 @@ public abstract class AbstractFlowBuilderServicesConfigurationTests { protected FlowBuilderServices builderServices; - @Before + @BeforeEach public void setUp() { context = initApplicationContext(); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowExecutorConfigurationTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowExecutorConfigurationTests.java index 13a4c271..a2506ae5 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowExecutorConfigurationTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowExecutorConfigurationTests.java @@ -1,10 +1,10 @@ package org.springframework.webflow.config; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.ApplicationContext; import org.springframework.webflow.conversation.Conversation; import org.springframework.webflow.conversation.ConversationException; @@ -23,7 +23,7 @@ public abstract class AbstractFlowExecutorConfigurationTests { private ApplicationContext context; - @Before + @BeforeEach public void setUp() { context = initApplicationContext(); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowRegistryConfigurationTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowRegistryConfigurationTests.java index dd339f3b..ddf3986a 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowRegistryConfigurationTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/AbstractFlowRegistryConfigurationTests.java @@ -1,11 +1,11 @@ package org.springframework.webflow.config; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.ApplicationContext; import org.springframework.webflow.definition.FlowDefinition; import org.springframework.webflow.definition.registry.FlowDefinitionConstructionException; @@ -18,7 +18,7 @@ public abstract class AbstractFlowRegistryConfigurationTests { protected FlowDefinitionRegistry registry; - @Before + @BeforeEach public void setUp() { this.context = initApplicationContext(); this.registry = (FlowDefinitionRegistry) context.getBean("flowRegistry"); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowDefinitionResourceFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowDefinitionResourceFactoryTests.java index 213c4bac..8624fc64 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowDefinitionResourceFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowDefinitionResourceFactoryTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.config; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.net.MalformedURLException; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; @@ -38,7 +38,7 @@ public class FlowDefinitionResourceFactoryTests { private FlowDefinitionResourceFactory factory; - @Before + @BeforeEach public void setUp() throws Exception { resourceLoader = new ServletContextResourceLoader(new MockServletContext()); factory = new FlowDefinitionResourceFactory(); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowExecutorFactoryBeanTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowExecutorFactoryBeanTests.java index a73cd3e6..dfea70f6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowExecutorFactoryBeanTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowExecutorFactoryBeanTests.java @@ -3,8 +3,8 @@ package org.springframework.webflow.config; import java.util.HashSet; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.engine.EndState; import org.springframework.webflow.engine.Flow; import org.springframework.webflow.engine.StubViewFactory; @@ -17,7 +17,7 @@ import org.springframework.webflow.execution.factory.StaticFlowExecutionListener public class FlowExecutorFactoryBeanTests { private FlowExecutorFactoryBean factoryBean; - @Before + @BeforeEach public void setUp() { factoryBean = new FlowExecutorFactoryBean(); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryBeanDefinitionParserTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryBeanDefinitionParserTests.java index b06f7010..e41f56ab 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryBeanDefinitionParserTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryBeanDefinitionParserTests.java @@ -1,12 +1,12 @@ package org.springframework.webflow.config; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.convert.service.DefaultConversionService; import org.springframework.binding.expression.spel.SpringELExpressionParser; import org.springframework.context.ApplicationContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryFactoryBeanTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryFactoryBeanTests.java index 360b68b2..ec05e317 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryFactoryBeanTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowRegistryFactoryBeanTests.java @@ -1,14 +1,14 @@ package org.springframework.webflow.config; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.HashSet; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.definition.FlowDefinition; import org.springframework.webflow.definition.registry.FlowDefinitionRegistry; import org.springframework.webflow.test.TestFlowBuilderServicesFactory; @@ -16,12 +16,12 @@ import org.springframework.webflow.test.TestFlowBuilderServicesFactory; public class FlowRegistryFactoryBeanTests { private FlowRegistryFactoryBean factoryBean; - @Before + @BeforeEach public void setUp() { factoryBean = new FlowRegistryFactoryBean(); } - @After + @AfterEach public void tearDown() throws Exception { factoryBean.destroy(); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/AbstractAjaxHandlerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/AbstractAjaxHandlerTests.java index c3f1f205..276f5812 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/AbstractAjaxHandlerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/AbstractAjaxHandlerTests.java @@ -1,13 +1,13 @@ package org.springframework.webflow.context.servlet; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; @@ -16,7 +16,7 @@ public class AbstractAjaxHandlerTests { private MockHttpServletRequest request; private MockHttpServletResponse response; - @Before + @BeforeEach public void setUp() throws Exception { request = new MockHttpServletRequest(); response = new MockHttpServletResponse(); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/DefaultFlowUrlHandlerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/DefaultFlowUrlHandlerTests.java index 56623129..1f626c0b 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/DefaultFlowUrlHandlerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/DefaultFlowUrlHandlerTests.java @@ -1,10 +1,10 @@ package org.springframework.webflow.context.servlet; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.LinkedHashMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.webflow.core.collection.CollectionUtils; import org.springframework.webflow.core.collection.LocalAttributeMap; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/FilenameFlowUrlHandlerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/FilenameFlowUrlHandlerTests.java index 9b97b90a..a002a39c 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/FilenameFlowUrlHandlerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/FilenameFlowUrlHandlerTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.context.servlet; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; public class FilenameFlowUrlHandlerTests { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletContextMapTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletContextMapTests.java index f14ec358..ea3728b4 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletContextMapTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletContextMapTests.java @@ -15,16 +15,16 @@ */ package org.springframework.webflow.context.servlet; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.HashMap; import java.util.Map; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockServletContext; /** @@ -39,7 +39,7 @@ public class HttpServletContextMapTests { private MockServletContext context; - @Before + @BeforeEach public void setUp() throws Exception { context = new MockServletContext(); // a fresh MockServletContext seems to already contain an element; @@ -49,7 +49,7 @@ public class HttpServletContextMapTests { tested.put("SomeKey", "SomeValue"); } - @After + @AfterEach public void tearDown() throws Exception { context = null; tested = null; @@ -58,24 +58,24 @@ public class HttpServletContextMapTests { @Test public void testIsEmpty() { tested.remove("SomeKey"); - assertEquals("size,", 0, tested.size()); - assertEquals("isEmpty,", true, tested.isEmpty()); + assertEquals(0, tested.size(), "size,"); + assertEquals(true, tested.isEmpty(), "isEmpty,"); } @Test public void testSizeAddOne() { - assertEquals("size,", 1, tested.size()); + assertEquals(1, tested.size(), "size,"); } @Test public void testSizeAddTwo() { tested.put("SomeOtherKey", "SomeOtherValue"); - assertEquals("size,", 2, tested.size()); + assertEquals(2, tested.size(), "size,"); } @Test public void testContainsKey() { - assertEquals("containsKey,", true, tested.containsKey("SomeKey")); + assertEquals(true, tested.containsKey("SomeKey"), "containsKey,"); } @Test @@ -85,23 +85,23 @@ public class HttpServletContextMapTests { @Test public void testGet() { - assertEquals("get,", "SomeValue", tested.get("SomeKey")); + assertEquals("SomeValue", tested.get("SomeKey"), "get,"); } @Test public void testPut() { Object old = tested.put("SomeKey", "SomeNewValue"); - assertEquals("old value,", "SomeValue", old); - assertEquals("new value,", "SomeNewValue", tested.get("SomeKey")); + assertEquals("SomeValue", old, "old value,"); + assertEquals("SomeNewValue", tested.get("SomeKey"), "new value,"); } @Test public void testRemove() { Object old = tested.remove("SomeKey"); - assertEquals("old value,", "SomeValue", old); - assertNull("should be gone", tested.get("SomeKey")); + assertEquals("SomeValue", old, "old value,"); + assertNull(tested.get("SomeKey"), "should be gone"); } @Test diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletRequestMapTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletRequestMapTests.java index a406eddc..d25569af 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletRequestMapTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletRequestMapTests.java @@ -15,16 +15,16 @@ */ package org.springframework.webflow.context.servlet; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Iterator; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; /** @@ -38,13 +38,13 @@ public class HttpServletRequestMapTests { private MockHttpServletRequest request; - @Before + @BeforeEach public void setUp() throws Exception { request = new MockHttpServletRequest(); tested = new HttpServletRequestMap(request); } - @After + @AfterEach public void tearDown() throws Exception { request = null; tested = null; @@ -79,8 +79,8 @@ public class HttpServletRequestMapTests { request.removeAttribute("javax.servlet.context.tempdir"); // perform test Iterator names = tested.getAttributeNames(); - assertNotNull("Null result unexpected", names); - assertTrue("More elements", names.hasNext()); + assertNotNull(names, "Null result unexpected"); + assertTrue(names.hasNext(), "More elements"); String name = names.next(); assertEquals("Some key", name); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletRequestParameterMapTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletRequestParameterMapTests.java index c2b4af72..1186b9c8 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletRequestParameterMapTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpServletRequestParameterMapTests.java @@ -15,16 +15,16 @@ */ package org.springframework.webflow.context.servlet; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.Iterator; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; /** @@ -38,13 +38,13 @@ public class HttpServletRequestParameterMapTests { private MockHttpServletRequest request; - @Before + @BeforeEach public void setUp() throws Exception { request = new MockHttpServletRequest(); tested = new HttpServletRequestParameterMap(request); } - @After + @AfterEach public void tearDown() throws Exception { request = null; tested = null; @@ -86,8 +86,8 @@ public class HttpServletRequestParameterMapTests { request.setParameter("Some param", "Some value"); // perform test Iterator names = tested.getAttributeNames(); - assertNotNull("Null result unexpected", names); - assertTrue("More elements", names.hasNext()); + assertNotNull(names, "Null result unexpected"); + assertTrue(names.hasNext(), "More elements"); String name = names.next(); assertEquals("Some param", name); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpSessionMapTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpSessionMapTests.java index 8d58176b..35ba17bb 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpSessionMapTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/HttpSessionMapTests.java @@ -15,18 +15,18 @@ */ package org.springframework.webflow.context.servlet; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Iterator; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.web.util.WebUtils; @@ -41,13 +41,13 @@ public class HttpSessionMapTests { private MockHttpServletRequest request; - @Before + @BeforeEach public void setUp() throws Exception { request = new MockHttpServletRequest(); tested = new HttpSessionMap(request); } - @After + @AfterEach public void tearDown() throws Exception { request = null; tested = null; @@ -66,7 +66,7 @@ public class HttpSessionMapTests { request.setSession(null); // perform test Object result = tested.getAttribute("Some key"); - assertNull("No value expected", result); + assertNull(result, "No value expected"); } @Test @@ -97,8 +97,8 @@ public class HttpSessionMapTests { request.getSession().setAttribute("Some key", "Some value"); // perform test Iterator names = tested.getAttributeNames(); - assertNotNull("Null result unexpected", names); - assertTrue("More elements", names.hasNext()); + assertNotNull(names, "Null result unexpected"); + assertTrue(names.hasNext(), "More elements"); String name = names.next(); assertEquals("Some key", name); } @@ -108,8 +108,8 @@ public class HttpSessionMapTests { request.setSession(null); // perform test Iterator names = tested.getAttributeNames(); - assertNotNull("Null result unexpected", names); - assertFalse("No elements expected", names.hasNext()); + assertNotNull(names, "Null result unexpected"); + assertFalse(names.hasNext(), "No elements expected"); } @Test diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/ServletExternalContextTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/ServletExternalContextTests.java index b25ac8f3..fdad8383 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/ServletExternalContextTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/ServletExternalContextTests.java @@ -15,17 +15,17 @@ */ package org.springframework.webflow.context.servlet; -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.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.io.Writer; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.mock.web.MockServletContext; @@ -44,7 +44,7 @@ public class ServletExternalContextTests { private ServletExternalContext context; - @Before + @BeforeEach public void setUp() { servletContext = new MockServletContext(); servletContext.setAttribute("aFoo", "bar"); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/WebFlow1FlowUrlHandlerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/WebFlow1FlowUrlHandlerTests.java index 4895a6e8..1140da7d 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/WebFlow1FlowUrlHandlerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/servlet/WebFlow1FlowUrlHandlerTests.java @@ -1,10 +1,10 @@ package org.springframework.webflow.context.servlet; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.LinkedHashMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.webflow.core.collection.CollectionUtils; import org.springframework.webflow.core.collection.LocalAttributeMap; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/web/HttpSessionMapBindingListenerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/context/web/HttpSessionMapBindingListenerTests.java index 1e72d133..49b66793 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/web/HttpSessionMapBindingListenerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/context/web/HttpSessionMapBindingListenerTests.java @@ -15,16 +15,16 @@ */ package org.springframework.webflow.context.web; -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.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.webflow.context.servlet.HttpSessionMap; import org.springframework.webflow.core.collection.AttributeMapBindingEvent; @@ -41,7 +41,7 @@ public class HttpSessionMapBindingListenerTests { private HttpSession session; private TestAttributeMapBindingListener value; - @Before + @BeforeEach public void setUp() throws Exception { request = new MockHttpServletRequest(); session = request.getSession(true); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/conversation/impl/SessionBindingConversationManagerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/conversation/impl/SessionBindingConversationManagerTests.java index 848c7495..288166ff 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/conversation/impl/SessionBindingConversationManagerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/conversation/impl/SessionBindingConversationManagerTests.java @@ -15,20 +15,20 @@ */ package org.springframework.webflow.conversation.impl; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.fail; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.context.ExternalContextHolder; import org.springframework.webflow.conversation.Conversation; import org.springframework.webflow.conversation.ConversationException; @@ -44,12 +44,12 @@ public class SessionBindingConversationManagerTests { private SessionBindingConversationManager conversationManager; - @Before + @BeforeEach public void setUp() throws Exception { conversationManager = new SessionBindingConversationManager(); } - @After + @AfterEach public void tearDown() throws Exception { ExternalContextHolder.setExternalContext(null); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/core/collection/CollectionUtilsTests.java b/spring-webflow/src/test/java/org/springframework/webflow/core/collection/CollectionUtilsTests.java index 5052bbfd..7ff0a4ca 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/core/collection/CollectionUtilsTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/core/collection/CollectionUtilsTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.core.collection; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link CollectionUtils}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalAttributeMapTests.java b/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalAttributeMapTests.java index 37347310..2daa18b6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalAttributeMapTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalAttributeMapTests.java @@ -15,22 +15,22 @@ */ package org.springframework.webflow.core.collection; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.math.BigDecimal; import java.util.LinkedList; import java.util.List; import java.util.Map; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link LocalAttributeMap}. @@ -39,7 +39,7 @@ public class LocalAttributeMapTests { private LocalAttributeMap attributeMap = new LocalAttributeMap<>(); - @Before + @BeforeEach public void setUp() { attributeMap.put("string", "A string"); attributeMap.put("integer", 12345); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalParameterMapTests.java b/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalParameterMapTests.java index d23fcf56..76fd194a 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalParameterMapTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/core/collection/LocalParameterMapTests.java @@ -15,18 +15,18 @@ */ package org.springframework.webflow.core.collection; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.HashMap; import java.util.Map; import org.easymock.EasyMock; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.web.multipart.MultipartFile; /** @@ -36,7 +36,7 @@ public class LocalParameterMapTests { private LocalParameterMap parameterMap; - @Before + @BeforeEach public void setUp() { Map map = new HashMap<>(); map.put("string", "A string"); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/definition/registry/FlowDefinitionRegistryImplTests.java b/spring-webflow/src/test/java/org/springframework/webflow/definition/registry/FlowDefinitionRegistryImplTests.java index ff5cc85d..8f63df2d 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/definition/registry/FlowDefinitionRegistryImplTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/definition/registry/FlowDefinitionRegistryImplTests.java @@ -15,14 +15,14 @@ */ package org.springframework.webflow.definition.registry; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.ApplicationContext; import org.springframework.webflow.core.collection.MutableAttributeMap; import org.springframework.webflow.definition.FlowDefinition; @@ -39,7 +39,7 @@ public class FlowDefinitionRegistryImplTests { private BarFlow barFlow; - @Before + @BeforeEach public void setUp() { fooFlow = new FooFlow(); barFlow = new BarFlow(); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/ActionExecutorTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/ActionExecutorTests.java index 63c0d6c6..39dcc8da 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/ActionExecutorTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/ActionExecutorTests.java @@ -15,14 +15,14 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.ActionExecutionException; import org.springframework.webflow.execution.ActionExecutor; import org.springframework.webflow.execution.Event; @@ -36,7 +36,7 @@ public class ActionExecutorTests { private State state; private Flow flow; - @Before + @BeforeEach public void setUp() throws Exception { flow = new Flow("myFlow"); state = new EndState(flow, "end"); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/ActionStateTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/ActionStateTests.java index e1b79201..f0926fb0 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/ActionStateTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/ActionStateTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.engine.support.DefaultTargetStateResolver; import org.springframework.webflow.engine.support.MockTransitionCriteria; import org.springframework.webflow.execution.Action; @@ -36,7 +36,7 @@ public class ActionStateTests { private ActionState state; private MockRequestControlContext context; - @Before + @BeforeEach public void setUp() { flow = new Flow("myFlow"); state = new ActionState(flow, "actionState"); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/AnnotatedObjectTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/AnnotatedObjectTests.java index b67761e5..1a635747 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/AnnotatedObjectTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/AnnotatedObjectTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.core.AnnotatedObject; public class AnnotatedObjectTests { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/AnnotedActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/AnnotedActionTests.java index 4e3bd8b4..db778a16 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/AnnotedActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/AnnotedActionTests.java @@ -15,10 +15,10 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.action.AbstractAction; import org.springframework.webflow.execution.AnnotatedAction; import org.springframework.webflow.execution.Event; @@ -32,7 +32,7 @@ public class AnnotedActionTests { private MockRequestContext context; - @Before + @BeforeEach public void setUp() throws Exception { Flow flow = new Flow("myFlow"); context = new MockRequestContext(flow); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/DecisionStateTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/DecisionStateTests.java index 34186c72..68581dc9 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/DecisionStateTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/DecisionStateTests.java @@ -15,10 +15,10 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.engine.support.DefaultTargetStateResolver; import org.springframework.webflow.engine.support.MockTransitionCriteria; import org.springframework.webflow.execution.Event; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/EndStateTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/EndStateTests.java index b4f7be9e..3f1cac14 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/EndStateTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/EndStateTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.EvaluationException; import org.springframework.binding.expression.Expression; import org.springframework.binding.expression.ExpressionParser; @@ -52,7 +52,7 @@ public class EndStateTests { EndState state = new EndState(flow, "end"); MockRequestControlContext context = new MockRequestControlContext(flow); state.enter(context); - assertFalse("Active", context.getFlowExecutionContext().isActive()); + assertFalse(context.getFlowExecutionContext().isActive(), "Active"); } @Test @@ -121,7 +121,7 @@ public class EndStateTests { MockRequestControlContext context = new MockRequestControlContext(new MockFlowExecutionContext(session)); state.enter(context); - assertFalse("Active", context.getFlowExecutionContext().isActive()); + assertFalse(context.getFlowExecutionContext().isActive(), "Active"); } protected static TransitionCriteria on(String event) { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/EventTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/EventTests.java index 7cecc9ae..f7e90836 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/EventTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/EventTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.core.collection.LocalAttributeMap; import org.springframework.webflow.execution.Event; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowExecutionHandlerSetTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowExecutionHandlerSetTests.java index e25c2757..915ea7f1 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowExecutionHandlerSetTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowExecutionHandlerSetTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.FlowExecutionException; import org.springframework.webflow.test.MockRequestControlContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowTests.java index f7aba743..19f2fcb1 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowTests.java @@ -15,16 +15,16 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.ArrayList; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.Expression; import org.springframework.binding.expression.ExpressionParser; import org.springframework.binding.expression.support.FluentParserContext; @@ -70,14 +70,14 @@ public class FlowTests { Flow flow = new Flow("myFlow"); new EndState(flow, "myState1"); new EndState(flow, "myState2"); - assertEquals("Wrong start state:", "myState1", flow.getStartState().getId()); - assertEquals("State count wrong:", 2, flow.getStateCount()); + assertEquals("myState1", flow.getStartState().getId(), "Wrong start state:"); + assertEquals(2, flow.getStateCount(), "State count wrong:"); assertTrue(flow.containsState("myState1")); assertTrue(flow.containsState("myState2")); State state = flow.getStateInstance("myState1"); - assertEquals("Wrong flow:", flow.getId(), state.getFlow().getId()); - assertEquals("Wrong state:", "myState1", flow.getState("myState1").getId()); - assertEquals("Wrong state:", "myState2", flow.getState("myState2").getId()); + assertEquals(flow.getId(), state.getFlow().getId(), "Wrong flow:"); + assertEquals("myState1", flow.getState("myState1").getId(), "Wrong state:"); + assertEquals("myState2", flow.getState("myState2").getId(), "Wrong state:"); } @Test @@ -102,7 +102,7 @@ public class FlowTests { } catch (IllegalArgumentException e) { } - assertEquals("State count wrong:", 1, flow.getStateCount()); + assertEquals(1, flow.getStateCount(), "State count wrong:"); } @Test @@ -141,8 +141,8 @@ public class FlowTests { @Test public void testGetTransitionableState() { - assertEquals("Wrong state:", "myState1", flow.getTransitionableState("myState1").getId()); - assertEquals("Wrong state:", "myState1", flow.getState("myState1").getId()); + assertEquals("myState1", flow.getTransitionableState("myState1").getId(), "Wrong state:"); + assertEquals("myState1", flow.getState("myState1").getId(), "Wrong state:"); } @Test @@ -189,7 +189,7 @@ public class FlowTests { public void testStart() { MockRequestControlContext context = new MockRequestControlContext(flow); flow.start(context, new LocalAttributeMap<>()); - assertEquals("Wrong start state", "myState1", context.getCurrentState().getId()); + assertEquals("myState1", context.getCurrentState().getId(), "Wrong start state"); } @Test @@ -210,7 +210,7 @@ public class FlowTests { TestAction action = new TestAction(); flow.getStartActionList().add(action); flow.start(context, new LocalAttributeMap<>()); - assertEquals("Wrong start state", "myState1", context.getCurrentState().getId()); + assertEquals("myState1", context.getCurrentState().getId(), "Wrong start state"); assertEquals(1, action.getExecutionCount()); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowVariableTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowVariableTests.java index 1b77eafe..944fd0f4 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowVariableTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/FlowVariableTests.java @@ -1,10 +1,10 @@ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.RequestContext; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/StateTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/StateTests.java index f45336c1..e238c50e 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/StateTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/StateTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.FlowExecutionException; import org.springframework.webflow.execution.TestAction; import org.springframework.webflow.test.MockRequestControlContext; @@ -40,7 +40,7 @@ public class StateTests { private boolean handled; - @Before + @BeforeEach public void setUp() { flow = new Flow("flow"); state = new State(flow, "myState") { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/SubflowStateTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/SubflowStateTests.java index 4f5344dc..362af257 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/SubflowStateTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/SubflowStateTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.Collections; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.EvaluationException; import org.springframework.binding.expression.support.AbstractGetValueExpression; import org.springframework.binding.mapping.impl.DefaultMappingResults; @@ -45,7 +45,7 @@ public class SubflowStateTests { private Flow subflow; private MockRequestControlContext context; - @Before + @BeforeEach public void setUp() { parentFlow = new Flow("parent"); subflow = new Flow("child"); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/TransitionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/TransitionTests.java index 7e6c06b4..4f905464 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/TransitionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/TransitionTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.engine; -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.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.engine.support.DefaultTargetStateResolver; import org.springframework.webflow.execution.FlowExecutionException; import org.springframework.webflow.test.MockRequestControlContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewStateTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewStateTests.java index 8a7c9192..9cc42955 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewStateTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewStateTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.engine; -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.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.TestBean; import org.springframework.webflow.engine.support.ActionTransitionCriteria; import org.springframework.webflow.engine.support.DefaultTargetStateResolver; @@ -45,7 +45,7 @@ public class ViewStateTests { MockRequestControlContext context = new MockRequestControlContext(flow); context.getFlashScope().put("foo", "bar"); state.enter(context); - assertTrue("Render not called", context.getFlowScope().contains("renderCalled")); + assertTrue(context.getFlowScope().contains("renderCalled"), "Render not called"); assertTrue(context.getExternalContext().isResponseComplete()); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertFalse(context.getFlashScope().contains("foo")); @@ -60,7 +60,7 @@ public class ViewStateTests { context.getMockExternalContext().setResponseAllowed(false); context.getFlashScope().put("foo", "bar"); state.enter(context); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertTrue(context.getExternalContext().isResponseComplete()); assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertTrue(context.getFlashScope().contains("foo")); @@ -75,7 +75,7 @@ public class ViewStateTests { context.getExternalContext().recordResponseComplete(); context.getFlashScope().put("foo", "bar"); state.enter(context); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertFalse(context.getFlashScope().contains("foo")); } @@ -89,7 +89,7 @@ public class ViewStateTests { context.getExternalContext().requestFlowExecutionRedirect(); context.getFlashScope().put("foo", "bar"); state.enter(context); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertTrue(context.getFlashScope().contains("foo")); } @@ -110,7 +110,7 @@ public class ViewStateTests { MockRequestControlContext context = new MockRequestControlContext(flow); state.enter(context); assertEquals("bar", context.getViewScope().getString("foo")); - assertTrue("Render not called", context.getFlowScope().contains("renderCalled")); + assertTrue(context.getFlowScope().contains("renderCalled"), "Render not called"); assertTrue(context.getExternalContext().isResponseComplete()); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); } @@ -124,7 +124,7 @@ public class ViewStateTests { MockRequestControlContext context = new MockRequestControlContext(flow); context.getFlashScope().put("foo", "bar"); state.enter(context); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertTrue(context.getFlashScope().contains("foo")); } @@ -138,7 +138,7 @@ public class ViewStateTests { MockRequestControlContext context = new MockRequestControlContext(flow); context.getFlashScope().put("foo", "bar"); state.enter(context); - assertTrue("Render called", context.getFlowScope().contains("renderCalled")); + assertTrue(context.getFlowScope().contains("renderCalled"), "Render not called"); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertFalse(context.getFlashScope().contains("foo")); } @@ -153,7 +153,7 @@ public class ViewStateTests { MockRequestControlContext context = new MockRequestControlContext(flow); context.getFlashScope().put("foo", "bar"); state.enter(context); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertTrue(context.getMockExternalContext().getRedirectInPopup()); assertTrue(context.getFlashScope().contains("foo")); @@ -168,7 +168,7 @@ public class ViewStateTests { context.getFlashScope().put("foo", "bar"); context.setAlwaysRedirectOnPause(true); state.enter(context); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertTrue(context.getFlashScope().contains("foo")); } @@ -183,7 +183,7 @@ public class ViewStateTests { context = new MockRequestControlContext(context.getFlowExecutionContext()); context.getFlashScope().put("foo", "bar"); state.resume(context); - assertTrue("Render not called", context.getFlowScope().contains("renderCalled")); + assertTrue(context.getFlowScope().contains("renderCalled"), "Render not called"); assertTrue(context.getExternalContext().isResponseComplete()); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertFalse(context.getFlashScope().contains("foo")); @@ -203,7 +203,7 @@ public class ViewStateTests { context.getFlashScope().put("foo", "bar"); context.getExternalContext().recordResponseComplete(); state.resume(context); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertFalse(context.getFlashScope().contains("foo")); } @@ -226,7 +226,7 @@ public class ViewStateTests { state.enter(context); context = new MockRequestControlContext(context.getFlowExecutionContext()); state.resume(context); - assertTrue("Render not called", context.getFlowScope().contains("renderCalled")); + assertTrue(context.getFlowScope().contains("renderCalled"), "Render not called"); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertEquals("Restored", ((TestBean) context.getViewScope().get("foo")).datum1); } @@ -307,7 +307,7 @@ public class ViewStateTests { assertTrue(context.getFlowExecutionContext().isActive()); assertEquals(1, action.getExecutionCount()); assertTrue(context.getExternalContext().isResponseComplete()); - assertTrue("Render not called", context.getFlowScope().contains("renderCalled")); + assertTrue(context.getFlowScope().contains("renderCalled"), "Render not called"); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertFalse(context.getFlashScope().contains("foo")); assertFalse(context.getFlashScope().contains(View.USER_EVENT_STATE_ATTRIBUTE)); @@ -330,7 +330,7 @@ public class ViewStateTests { state.resume(context); assertTrue(context.getFlowExecutionContext().isActive()); assertTrue(context.getExternalContext().isResponseComplete()); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertEquals(StubViewFactory.USER_EVENT_STATE, context.getFlashScope().get(View.USER_EVENT_STATE_ATTRIBUTE)); assertTrue(context.getFlashScope().contains("foo")); @@ -355,7 +355,7 @@ public class ViewStateTests { state.resume(context); assertTrue(context.getFlowExecutionContext().isActive()); assertEquals(1, action.getExecutionCount()); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertEquals(StubViewFactory.USER_EVENT_STATE, context.getFlashScope().get(View.USER_EVENT_STATE_ATTRIBUTE)); assertTrue(context.getFlashScope().contains("foo")); @@ -381,7 +381,7 @@ public class ViewStateTests { assertTrue(context.getFlowExecutionContext().isActive()); assertEquals(1, action.getExecutionCount()); assertTrue(context.getExternalContext().isResponseComplete()); - assertTrue("Render not called", context.getFlowScope().contains("renderCalled")); + assertTrue(context.getFlowScope().contains("renderCalled"), "Render not called"); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertFalse(context.getFlashScope().contains("foo")); assertFalse(context.getFlashScope().contains(View.USER_EVENT_STATE_ATTRIBUTE)); @@ -404,7 +404,7 @@ public class ViewStateTests { state.getTransitionSet().add(t); MockRequestControlContext context = new MockRequestControlContext(flow); state.enter(context); - assertTrue("Render not called", context.getFlowScope().contains("renderCalled")); + assertTrue(context.getFlowScope().contains("renderCalled"), "Render not called"); context.getFlowScope().remove("renderCalled"); context = new MockRequestControlContext(context.getFlowExecutionContext()); context.putRequestParameter("_eventId", "submit"); @@ -413,7 +413,7 @@ public class ViewStateTests { assertTrue(context.getFlowExecutionContext().isActive()); assertEquals(1, action.getExecutionCount()); assertTrue(context.getExternalContext().isResponseComplete()); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertFalse(context.getFlashScope().contains("foo")); assertFalse(context.getFlashScope().contains(View.USER_EVENT_STATE_ATTRIBUTE)); @@ -436,7 +436,7 @@ public class ViewStateTests { state.getTransitionSet().add(t); MockRequestControlContext context = new MockRequestControlContext(flow); state.enter(context); - assertTrue("Render not called", context.getFlowScope().contains("renderCalled")); + assertTrue(context.getFlowScope().contains("renderCalled"), "Render not called"); context.getFlowScope().remove("renderCalled"); context = new MockRequestControlContext(context.getFlowExecutionContext()); context.putRequestParameter("_eventId", "submit"); @@ -445,7 +445,7 @@ public class ViewStateTests { assertTrue(context.getFlowExecutionContext().isActive()); assertEquals(1, action.getExecutionCount()); assertTrue(context.getExternalContext().isResponseComplete()); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); + assertFalse(context.getFlowScope().contains("renderCalled"), "Render called"); assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested()); assertTrue(context.getFlashScope().contains("foo")); assertEquals(StubViewFactory.USER_EVENT_STATE, context.getFlashScope().get(View.USER_EVENT_STATE_ATTRIBUTE)); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewVariableTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewVariableTests.java index fe1d2c6f..115037e4 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewVariableTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewVariableTests.java @@ -1,10 +1,10 @@ package org.springframework.webflow.engine; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.RequestContext; import org.springframework.webflow.test.MockRequestControlContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/DefaultFlowHolderTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/DefaultFlowHolderTests.java index 4f9072c6..7ef1e0dc 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/DefaultFlowHolderTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/DefaultFlowHolderTests.java @@ -1,9 +1,9 @@ package org.springframework.webflow.engine.builder; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.support.StaticApplicationContext; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; @@ -17,7 +17,7 @@ public class DefaultFlowHolderTests { private DefaultFlowHolder holder; private FlowAssembler assembler; - @Before + @BeforeEach public void setUp() { MockFlowBuilderContext context = new MockFlowBuilderContext("flowId"); context.getFlowBuilderServices().setApplicationContext(new StaticApplicationContext()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/FlowAssemblerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/FlowAssemblerTests.java index f2c1a73d..06af42e6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/FlowAssemblerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/FlowAssemblerTests.java @@ -1,11 +1,11 @@ package org.springframework.webflow.engine.builder; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import org.easymock.EasyMock; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.engine.Flow; import org.springframework.webflow.test.MockFlowBuilderContext; @@ -14,7 +14,7 @@ public class FlowAssemblerTests { private FlowAssembler assembler; private FlowBuilderContext builderContext; - @Before + @BeforeEach public void setUp() { builder = EasyMock.createMock(FlowBuilder.class); builderContext = new MockFlowBuilderContext("search"); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilderTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilderTests.java index e878e7ff..35dbf9b6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilderTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/model/FlowModelFlowBuilderTests.java @@ -1,16 +1,16 @@ package org.springframework.webflow.engine.builder.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.Arrays; import java.util.LinkedList; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.support.StaticListableBeanFactory; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; @@ -57,7 +57,7 @@ import org.springframework.webflow.test.MockRequestContext; public class FlowModelFlowBuilderTests { private FlowModel model; - @Before + @BeforeEach public void setUp() { StaticListableBeanFactory beanFactory = new StaticListableBeanFactory(); beanFactory.addBean("bean", new Object()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTargetStateResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTargetStateResolverTests.java index 468d1491..5f738ab8 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTargetStateResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTargetStateResolverTests.java @@ -15,10 +15,10 @@ */ package org.springframework.webflow.engine.builder.support; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.engine.TargetStateResolver; import org.springframework.webflow.engine.Transition; import org.springframework.webflow.test.MockFlowBuilderContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTransitionCriteriaTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTransitionCriteriaTests.java index fec351f8..bc95feca 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTransitionCriteriaTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTransitionCriteriaTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.engine.builder.support; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.support.StaticExpression; import org.springframework.webflow.engine.Flow; import org.springframework.webflow.engine.TransitionCriteria; @@ -36,7 +36,7 @@ public class TextToTransitionCriteriaTests { private MockFlowBuilderContext serviceLocator = new MockFlowBuilderContext("flowId"); private TextToTransitionCriteria converter = new TextToTransitionCriteria(serviceLocator); - @After + @AfterEach public void tearDown() { RequestContextHolder.setRequestContext(null); } @@ -47,7 +47,7 @@ public class TextToTransitionCriteriaTests { TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass(expression, TransitionCriteria.class); RequestContext ctx = getRequestContext(); - assertTrue("Criterion should evaluate to true", criterion.test(ctx)); + assertTrue(criterion.test(ctx), "Criterion should evaluate to true"); assertSame(WildcardTransitionCriteria.INSTANCE, converter.convertSourceToTargetClass("*", TransitionCriteria.class)); assertSame(WildcardTransitionCriteria.INSTANCE, @@ -62,7 +62,7 @@ public class TextToTransitionCriteriaTests { TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass(expression, TransitionCriteria.class); RequestContext ctx = getRequestContext(); - assertTrue("Criterion should evaluate to true", criterion.test(ctx)); + assertTrue(criterion.test(ctx), "Criterion should evaluate to true"); } @Test @@ -71,7 +71,7 @@ public class TextToTransitionCriteriaTests { TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass(expression, TransitionCriteria.class); RequestContext ctx = getRequestContext(); - assertTrue("Criterion should evaluate to true", criterion.test(ctx)); + assertTrue(criterion.test(ctx), "Criterion should evaluate to true"); } @Test @@ -80,7 +80,7 @@ public class TextToTransitionCriteriaTests { TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass(expression, TransitionCriteria.class); RequestContext ctx = getRequestContext(); - assertFalse("Criterion should evaluate to false", criterion.test(ctx)); + assertFalse(criterion.test(ctx), "Criterion should evaluate to false"); } @Test @@ -90,7 +90,7 @@ public class TextToTransitionCriteriaTests { TransitionCriteria.class); MockRequestContext ctx = getRequestContext(); ctx.setCurrentEvent(new Event(this, "7")); - assertTrue("Criterion should evaluate to true", criterion.test(ctx)); + assertTrue(criterion.test(ctx), "Criterion should evaluate to true"); } @Test @@ -100,7 +100,7 @@ public class TextToTransitionCriteriaTests { TransitionCriteria.class); MockRequestContext ctx = getRequestContext(); ctx.setCurrentEvent(new Event(this, "submit")); - assertTrue("Criterion should evaluate to true", criterion.test(ctx)); + assertTrue(criterion.test(ctx), "Criterion should evaluate to true"); } @Test @@ -110,7 +110,7 @@ public class TextToTransitionCriteriaTests { TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass("doesnt matter", TransitionCriteria.class); RequestContext ctx = getRequestContext(); - assertFalse("Criterion should evaluate to false", criterion.test(ctx)); + assertFalse(criterion.test(ctx), "Criterion should evaluate to false"); } private MockRequestContext getRequestContext() { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java index 1b6e168f..8bce53fe 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java @@ -15,15 +15,15 @@ */ package org.springframework.webflow.engine.impl; -import static org.junit.Assert.assertEquals; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.core.collection.LocalAttributeMap; import org.springframework.webflow.core.collection.MutableAttributeMap; import org.springframework.webflow.definition.FlowDefinition; @@ -64,7 +64,7 @@ public class FlowExecutionImplFactoryTests { private boolean removeAllSnapshotsCalled; - @Before + @BeforeEach public void setUp() { flowDefinition = new Flow("flow"); new EndState(flowDefinition, "end"); @@ -95,7 +95,7 @@ public class FlowExecutionImplFactoryTests { factory.setExecutionAttributes(attributes); FlowExecution execution = factory.createFlowExecution(flowDefinition); assertEquals(attributes, execution.getAttributes()); - assertSame("Flow execution attributes are global", attributes.asMap(), execution.getAttributes().asMap()); + assertSame(attributes.asMap(), execution.getAttributes().asMap(), "Flow execution attributes are global"); } @Test @@ -155,8 +155,8 @@ public class FlowExecutionImplFactoryTests { flowExecution.getFlowSessions().add(session1); flowExecution.getFlowSessions().add(session2); factory.restoreFlowExecution(flowExecution, flowDefinition, flowExecutionKey, conversationScope, locator); - assertSame("Flow execution attributes are global", flowExecution.getAttributes().asMap(), - executionAttributes.asMap()); + assertSame(flowExecution.getAttributes().asMap(), executionAttributes.asMap(), + "Flow execution attributes are global"); assertEquals(1, flowExecution.getListeners().length); assertSame(listener, flowExecution.getListeners()[0]); assertSame(flowExecutionKey, flowExecution.getKey()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplTests.java index 7217e590..5e98f17d 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplTests.java @@ -15,15 +15,15 @@ */ package org.springframework.webflow.engine.impl; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -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.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.message.MessageBuilder; import org.springframework.webflow.core.collection.MutableAttributeMap; import org.springframework.webflow.definition.FlowDefinition; @@ -446,11 +446,11 @@ public class FlowExecutionImplTests { MockExternalContext context = new MockExternalContext(); execution.start(null, context); - assertNull("RequestContext was not released", RequestContextHolder.getRequestContext()); + assertNull(RequestContextHolder.getRequestContext(), "RequestContext was not released"); context = new MockExternalContext(); execution.resume(context); - assertNull("RequestContext was not released", RequestContextHolder.getRequestContext()); + assertNull(RequestContextHolder.getRequestContext(), "RequestContext was not released"); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AbstractModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AbstractModelTests.java index f04c5f92..dda48141 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AbstractModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AbstractModelTests.java @@ -15,13 +15,13 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; import java.util.LinkedList; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link AbstractModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ActionStateModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ActionStateModelTests.java index 1d592034..dfc6ba11 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ActionStateModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ActionStateModelTests.java @@ -15,14 +15,14 @@ */ package org.springframework.webflow.engine.model; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.LinkedList; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link ActionStateModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AttributeModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AttributeModelTests.java index 6018478b..6b85c3c8 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AttributeModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/AttributeModelTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link AttributeModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/BeanImportModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/BeanImportModelTests.java index 5d7f4931..4676d431 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/BeanImportModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/BeanImportModelTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link BeanImportModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/DecisionStateModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/DecisionStateModelTests.java index c32a0795..b594e407 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/DecisionStateModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/DecisionStateModelTests.java @@ -15,13 +15,13 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.LinkedList; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link DecisionStateModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EndStateModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EndStateModelTests.java index 77befa80..4f14c185 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EndStateModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EndStateModelTests.java @@ -15,13 +15,13 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.LinkedList; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link EndStateModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EvaluateModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EvaluateModelTests.java index 6a05f42c..2232d3e6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EvaluateModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/EvaluateModelTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link EvaluateModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ExceptionHandlerModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ExceptionHandlerModelTests.java index 8d3ec84f..b36bf50a 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ExceptionHandlerModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ExceptionHandlerModelTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link ExceptionHandlerModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/FlowModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/FlowModelTests.java index 60940295..a20109a7 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/FlowModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/FlowModelTests.java @@ -15,15 +15,15 @@ */ package org.springframework.webflow.engine.model; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.LinkedList; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link FlowModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/IfModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/IfModelTests.java index 41ab8cef..da67dda5 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/IfModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/IfModelTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link IfModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/InputModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/InputModelTests.java index 1a0eebcc..8d1ae5f1 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/InputModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/InputModelTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link InputModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/OutputModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/OutputModelTests.java index 7c478c14..22f79d67 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/OutputModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/OutputModelTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link OutputModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/PersistenceContextModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/PersistenceContextModelTests.java index 2ee4d128..e19a5c10 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/PersistenceContextModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/PersistenceContextModelTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link PersistenceContextModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/RenderModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/RenderModelTests.java index 9c510ebc..60f9b9f2 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/RenderModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/RenderModelTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link RenderModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SecuredModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SecuredModelTests.java index 9ee6297b..c7be7cb3 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SecuredModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SecuredModelTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link SecuredModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SetModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SetModelTests.java index 2d7a83a0..6ac01aa6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SetModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SetModelTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link SetModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SubflowStateModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SubflowStateModelTests.java index 7094f3e3..75b4bfd9 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SubflowStateModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/SubflowStateModelTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.engine.model; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link SubflowStateModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/TransitionModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/TransitionModelTests.java index 5b90e885..ba10d4bc 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/TransitionModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/TransitionModelTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link TransitionModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/VarModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/VarModelTests.java index a478b63b..df8d2bb1 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/VarModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/VarModelTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.engine.model; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link VarModel}. diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ViewStateModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ViewStateModelTests.java index 3f95571d..dd889271 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ViewStateModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/ViewStateModelTests.java @@ -15,14 +15,14 @@ */ package org.springframework.webflow.engine.model; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.LinkedList; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/builder/xml/WebFlowEntityResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/builder/xml/WebFlowEntityResolverTests.java index 9c9f5e8f..b4e3d570 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/builder/xml/WebFlowEntityResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/builder/xml/WebFlowEntityResolverTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.engine.model.builder.xml; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.xml.sax.InputSource; public class WebFlowEntityResolverTests { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilderTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilderTests.java index 76936cee..29083d55 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilderTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/builder/xml/XmlFlowModelBuilderTests.java @@ -1,14 +1,14 @@ package org.springframework.webflow.engine.model.builder.xml; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.support.StaticListableBeanFactory; import org.springframework.core.io.ClassPathResource; import org.springframework.validation.BindingResult; @@ -40,7 +40,7 @@ public class XmlFlowModelBuilderTests { private FlowModelRegistry registry; - @Before + @BeforeEach public void setUp() { StaticListableBeanFactory beanFactory = new StaticListableBeanFactory(); beanFactory.addBean("bean", new Object()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/DefaultFlowModelHolderTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/DefaultFlowModelHolderTests.java index 5a9916d1..e1772764 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/DefaultFlowModelHolderTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/DefaultFlowModelHolderTests.java @@ -1,13 +1,13 @@ package org.springframework.webflow.engine.model.registry; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import java.util.Collections; import java.util.LinkedList; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.io.Resource; import org.springframework.webflow.engine.model.EndStateModel; import org.springframework.webflow.engine.model.FlowModel; @@ -19,7 +19,7 @@ public class DefaultFlowModelHolderTests { private DefaultFlowModelHolder holder; private FlowModelBuilder builder; - @Before + @BeforeEach public void setUp() { builder = new SimpleFlowBuilder(); holder = new DefaultFlowModelHolder(builder); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImplTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImplTests.java index 48053567..8b2464eb 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImplTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/model/registry/FlowModelRegistryImplTests.java @@ -1,11 +1,11 @@ package org.springframework.webflow.engine.model.registry; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.io.Resource; import org.springframework.webflow.engine.model.FlowModel; @@ -17,7 +17,7 @@ public class FlowModelRegistryImplTests { private FlowModel barFlow; - @Before + @BeforeEach public void setUp() { fooFlow = new FlowModel(); barFlow = new FlowModel(); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/ActionExecutingViewFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/ActionExecutingViewFactoryTests.java index e53c414c..deab6c0b 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/ActionExecutingViewFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/ActionExecutingViewFactoryTests.java @@ -1,13 +1,13 @@ package org.springframework.webflow.engine.support; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.TestAction; import org.springframework.webflow.execution.View; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/ActionTransitionCriteriaTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/ActionTransitionCriteriaTests.java index 282320cf..beb2bfda 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/ActionTransitionCriteriaTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/ActionTransitionCriteriaTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine.support; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.test.MockAction; import org.springframework.webflow.test.MockRequestContext; @@ -29,7 +29,7 @@ public class ActionTransitionCriteriaTests { private ActionTransitionCriteria criteria; - @Before + @BeforeEach public void setUp() throws Exception { action = new MockAction(); criteria = new ActionTransitionCriteria(action); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/BeanFactoryVariableValueFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/BeanFactoryVariableValueFactoryTests.java index ecd991c8..d7ff1a5d 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/BeanFactoryVariableValueFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/BeanFactoryVariableValueFactoryTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.engine.support; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.webflow.TestBean; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/DefaultTargetResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/DefaultTargetResolverTests.java index c419a523..a4a20258 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/DefaultTargetResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/DefaultTargetResolverTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.engine.support; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.support.StaticExpression; import org.springframework.webflow.engine.Transition; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/NotTransitionCriteriaTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/NotTransitionCriteriaTests.java index fca6d8a9..16127cbc 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/NotTransitionCriteriaTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/NotTransitionCriteriaTests.java @@ -15,10 +15,10 @@ */ package org.springframework.webflow.engine.support; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.engine.WildcardTransitionCriteria; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/TransitionCriteriaChainTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/TransitionCriteriaChainTests.java index 0fcb80fe..ecc9eab7 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/TransitionCriteriaChainTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/TransitionCriteriaChainTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.engine.support; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.action.EventFactorySupport; import org.springframework.webflow.engine.TransitionCriteria; import org.springframework.webflow.execution.Action; @@ -38,7 +38,7 @@ public class TransitionCriteriaChainTests { private TransitionCriteriaChain chain; private MockRequestContext context; - @Before + @BeforeEach public void setUp() throws Exception { chain = new TransitionCriteriaChain(); context = new MockRequestContext(); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/TransitionExecutingFlowExecutionExceptionHandlerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/TransitionExecutingFlowExecutionExceptionHandlerTests.java index 5d27eccb..632ed279 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/support/TransitionExecutingFlowExecutionExceptionHandlerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/support/TransitionExecutingFlowExecutionExceptionHandlerTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.engine.support; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.TestException; import org.springframework.webflow.action.AbstractAction; import org.springframework.webflow.core.collection.MutableAttributeMap; @@ -52,7 +52,7 @@ public class TransitionExecutingFlowExecutionExceptionHandlerTests { TransitionableState state; - @Before + @BeforeEach public void setUp() { flow = new Flow("myFlow"); state = new TransitionableState(flow, "state1") { @@ -69,10 +69,10 @@ public class TransitionExecutingFlowExecutionExceptionHandlerTests { handler.add(TestException.class, "state"); FlowExecutionException e = new FlowExecutionException(state.getOwner().getId(), state.getId(), "Oops", new TestException()); - assertTrue("Doesn't handle state exception", handler.canHandle(e)); + assertTrue(handler.canHandle(e), "Doesn't handle state exception"); e = new FlowExecutionException(state.getOwner().getId(), state.getId(), "Oops", new Exception()); - assertFalse("Shouldn't handle exception", handler.canHandle(e)); + assertFalse(handler.canHandle(e), "Shouldn't handle exception"); } @Test @@ -81,9 +81,9 @@ public class TransitionExecutingFlowExecutionExceptionHandlerTests { handler.add(Exception.class, "state"); FlowExecutionException e = new FlowExecutionException(state.getOwner().getId(), state.getId(), "Oops", new TestException()); - assertTrue("Doesn't handle state exception", handler.canHandle(e)); + assertTrue(handler.canHandle(e), "Doesn't handle state exception"); e = new FlowExecutionException(state.getOwner().getId(), state.getId(), "Oops", new RuntimeException()); - assertTrue("Doesn't handle state exception", handler.canHandle(e)); + assertTrue(handler.canHandle(e), "Doesn't handle state exception"); } @Test @@ -104,7 +104,7 @@ public class TransitionExecutingFlowExecutionExceptionHandlerTests { factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener)); FlowExecution execution = factory.createFlowExecution(flow); execution.start(null, new MockExternalContext()); - assertTrue("Should have ended", !execution.isActive()); + assertTrue(!execution.isActive(), "Should have ended"); } @Test diff --git a/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerLoaderTests.java b/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerLoaderTests.java index 8089de08..f3d348f7 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerLoaderTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/ConditionalFlowExecutionListenerLoaderTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.execution.factory; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.engine.Flow; import org.springframework.webflow.execution.FlowExecutionListener; @@ -31,7 +31,7 @@ public class ConditionalFlowExecutionListenerLoaderTests { private FlowExecutionListenerCriteriaFactory criteriaFactory; private ConditionalFlowExecutionListenerLoader loader; - @Before + @BeforeEach public void setUp() { loader = new ConditionalFlowExecutionListenerLoader(); criteriaFactory = new FlowExecutionListenerCriteriaFactory(); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/FlowExecutionListenerCriteriaFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/FlowExecutionListenerCriteriaFactoryTests.java index ae214033..ce07c566 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/FlowExecutionListenerCriteriaFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/FlowExecutionListenerCriteriaFactoryTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.execution.factory; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.engine.Flow; /** diff --git a/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/StaticFlowExecutionListenerLoaderTests.java b/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/StaticFlowExecutionListenerLoaderTests.java index 3b60e9bd..25f1e573 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/StaticFlowExecutionListenerLoaderTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/execution/factory/StaticFlowExecutionListenerLoaderTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.execution.factory; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.engine.Flow; import org.springframework.webflow.execution.FlowExecutionListener; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/DefaultFlowExecutionRepositoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/DefaultFlowExecutionRepositoryTests.java index b13e19de..7a59d23a 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/DefaultFlowExecutionRepositoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/DefaultFlowExecutionRepositoryTests.java @@ -1,16 +1,16 @@ package org.springframework.webflow.execution.repository.impl; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.fail; import java.util.HashMap; import java.util.Map; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.conversation.Conversation; import org.springframework.webflow.conversation.ConversationException; import org.springframework.webflow.conversation.ConversationId; @@ -41,7 +41,7 @@ public class DefaultFlowExecutionRepositoryTests { private DefaultFlowExecutionRepository repository; FlowExecutionImplFactory executionFactory = new FlowExecutionImplFactory(); - @Before + @BeforeEach public void setUp() throws Exception { flow = new Flow("myFlow"); ViewState s1 = new ViewState(flow, "state", new StubViewFactory()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/SimpleFlowExecutionSnapshotGroupTests.java b/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/SimpleFlowExecutionSnapshotGroupTests.java index 4459723a..a1a32055 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/SimpleFlowExecutionSnapshotGroupTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/impl/SimpleFlowExecutionSnapshotGroupTests.java @@ -1,12 +1,12 @@ package org.springframework.webflow.execution.repository.impl; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.fail; import java.io.Serializable; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.repository.snapshot.FlowExecutionSnapshot; import org.springframework.webflow.execution.repository.snapshot.SnapshotNotFoundException; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/snapshot/SerializedFlowExecutionSnapshotFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/snapshot/SerializedFlowExecutionSnapshotFactoryTests.java index f24de34a..50ff7781 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/snapshot/SerializedFlowExecutionSnapshotFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/snapshot/SerializedFlowExecutionSnapshotFactoryTests.java @@ -1,12 +1,12 @@ package org.springframework.webflow.execution.repository.snapshot; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.definition.registry.FlowDefinitionLocator; import org.springframework.webflow.engine.Flow; import org.springframework.webflow.engine.RequestControlContext; @@ -21,7 +21,7 @@ public class SerializedFlowExecutionSnapshotFactoryTests { private SerializedFlowExecutionSnapshotFactory factory; private FlowExecutionImplFactory executionFactory; - @Before + @BeforeEach public void setUp() { flow = new Flow("myFlow"); new State(flow, "state") { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/support/CompositeFlowExecutionKeyTests.java b/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/support/CompositeFlowExecutionKeyTests.java index 1fb138e4..a2c094b3 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/support/CompositeFlowExecutionKeyTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/execution/repository/support/CompositeFlowExecutionKeyTests.java @@ -15,9 +15,9 @@ */ package org.springframework.webflow.execution.repository.support; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.conversation.impl.SimpleConversationId; public class CompositeFlowExecutionKeyTests { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/executor/FlowExecutorImplTests.java b/spring-webflow/src/test/java/org/springframework/webflow/executor/FlowExecutorImplTests.java index 4685eb20..77b1ea70 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/executor/FlowExecutorImplTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/executor/FlowExecutorImplTests.java @@ -1,13 +1,13 @@ package org.springframework.webflow.executor; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.easymock.EasyMock; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.context.ExternalContextHolder; import org.springframework.webflow.core.collection.LocalAttributeMap; import org.springframework.webflow.core.collection.MutableAttributeMap; @@ -34,7 +34,7 @@ public class FlowExecutorImplTests { private FlowExecutionRepository repository; private FlowExecutionLock lock; - @Before + @BeforeEach public void setUp() { locator = EasyMock.createMock(FlowDefinitionLocator.class); definition = EasyMock.createMock(FlowDefinition.class); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowDependentELResolverTestCase.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowDependentELResolverTestCase.java index 49350005..bd43dfaa 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowDependentELResolverTestCase.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowDependentELResolverTestCase.java @@ -1,15 +1,15 @@ package org.springframework.webflow.expression.el; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; import java.util.List; import javax.el.ELContext; import javax.el.ELResolver; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.el.DefaultELContext; import org.springframework.binding.expression.el.DefaultELResolver; import org.springframework.webflow.engine.ViewState; @@ -21,41 +21,41 @@ public abstract class FlowDependentELResolverTestCase { protected ELContext context; - @Before + @BeforeEach public void setUp() { context = new DefaultELContext(new DefaultELResolver(getCustomResolvers()), null, null); } - @After + @AfterEach public void tearDown() { RequestContextHolder.setRequestContext(null); } @Test public void testGetType_NoActiveFlow() { - assertNull("getType should return null when no flow is active", - context.getELResolver().getType(context, null, getBaseVariable())); + assertNull(context.getELResolver().getType(context, null, getBaseVariable()), + "getType should return null when no flow is active"); assertFalse(context.isPropertyResolved()); } @Test public void testGetValue_NoActiveFlow() { - assertNull("getValue should return null when no flow is active", - context.getELResolver().getValue(context, null, getBaseVariable())); + assertNull(context.getELResolver().getValue(context, null, getBaseVariable()), + "getValue should return null when no flow is active"); assertFalse(context.isPropertyResolved()); } @Test public void testIsReadOnly_NoActiveFlow() { - assertFalse("isReadOnly should return false when no flow is active", - context.getELResolver().isReadOnly(context, null, getBaseVariable())); + assertFalse(context.getELResolver().isReadOnly(context, null, getBaseVariable()), + "isReadOnly should return false when no flow is active"); assertFalse(context.isPropertyResolved()); } @Test public void testSetValue_NoActiveFlow() { context.getELResolver().setValue(context, null, getBaseVariable(), null); - assertFalse("setValue should be a no-op when no flow is active", context.isPropertyResolved()); + assertFalse(context.isPropertyResolved(), "setValue should be a no-op when no flow is active"); } protected void initView(MockRequestContext requestContext) { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowResourceELResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowResourceELResolverTests.java index 31de49f5..4f1d2cc9 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowResourceELResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/FlowResourceELResolverTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.expression.el; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.ArrayList; import java.util.List; @@ -12,8 +12,8 @@ import javax.el.ELResolver; import javax.el.PropertyNotFoundException; import javax.el.PropertyNotWritableException; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.springframework.context.MessageSource; import org.springframework.context.support.StaticMessageSource; import org.springframework.web.context.support.StaticWebApplicationContext; @@ -24,7 +24,7 @@ import org.springframework.webflow.test.MockRequestContext; public class FlowResourceELResolverTests extends FlowDependentELResolverTestCase { @Override - @After + @AfterEach public void tearDown() { RequestContextHolder.setRequestContext(null); } @@ -32,8 +32,8 @@ public class FlowResourceELResolverTests extends FlowDependentELResolverTestCase @Test public void testGetType_BaseVariable() { RequestContextHolder.setRequestContext(new MockRequestContext()); - assertEquals(getBaseVariable() + " should have a type of MessageSource", MessageSource.class, context - .getELResolver().getType(context, null, getBaseVariable())); + assertEquals(MessageSource.class, context.getELResolver().getType(context, null, getBaseVariable()), + getBaseVariable() + " should have a type of MessageSource"); } @Test @@ -42,8 +42,8 @@ public class FlowResourceELResolverTests extends FlowDependentELResolverTestCase ms.addMessage("foo.bar", Locale.getDefault(), "hello"); RequestContextHolder.setRequestContext(new MockRequestContext()); - assertEquals("Message should resolve to a type of String", String.class, - context.getELResolver().getType(context, ms, "foo.bar")); + assertEquals(String.class, context.getELResolver().getType(context, ms, "foo.bar"), + "Message should resolve to a type of String"); } @Test @@ -65,8 +65,8 @@ public class FlowResourceELResolverTests extends FlowDependentELResolverTestCase MockRequestContext requestContext = new MockRequestContext(); ((Flow) requestContext.getActiveFlow()).setApplicationContext(new StaticWebApplicationContext()); RequestContextHolder.setRequestContext(requestContext); - assertTrue(getBaseVariable() + " should resolve to an instance of MessageSource", context.getELResolver() - .getValue(context, null, getBaseVariable()) instanceof MessageSource); + assertTrue(context.getELResolver().getValue(context, null, getBaseVariable()) instanceof MessageSource, + getBaseVariable() + " should resolve to an instance of MessageSource"); } @@ -76,8 +76,8 @@ public class FlowResourceELResolverTests extends FlowDependentELResolverTestCase ms.addMessage("foo.bar", Locale.getDefault(), "hello"); RequestContextHolder.setRequestContext(new MockRequestContext()); - assertEquals("Message should resolve to a valid message value", "hello", - context.getELResolver().getValue(context, ms, "foo.bar")); + assertEquals("hello", context.getELResolver().getValue(context, ms, "foo.bar"), + "Message should resolve to a valid message value"); } @Test @@ -97,8 +97,8 @@ public class FlowResourceELResolverTests extends FlowDependentELResolverTestCase @Test public void testIsReadOnly_BaseVariable() { RequestContextHolder.setRequestContext(new MockRequestContext()); - assertTrue("isReadOnly should return true for the base variable", - context.getELResolver().isReadOnly(context, null, getBaseVariable())); + assertTrue(context.getELResolver().isReadOnly(context, null, getBaseVariable()), + "isReadOnly should return true for the base variable"); } @Test @@ -106,8 +106,8 @@ public class FlowResourceELResolverTests extends FlowDependentELResolverTestCase StaticMessageSource ms = new StaticMessageSource(); RequestContextHolder.setRequestContext(new MockRequestContext()); - assertTrue("isReadOnly should return true when the base is a MessageSource", context.getELResolver() - .isReadOnly(context, ms, "foo")); + assertTrue(context.getELResolver().isReadOnly(context, ms, "foo"), + "isReadOnly should return true when the base is a MessageSource"); } @Test diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolverTests.java index 7daea662..a6ee624b 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolverTests.java @@ -1,9 +1,9 @@ package org.springframework.webflow.expression.el; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.security.Principal; import java.util.ArrayList; @@ -13,7 +13,7 @@ import java.util.List; import javax.el.ELResolver; import javax.el.PropertyNotWritableException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.message.MessageContext; import org.springframework.util.ClassUtils; import org.springframework.webflow.context.ExternalContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ScopeSearchingELResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ScopeSearchingELResolverTests.java index 82d5292f..a4eae1d6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ScopeSearchingELResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/ScopeSearchingELResolverTests.java @@ -1,17 +1,17 @@ package org.springframework.webflow.expression.el; -import static org.junit.Assert.assertEquals; -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.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.ArrayList; import java.util.List; import javax.el.ELResolver; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.RequestContextHolder; import org.springframework.webflow.test.MockRequestContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java index 05f624a1..50779fc8 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java @@ -1,13 +1,13 @@ package org.springframework.webflow.expression.el; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; import java.security.Principal; import java.util.Locale; import org.apache.el.ExpressionFactoryImpl; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.Expression; import org.springframework.binding.expression.support.FluentParserContext; import org.springframework.context.support.StaticApplicationContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/FlowVariablePropertyAccessorTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/FlowVariablePropertyAccessorTests.java index ff06d17c..78aa9728 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/FlowVariablePropertyAccessorTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/FlowVariablePropertyAccessorTests.java @@ -15,13 +15,13 @@ */ package org.springframework.webflow.expression.spel; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.support.StaticApplicationContext; import org.springframework.expression.AccessException; import org.springframework.webflow.engine.Flow; @@ -35,7 +35,7 @@ public class FlowVariablePropertyAccessorTests { private MockRequestContext requestContext; - @Before + @BeforeEach public void setUp() throws Exception { requestContext = new MockRequestContext(); RequestContextHolder.setRequestContext(requestContext); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/ScopeSearchingPropertyAccessorTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/ScopeSearchingPropertyAccessorTests.java index 47496b70..b80ef231 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/ScopeSearchingPropertyAccessorTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/ScopeSearchingPropertyAccessorTests.java @@ -15,11 +15,11 @@ */ package org.springframework.webflow.expression.spel; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.expression.TypedValue; import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.webflow.engine.ViewState; @@ -35,7 +35,7 @@ public class ScopeSearchingPropertyAccessorTests { private MockRequestContext requestContext; - @Before + @BeforeEach public void setUp() throws Exception { requestContext = new MockRequestContext(); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/WebFlowSpringELExpressionParserTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/WebFlowSpringELExpressionParserTests.java index b022649c..1a23f16b 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/WebFlowSpringELExpressionParserTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/spel/WebFlowSpringELExpressionParserTests.java @@ -15,13 +15,13 @@ */ package org.springframework.webflow.expression.spel; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.Locale; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.Expression; import org.springframework.binding.expression.ExpressionParser; import org.springframework.binding.expression.support.FluentParserContext; @@ -39,13 +39,13 @@ public class WebFlowSpringELExpressionParserTests { private MockRequestContext requestContext; - @Before + @BeforeEach public void setUp() throws Exception { requestContext = new MockRequestContext(); RequestContextHolder.setRequestContext(requestContext); } - @After + @AfterEach public void tearDown() throws Exception { RequestContextHolder.setRequestContext(null); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowControllerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowControllerTests.java index 9516410a..4cab231d 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowControllerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowControllerTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.mvc.servlet; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; import java.util.HashMap; import java.util.Map; @@ -11,8 +11,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.easymock.EasyMock; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.context.servlet.DefaultAjaxHandler; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; @@ -36,7 +36,7 @@ public class FlowControllerTests { private MockHttpServletResponse response; private ServletExternalContext context; - @Before + @BeforeEach public void setUp() throws Exception { executor = EasyMock.createMock(FlowExecutor.class); controller = new FlowController(); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapterTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapterTests.java index 482c1f38..ec3f5b15 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapterTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerAdapterTests.java @@ -1,10 +1,10 @@ package org.springframework.webflow.mvc.servlet; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.HashMap; import java.util.Map; @@ -13,8 +13,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.easymock.EasyMock; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.mock.web.MockServletContext; @@ -45,7 +45,7 @@ public class FlowHandlerAdapterTests { private boolean handleExecutionOutcome; private MockFlashMapManager flashMapManager = new MockFlashMapManager(); - @Before + @BeforeEach public void setUp() throws Exception { flowExecutor = EasyMock.createMock(FlowExecutor.class); flowHandlerAdapter = new FlowHandlerAdapter() { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerMappingTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerMappingTests.java index fb216e4a..e1c3090c 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerMappingTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/FlowHandlerMappingTests.java @@ -1,15 +1,15 @@ package org.springframework.webflow.mvc.servlet; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.context.ApplicationContext; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockServletContext; @@ -25,7 +25,7 @@ import org.springframework.webflow.execution.FlowExecutionOutcome; public class FlowHandlerMappingTests { private FlowHandlerMapping mapping = new FlowHandlerMapping(); - @Before + @BeforeEach public void setUp() { FlowDefinitionRegistryImpl registry = new FlowDefinitionRegistryImpl(); registry.registerFlowDefinition(new FlowDefinitionImpl()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/ServletMvcViewTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/ServletMvcViewTests.java index 11beb728..6838b4a2 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/ServletMvcViewTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/servlet/ServletMvcViewTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.mvc.servlet; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.security.Principal; import java.util.Calendar; @@ -12,7 +12,7 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.mock.web.MockServletContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java index 04c06b64..70291965 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java @@ -1,9 +1,9 @@ package org.springframework.webflow.mvc.view; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.beans.PropertyEditor; import java.util.ArrayList; @@ -11,8 +11,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.convert.converters.StringToObject; import org.springframework.binding.convert.service.DefaultConversionService; import org.springframework.binding.expression.Expression; @@ -36,7 +36,7 @@ public abstract class AbstractBindingModelTests { TestBean testBean; ExpressionParser expressionParser; - @Before + @BeforeEach public void setUp() { testBean = new TestBean(); messages = new DefaultMessageContext(); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AjaxTiles3ViewTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AjaxTiles3ViewTests.java index 5e6f3730..8fcffc69 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AjaxTiles3ViewTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AjaxTiles3ViewTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.mvc.view; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.HashMap; import java.util.Map; @@ -17,8 +17,8 @@ import org.apache.tiles.request.ApplicationContext; import org.apache.tiles.request.Request; import org.apache.tiles.request.servlet.ServletRequest; import org.apache.tiles.request.servlet.wildcard.WildcardServletApplicationContext; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.context.servlet.DefaultAjaxHandler; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; @@ -38,7 +38,7 @@ public class AjaxTiles3ViewTests { private MockServletContext servletContext; - @Before + @BeforeEach public void setUp() throws Exception { servletContext = new MockServletContext("/org/springframework/webflow/mvc/view/"); @@ -153,7 +153,7 @@ public class AjaxTiles3ViewTests { ajaxTilesView.setUrl("search"); ajaxTilesView.afterPropertiesSet(); ajaxTilesView.renderMergedOutputModel(new HashMap<>(), request, response); - assertTrue("Multiple fragments should result in include, not forward", response.getIncludedUrls().size() == 2); + assertTrue(response.getIncludedUrls().size() == 2, "Multiple fragments should result in include, not forward"); assertEquals("/WEB-INF/search.jsp", response.getIncludedUrls().get(0)); assertEquals("/WEB-INF/searchNavigation.jsp", response.getIncludedUrls().get(1)); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/BindingModelSwf1370Tests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/BindingModelSwf1370Tests.java index 3f8af5d1..f99f9e23 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/BindingModelSwf1370Tests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/BindingModelSwf1370Tests.java @@ -1,12 +1,12 @@ package org.springframework.webflow.mvc.view; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.HashMap; import java.util.Map; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.convert.ConversionService; import org.springframework.binding.convert.service.DefaultConversionService; import org.springframework.binding.message.DefaultMessageContext; @@ -24,7 +24,7 @@ public class BindingModelSwf1370Tests { private ConverterRegistry converterRegistry; private WebFlowSpringELExpressionParser expressionParser; - @Before + @BeforeEach public void setUp() { conversionService = new DefaultConversionService(); expressionParser = new WebFlowSpringELExpressionParser(new SpelExpressionParser(), conversionService); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/MvcViewTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/MvcViewTests.java index 27b92256..a1703956 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/MvcViewTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/MvcViewTests.java @@ -1,11 +1,11 @@ package org.springframework.webflow.mvc.view; -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.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.File; import java.io.FileInputStream; @@ -21,7 +21,7 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.convert.converters.StringToDate; import org.springframework.binding.convert.service.DefaultConversionService; import org.springframework.binding.convert.service.GenericConversionService; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/SpringBeanBindingModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/SpringBeanBindingModelTests.java index f063e158..71e47263 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/SpringBeanBindingModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/SpringBeanBindingModelTests.java @@ -1,11 +1,11 @@ package org.springframework.webflow.mvc.view; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import java.beans.PropertyEditor; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.ExpressionParser; import org.springframework.binding.expression.beanwrapper.BeanWrapperExpressionParser; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/persistence/AbstractFlowManagedPersistenceIntegrationTests.java b/spring-webflow/src/test/java/org/springframework/webflow/persistence/AbstractFlowManagedPersistenceIntegrationTests.java index f499d900..62d72e70 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/persistence/AbstractFlowManagedPersistenceIntegrationTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/persistence/AbstractFlowManagedPersistenceIntegrationTests.java @@ -2,8 +2,8 @@ package org.springframework.webflow.persistence; import javax.sql.DataSource; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.io.ClassPathResource; import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.jdbc.datasource.init.DataSourceInitializer; @@ -34,7 +34,7 @@ public abstract class AbstractFlowManagedPersistenceIntegrationTests { return dataSource; } - @Before + @BeforeEach public void setUp() throws Exception { initDataSource(); populateDataBase(); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/persistence/AbstractPersistenceContextPropagationTests.java b/spring-webflow/src/test/java/org/springframework/webflow/persistence/AbstractPersistenceContextPropagationTests.java index 3ef4018c..595e9b74 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/persistence/AbstractPersistenceContextPropagationTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/persistence/AbstractPersistenceContextPropagationTests.java @@ -15,14 +15,14 @@ */ package org.springframework.webflow.persistence; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import javax.sql.DataSource; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.io.ClassPathResource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DriverManagerDataSource; @@ -44,7 +44,7 @@ public abstract class AbstractPersistenceContextPropagationTests { return jdbcTemplate; } - @Before + @BeforeEach public final void setUp() throws Exception { requestContext = new MockRequestContext(); DataSource dataSource = createDataSource(); @@ -79,8 +79,8 @@ public abstract class AbstractPersistenceContextPropagationTests { getListener().sessionStarting(new MockRequestContext(), childSession, null); assertSessionBound(); assertSessionInScope(childSession); - assertSame("Parent PersistenceContext should be re-used", parentSession.getScope().get("persistenceContext"), - childSession.getScope().get("persistenceContext")); + assertSame(parentSession.getScope().get("persistenceContext"), + childSession.getScope().get("persistenceContext"), "Parent PersistenceContext should be re-used"); } @Test diff --git a/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernateFlowExecutionListenerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernateFlowExecutionListenerTests.java index 837fff49..e54d1bcd 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernateFlowExecutionListenerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernateFlowExecutionListenerTests.java @@ -15,19 +15,19 @@ */ package org.springframework.webflow.persistence; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -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.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import javax.sql.DataSource; import org.hibernate.Hibernate; import org.hibernate.Session; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.io.ClassPathResource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DriverManagerDataSource; @@ -52,7 +52,7 @@ public class HibernateFlowExecutionListenerTests { private HibernateFlowExecutionListener hibernateListener; - @Before + @BeforeEach public void setUp() throws Exception { DataSource dataSource = getDataSource(); populateDataBase(dataSource); @@ -72,7 +72,7 @@ public class HibernateFlowExecutionListenerTests { // Session created and bound to conversation final Session hibSession = (Session) flowSession.getScope().get("persistenceContext"); - assertNotNull("Should have been populated", hibSession); + assertNotNull(hibSession, "Should have been populated"); hibernateListener.paused(context); assertSessionNotBound(); @@ -80,7 +80,7 @@ public class HibernateFlowExecutionListenerTests { hibernateListener.resuming(context); assertSessionBound(); - hibernate.templateExecuteWithNativeSession(session -> assertSame("Should have been original instance", hibSession, session)); + hibernate.templateExecuteWithNativeSession(session -> assertSame(hibSession, session, "Should have been original instance")); hibernateListener.paused(context); assertSessionNotBound(); } @@ -95,7 +95,7 @@ public class HibernateFlowExecutionListenerTests { @Test public void testFlowCommitsInSingleRequest() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -105,7 +105,7 @@ public class HibernateFlowExecutionListenerTests { TestBean bean = new TestBean("Keith Donald"); hibernate.templateSave(bean); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); EndState endState = new EndState(flowSession.getDefinitionInternal(), "success"); endState.getAttributes().put("commit", true); @@ -113,7 +113,7 @@ public class HibernateFlowExecutionListenerTests { hibernateListener.sessionEnding(context, flowSession, "success", null); hibernateListener.sessionEnded(context, flowSession, "success", null); - assertEquals("Table should only have two rows", 2, getCount()); + assertEquals(2, getCount(), "Table should only have two rows"); assertSessionNotBound(); } @@ -124,7 +124,7 @@ public class HibernateFlowExecutionListenerTests { @Test public void testFlowCommitsAfterMultipleRequests() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -134,14 +134,14 @@ public class HibernateFlowExecutionListenerTests { TestBean bean1 = new TestBean("Keith Donald"); hibernate.templateSave(bean1); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); hibernateListener.paused(context); assertSessionNotBound(); hibernateListener.resuming(context); TestBean bean2 = new TestBean("Keith Donald"); hibernate.templateSave(bean2); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); assertSessionBound(); EndState endState = new EndState(flowSession.getDefinitionInternal(), "success"); @@ -150,14 +150,14 @@ public class HibernateFlowExecutionListenerTests { hibernateListener.sessionEnding(context, flowSession, "success", null); hibernateListener.sessionEnded(context, flowSession, "success", null); - assertEquals("Table should only have three rows", 3, getCount()); + assertEquals(3, getCount(), "Table should only have three rows"); assertSessionNotBound(); } @Test public void testCancelEndState() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -167,20 +167,20 @@ public class HibernateFlowExecutionListenerTests { TestBean bean = new TestBean("Keith Donald"); hibernate.templateSave(bean); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); EndState endState = new EndState(flowSession.getDefinitionInternal(), "cancel"); endState.getAttributes().put("commit", false); flowSession.setState(endState); hibernateListener.sessionEnding(context, flowSession, "success", null); hibernateListener.sessionEnded(context, flowSession, "cancel", null); - assertEquals("Table should only have two rows", 1, getCount()); + assertEquals(1, getCount(), "Table should only have two rows"); assertSessionNotBound(); } @Test public void testNoCommitAttributeSetOnEndState() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -193,14 +193,14 @@ public class HibernateFlowExecutionListenerTests { hibernateListener.sessionEnding(context, flowSession, "success", null); hibernateListener.sessionEnded(context, flowSession, "cancel", null); - assertEquals("Table should only have three rows", 1, getCount()); + assertEquals(1, getCount(), "Table should only have three rows"); assertSessionNotBound(); } @Test public void testExceptionThrown() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -210,16 +210,16 @@ public class HibernateFlowExecutionListenerTests { TestBean bean1 = new TestBean("Keith Donald"); hibernate.templateSave(bean1); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); hibernateListener.exceptionThrown(context, new FlowExecutionException("bla", "bla", "bla")); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); assertSessionNotBound(); } @Test public void testExceptionThrownWithNothingBound() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -238,11 +238,11 @@ public class HibernateFlowExecutionListenerTests { assertSessionBound(); TestBean bean = hibernate.templateGet(TestBean.class, 0L); - assertFalse("addresses should not be initialized", Hibernate.isInitialized(bean.getAddresses())); + assertFalse(Hibernate.isInitialized(bean.getAddresses()), "addresses should not be initialized"); hibernateListener.paused(context); - assertFalse("addresses should not be initialized", Hibernate.isInitialized(bean.getAddresses())); + assertFalse(Hibernate.isInitialized(bean.getAddresses()), "addresses should not be initialized"); Hibernate.initialize(bean.getAddresses()); - assertTrue("addresses should be initialized", Hibernate.isInitialized(bean.getAddresses())); + assertTrue(Hibernate.isInitialized(bean.getAddresses()), "addresses should be initialized"); } private DataSource getDataSource() { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernateFlowManagedPersistenceIntegrationTests.java b/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernateFlowManagedPersistenceIntegrationTests.java index 3c23152f..a2b61f52 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernateFlowManagedPersistenceIntegrationTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernateFlowManagedPersistenceIntegrationTests.java @@ -1,7 +1,7 @@ package org.springframework.webflow.persistence; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import javax.sql.DataSource; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernatePersistenceContextPropagationTests.java b/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernatePersistenceContextPropagationTests.java index 8be1ccf3..9f127b32 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernatePersistenceContextPropagationTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/persistence/HibernatePersistenceContextPropagationTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.persistence; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import javax.sql.DataSource; @@ -45,9 +45,9 @@ public class HibernatePersistenceContextPropagationTests extends AbstractPersist hibernate.templateSave(new TestBean(rowCount++, "Keith Donald")); } if (!isCommited) { - assertEquals("Nothing should be committed yet", 1, getCount()); + assertEquals(1, getCount(), "Nothing should be committed yet"); } else { - assertEquals("All rows should be committed", rowCount, getCount()); + assertEquals(rowCount, getCount(), "All rows should be committed"); } } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowExecutionListenerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowExecutionListenerTests.java index 697bb193..91bfb22b 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowExecutionListenerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowExecutionListenerTests.java @@ -1,15 +1,15 @@ package org.springframework.webflow.persistence; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.io.ClassPathResource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DriverManagerDataSource; @@ -33,7 +33,7 @@ public class JpaFlowExecutionListenerTests { private JdbcTemplate jdbcTemplate; - @Before + @BeforeEach public void setUp() throws Exception { DataSource dataSource = getDataSource(); populateDataBase(dataSource); @@ -53,7 +53,7 @@ public class JpaFlowExecutionListenerTests { @Test public void testFlowCommitsInSingleRequest() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -64,7 +64,7 @@ public class JpaFlowExecutionListenerTests { TestBean bean = new TestBean(1, "Keith Donald"); EntityManager em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory); em.persist(bean); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); EndState endState = new EndState(flowSession.getDefinitionInternal(), "success"); endState.getAttributes().put("commit", true); @@ -72,7 +72,7 @@ public class JpaFlowExecutionListenerTests { jpaListener.sessionEnding(context, flowSession, "success", null); jpaListener.sessionEnded(context, flowSession, "success", null); - assertEquals("Table should only have two rows", 2, getCount()); + assertEquals(2, getCount(), "Table should only have two rows"); assertSessionNotBound(); } @@ -83,7 +83,7 @@ public class JpaFlowExecutionListenerTests { @Test public void testFlowCommitsAfterMultipleRequests() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -94,7 +94,7 @@ public class JpaFlowExecutionListenerTests { TestBean bean1 = new TestBean(1, "Keith Donald"); EntityManager em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory); em.persist(bean1); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); jpaListener.paused(context); assertSessionNotBound(); @@ -102,7 +102,7 @@ public class JpaFlowExecutionListenerTests { TestBean bean2 = new TestBean(2, "Keith Donald"); em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory); em.persist(bean2); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); assertSessionBound(); EndState endState = new EndState(flowSession.getDefinitionInternal(), "success"); @@ -111,14 +111,14 @@ public class JpaFlowExecutionListenerTests { jpaListener.sessionEnding(context, flowSession, "success", null); jpaListener.sessionEnded(context, flowSession, "success", null); - assertEquals("Table should only have three rows", 3, getCount()); + assertEquals(3, getCount(), "Table should only have three rows"); assertSessionNotBound(); } @Test public void testCancelEndState() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -129,20 +129,20 @@ public class JpaFlowExecutionListenerTests { TestBean bean = new TestBean(1, "Keith Donald"); EntityManager em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory); em.persist(bean); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); EndState endState = new EndState(flowSession.getDefinitionInternal(), "cancel"); endState.getAttributes().put("commit", false); flowSession.setState(endState); jpaListener.sessionEnding(context, flowSession, "cancel", null); jpaListener.sessionEnded(context, flowSession, "success", null); - assertEquals("Table should only have two rows", 1, getCount()); + assertEquals(1, getCount(), "Table should only have two rows"); assertSessionNotBound(); } @Test public void testNoCommitAttributeSetOnEndState() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -155,14 +155,14 @@ public class JpaFlowExecutionListenerTests { jpaListener.sessionEnding(context, flowSession, "cancel", null); jpaListener.sessionEnded(context, flowSession, "success", null); - assertEquals("Table should only have three rows", 1, getCount()); + assertEquals(1, getCount(), "Table should only have three rows"); assertSessionNotBound(); } @Test public void testExceptionThrown() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); @@ -173,16 +173,16 @@ public class JpaFlowExecutionListenerTests { TestBean bean = new TestBean(1, "Keith Donald"); EntityManager em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory); em.persist(bean); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); jpaListener.exceptionThrown(context, new FlowExecutionException("bla", "bla", "bla")); - assertEquals("Table should still only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should still only have one row"); assertSessionNotBound(); } @Test public void testExceptionThrownWithNothingBound() { - assertEquals("Table should only have one row", 1, getCount()); + assertEquals(1, getCount(), "Table should only have one row"); MockRequestContext context = new MockRequestContext(); MockFlowSession flowSession = new MockFlowSession(); flowSession.getDefinition().getAttributes().put("persistenceContext", "true"); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowManagedPersistenceIntegrationTests.java b/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowManagedPersistenceIntegrationTests.java index 9cd7f301..8e689d05 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowManagedPersistenceIntegrationTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaFlowManagedPersistenceIntegrationTests.java @@ -1,7 +1,7 @@ package org.springframework.webflow.persistence; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaPersistenceContextPropagationTests.java b/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaPersistenceContextPropagationTests.java index 0dbbeb04..85e27e18 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaPersistenceContextPropagationTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/persistence/JpaPersistenceContextPropagationTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.persistence; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; @@ -53,11 +53,9 @@ public class JpaPersistenceContextPropagationTests extends AbstractPersistenceCo em.persist(new TestBean(rowCount++, "Keith Donald")); } if (!isCommited) { - assertEquals("Nothing should be committed yet", 1, - getCount()); + assertEquals(1, getCount(), "Nothing should be committed yet"); } else { - assertEquals("All rows should be committed", rowCount, - getCount()); + assertEquals(rowCount, getCount(), "All rows should be committed"); } } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java index a9232d25..b8553931 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java @@ -1,13 +1,13 @@ package org.springframework.webflow.security; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java index 24385783..54348f0e 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java @@ -1,12 +1,12 @@ package org.springframework.webflow.security; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.ArrayList; import java.util.Collection; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class SecurityRuleTests { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/test/MockActionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/test/MockActionTests.java index dbb4990f..f956e3f4 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/test/MockActionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/test/MockActionTests.java @@ -1,10 +1,10 @@ package org.springframework.webflow.test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.core.collection.LocalAttributeMap; import org.springframework.webflow.execution.Event; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java index b15165a1..0eb461de 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.ArrayList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.webflow.config.FlowDefinitionResource; import org.springframework.webflow.config.FlowDefinitionResourceFactory; import org.springframework.webflow.context.ExternalContext; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/upgrade/WebFlowUpgraderTests.java b/spring-webflow/src/test/java/org/springframework/webflow/upgrade/WebFlowUpgraderTests.java index 8514af30..1c2ec07e 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/upgrade/WebFlowUpgraderTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/upgrade/WebFlowUpgraderTests.java @@ -1,6 +1,6 @@ package org.springframework.webflow.upgrade; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.io.ClassPathResource; public class WebFlowUpgraderTests { diff --git a/spring-webflow/src/test/java/org/springframework/webflow/validation/BeanValidationHintResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/validation/BeanValidationHintResolverTests.java index 740c95f2..c1d002e9 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/validation/BeanValidationHintResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/validation/BeanValidationHintResolverTests.java @@ -15,14 +15,14 @@ */ package org.springframework.webflow.validation; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; import javax.validation.groups.Default; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.webflow.execution.FlowExecutionException; /** @@ -34,7 +34,7 @@ public class BeanValidationHintResolverTests { private BeanValidationHintResolver resolver; - @Before + @BeforeEach public void setUp() { this.resolver = new BeanValidationHintResolver(); } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/validation/ValidationHelperTests.java b/spring-webflow/src/test/java/org/springframework/webflow/validation/ValidationHelperTests.java index fd96058a..252b78f7 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/validation/ValidationHelperTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/validation/ValidationHelperTests.java @@ -15,12 +15,12 @@ */ package org.springframework.webflow.validation; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.binding.expression.support.StaticExpression; import org.springframework.binding.message.MessageContext; import org.springframework.binding.validation.ValidationContext; @@ -49,7 +49,7 @@ public class ValidationHelperTests { private DefaultMessageCodesResolver codesResolver; - @Before + @BeforeEach public void setUp() throws Exception { requestContext = new MockRequestControlContext(); eventId = "userEvent"; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/validation/WebFlowMessageResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/validation/WebFlowMessageResolverTests.java index ae1b9dee..17a21f22 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/validation/WebFlowMessageResolverTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/validation/WebFlowMessageResolverTests.java @@ -1,8 +1,8 @@ package org.springframework.webflow.validation; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class WebFlowMessageResolverTests { private WebFlowMessageCodesResolver messageCodesResolver = new WebFlowMessageCodesResolver();