Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ allprojects {
}
dependency "org.slf4j:slf4j-api:2.0.17"

dependency("junit:junit:4.13.2")
dependency "org.easymock:easymock:5.6.0"
dependency "org.hamcrest:hamcrest:3.0"
dependency "org.apache.tomcat:tomcat-jasper-el:10.1.31"
Expand Down
3 changes: 1 addition & 2 deletions spring-webflow/spring-webflow.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ dependencies {

compileOnly("jakarta.el:jakarta.el-api")
compileOnly("jakarta.servlet:jakarta.servlet-api")
compileOnly("junit:junit")
compileOnly("org.junit.jupiter:junit-jupiter-api")

optional("org.hibernate.orm:hibernate-core")
optional("org.springframework.security:spring-security-core")
optional("org.springframework:spring-orm")
optional("org.springframework:spring-tx")

testImplementation("junit:junit")
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.easymock:easymock")
testImplementation("org.apache.tomcat:tomcat-jasper-el")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,11 @@ public abstract class AbstractExternalizedFlowExecutionTests extends AbstractFlo

/**
* Constructs a default externalized flow execution test.
* @see #setName(String)
*/
public AbstractExternalizedFlowExecutionTests() {
init();
}

/**
* Constructs an externalized flow execution test with given name.
* @param name the name of the test
*/
public AbstractExternalizedFlowExecutionTests(String name) {
super(name);
init();
}

/**
* Returns if flow definition caching is turned on.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.springframework.webflow.test.execution;

import junit.framework.TestCase;
import static org.junit.jupiter.api.Assertions.*;

import org.springframework.util.Assert;
import org.springframework.webflow.context.ExternalContext;
Expand Down Expand Up @@ -53,7 +53,7 @@
*
* @author Keith Donald
*/
public abstract class AbstractFlowExecutionTests extends TestCase {
public abstract class AbstractFlowExecutionTests {

/**
* The factory that will create the flow execution to test.
Expand All @@ -72,20 +72,11 @@ public abstract class AbstractFlowExecutionTests extends TestCase {

/**
* Constructs a default flow execution test.
* @see #setName(String)
*/
public AbstractFlowExecutionTests() {
super();
}

/**
* Constructs a flow execution test with given name.
* @param name the name of the test
*/
public AbstractFlowExecutionTests(String name) {
super(name);
}

/**
* Gets the factory that will create the flow execution to test. This method will create the factory if it is not
* already set.
Expand Down Expand Up @@ -297,7 +288,7 @@ protected Object getRequiredConversationAttribute(String attributeName, Class<?>
* Assert that the entire flow execution is active; that is, it has not ended and has been started.
*/
protected void assertFlowExecutionActive() {
assertTrue("The flow execution is not active but it should be", getFlowExecution().isActive());
assertTrue(getFlowExecution().isActive(), "The flow execution is not active but it should be");
}

/**
Expand All @@ -314,26 +305,27 @@ protected void assertActiveFlowEquals(String expectedActiveFlowId) {
* Assert that the flow execution has ended; that is, it is no longer active.
*/
protected void assertFlowExecutionEnded() {
assertTrue("The flow execution is still active but it should have ended", getFlowExecution().hasEnded());
assertTrue(getFlowExecution().hasEnded(), "The flow execution is still active but it should have ended");
}

/**
* Assert that the flow execution has ended with the outcome specified.
* @param outcome the name of the flow execution outcome
*/
protected void assertFlowExecutionOutcomeEquals(String outcome) {
assertNotNull("There has been no flow execution outcome", flowExecutionOutcome);
assertEquals("The flow execution outcome is wrong", outcome, flowExecutionOutcome.getId());
assertNotNull(flowExecutionOutcome, "There has been no flow execution outcome");
assertEquals(outcome, flowExecutionOutcome.getId(), "The flow execution outcome is wrong");
}

/**
* Assert that the current state of the flow execution equals the provided state id.
* @param expectedCurrentStateId the expected current state
*/
protected void assertCurrentStateEquals(String expectedCurrentStateId) {
assertEquals("The current state '" + getFlowExecution().getActiveSession().getState().getId()
+ "' does not equal the expected state '" + expectedCurrentStateId + "'", expectedCurrentStateId,
getFlowExecution().getActiveSession().getState().getId());
assertEquals(expectedCurrentStateId,
getFlowExecution().getActiveSession().getState().getId(),
"The current state '" + getFlowExecution().getActiveSession().getState().getId()
+ "' does not equal the expected state '" + expectedCurrentStateId + "'");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,11 @@ public abstract class AbstractXmlFlowExecutionTests extends AbstractExternalized

/**
* Constructs a default XML flow execution test.
* @see #setName(String)
*/
public AbstractXmlFlowExecutionTests() {
super();
}

/**
* Constructs an XML flow execution test with given name.
* @param name the name of the test
*/
public AbstractXmlFlowExecutionTests(String name) {
super(name);
}

protected final FlowBuilder createFlowBuilder(FlowDefinitionResource resource) {
registerDependentFlowModels();
FlowModelBuilder modelBuilder = new XmlFlowModelBuilder(resource.getPath(), flowModelRegistry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.List;

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

import org.springframework.webflow.config.FlowDefinitionResource;
import org.springframework.webflow.config.FlowDefinitionResourceFactory;
Expand Down Expand Up @@ -91,7 +92,7 @@ public void testSelectValidResult() {
protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) {
Flow mockDetailFlow = new Flow("detail-flow");
mockDetailFlow.setInputMapper((source, target) -> {
assertEquals("id of value 1 not provided as input by calling search flow", 1L, ((AttributeMap<?>) source).get("id"));
assertEquals(1L, ((AttributeMap<?>) source).get("id"), "id of value 1 not provided as input by calling search flow");
return null;
});
// test responding to finish result
Expand Down