Refactor to junit5

- remove junit4 dependecies
- refactor the unit tests by junit5
- enhance the spring-statemachine-test and spring-statemachine-build-tests so they can work together with junit4/junit5
- relates #779
This commit is contained in:
Ming Deng
2019-05-27 08:34:42 +01:00
committed by Janne Valkealahti
parent edb76476a6
commit 9f10700da2
135 changed files with 609 additions and 563 deletions

View File

@@ -15,9 +15,9 @@
*/
package demo.showcase;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.springframework.statemachine.TestUtils.doSendEventAndConsumeAll;
import static org.springframework.statemachine.TestUtils.doStartAndAssert;
import static org.springframework.statemachine.TestUtils.doStopAndAssert;
@@ -27,9 +27,9 @@ import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
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.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
@@ -356,7 +356,7 @@ public class ShowcaseTests {
}
@SuppressWarnings("unchecked")
@Before
@BeforeEach
public void setup() {
context = new AnnotationConfigApplicationContext();
context.register(CommonConfiguration.class, Application.class, Config.class);
@@ -366,7 +366,7 @@ public class ShowcaseTests {
doStartAndAssert(machine);
}
@After
@AfterEach
public void clean() {
doStopAndAssert(machine);
context.close();