Upgrade Web Flow tests from JUnit 4 to 5

Replace imports:
org.junit.Assert.* -> org.junit.jupiter.api.Assertions.*
org.junit.After    -> org.junit.jupiter.api.AfterEach
org.junit.Before   -> org.junit.jupiter.api.BeforeEach

Move the `message` argument to last position.

Issue: SWF-1739
This commit is contained in:
Etienne Dysli Metref
2019-08-26 16:13:07 +02:00
committed by Rossen Stoyanchev
parent ceb44a6634
commit cadaaad605
171 changed files with 1059 additions and 1062 deletions

View File

@@ -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")

View File

@@ -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<String, Object> accessor;
@Before
@BeforeEach
public void setUp() {
Map<String, Object> map = new HashMap<>();
map.put("string", "hello");

View File

@@ -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}.

View File

@@ -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}.

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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());
}

View File

@@ -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);
}

View File

@@ -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());
}

View File

@@ -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;

View File

@@ -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!");

View File

@@ -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}");

View File

@@ -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");

View File

@@ -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");

View File

@@ -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}.

View File

@@ -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();
}

View File

@@ -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

View File

@@ -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();
}

View File

@@ -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 {
}

View File

@@ -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();

View File

@@ -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();
}

View File

@@ -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;

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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}.

View File

@@ -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 {

View File

@@ -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);
}

View File

@@ -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<String> 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);

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -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();
}

View File

@@ -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);
}

View File

@@ -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());

View File

@@ -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.");
}
}

View File

@@ -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<Object> 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);

View File

@@ -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 {

View File

@@ -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();

View File

@@ -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;

View File

@@ -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() {
}
}

View File

@@ -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;

View File

@@ -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");
}
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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 {
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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());
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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");

View File

@@ -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();

View File

@@ -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();
}

View File

@@ -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;

View File

@@ -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();
}

View File

@@ -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();

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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

View File

@@ -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<String> 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);
}

View File

@@ -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<String> 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);
}

View File

@@ -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<String> 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<String> 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

View File

@@ -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");

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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}.

View File

@@ -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<Object> attributeMap = new LocalAttributeMap<>();
@Before
@BeforeEach
public void setUp() {
attributeMap.put("string", "A string");
attributeMap.put("integer", 12345);

View File

@@ -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<String, Object> map = new HashMap<>();
map.put("string", "A string");

View File

@@ -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();

View File

@@ -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");

View File

@@ -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");

View File

@@ -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 {

View File

@@ -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);

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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());
}

View File

@@ -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;

View File

@@ -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") {

View File

@@ -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");

View File

@@ -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;

View File

@@ -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));

View File

@@ -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;

View File

@@ -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());

View File

@@ -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");

View File

@@ -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());

View File

@@ -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;

View File

@@ -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() {

View File

@@ -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());

View File

@@ -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");
}

View File

@@ -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}.

Some files were not shown because too many files have changed in this diff Show More