Skip to content

Commit 6694d74

Browse files
committed
Migrate to JUnit5
1 parent a20e54d commit 6694d74

File tree

408 files changed

+2673
-2182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

408 files changed

+2673
-2182
lines changed

abstract-document/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@
3434
<artifactId>abstract-document</artifactId>
3535
<dependencies>
3636
<dependency>
37-
<groupId>junit</groupId>
38-
<artifactId>junit</artifactId>
37+
<groupId>org.junit.jupiter</groupId>
38+
<artifactId>junit-jupiter-api</artifactId>
39+
<scope>test</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.junit.jupiter</groupId>
43+
<artifactId>junit-jupiter-engine</artifactId>
3944
<scope>test</scope>
4045
</dependency>
4146
</dependencies>

abstract-document/src/test/java/com/iluwatar/abstractdocument/AbstractDocumentTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
*/
2323
package com.iluwatar.abstractdocument;
2424

25-
import org.junit.Test;
25+
import org.junit.jupiter.api.Test;
2626

2727
import java.util.Arrays;
2828
import java.util.HashMap;
2929
import java.util.List;
3030
import java.util.Map;
3131
import java.util.stream.Stream;
3232

33-
import static junit.framework.TestCase.assertEquals;
34-
import static junit.framework.TestCase.assertNotNull;
33+
import static org.junit.jupiter.api.Assertions.assertEquals;
34+
import static org.junit.jupiter.api.Assertions.assertNotNull;
3535

3636
/**
3737
* AbstractDocument test class

abstract-document/src/test/java/com/iluwatar/abstractdocument/AppTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
package com.iluwatar.abstractdocument;
2424

25-
import org.junit.Test;
25+
import org.junit.jupiter.api.Test;
2626

2727
/**
2828
* Simple App test

abstract-document/src/test/java/com/iluwatar/abstractdocument/DomainTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
import com.iluwatar.abstractdocument.domain.HasPrice;
2929
import com.iluwatar.abstractdocument.domain.HasType;
3030
import com.iluwatar.abstractdocument.domain.Part;
31-
import org.junit.Test;
31+
import org.junit.jupiter.api.Test;
3232

3333
import java.util.Arrays;
3434
import java.util.HashMap;
3535
import java.util.Map;
3636

37-
import static junit.framework.TestCase.assertEquals;
37+
import static org.junit.jupiter.api.Assertions.assertEquals;
3838

3939
/**
4040
* Test for Part and Car

abstract-factory/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@
3434
<artifactId>abstract-factory</artifactId>
3535
<dependencies>
3636
<dependency>
37-
<groupId>junit</groupId>
38-
<artifactId>junit</artifactId>
37+
<groupId>org.junit.jupiter</groupId>
38+
<artifactId>junit-jupiter-api</artifactId>
39+
<scope>test</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.junit.jupiter</groupId>
43+
<artifactId>junit-jupiter-engine</artifactId>
3944
<scope>test</scope>
4045
</dependency>
4146
</dependencies>

abstract-factory/src/test/java/com/iluwatar/abstractfactory/AbstractFactoryTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
*/
2323
package com.iluwatar.abstractfactory;
2424

25-
import static org.junit.Assert.assertEquals;
26-
import static org.junit.Assert.assertTrue;
25+
import static org.junit.jupiter.api.Assertions.assertEquals;
26+
import static org.junit.jupiter.api.Assertions.assertTrue;
2727

2828
import com.iluwatar.abstractfactory.App.FactoryMaker;
2929
import com.iluwatar.abstractfactory.App.FactoryMaker.KingdomType;
3030

31-
import org.junit.Before;
32-
import org.junit.Test;
31+
import org.junit.jupiter.api.BeforeEach;
32+
import org.junit.jupiter.api.Test;
3333

3434
/**
3535
* Test for abstract factory
@@ -40,7 +40,7 @@ public class AbstractFactoryTest {
4040
private KingdomFactory elfFactory;
4141
private KingdomFactory orcFactory;
4242

43-
@Before
43+
@BeforeEach
4444
public void setUp() {
4545
elfFactory = FactoryMaker.makeFactory(KingdomType.ELF);
4646
orcFactory = FactoryMaker.makeFactory(KingdomType.ORC);

abstract-factory/src/test/java/com/iluwatar/abstractfactory/AppTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
package com.iluwatar.abstractfactory;
2424

25-
import org.junit.Test;
25+
import org.junit.jupiter.api.Test;
2626

2727
import java.io.IOException;
2828

adapter/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@
3434
<artifactId>adapter</artifactId>
3535
<dependencies>
3636
<dependency>
37-
<groupId>junit</groupId>
38-
<artifactId>junit</artifactId>
37+
<groupId>org.junit.jupiter</groupId>
38+
<artifactId>junit-jupiter-api</artifactId>
39+
<scope>test</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.junit.jupiter</groupId>
43+
<artifactId>junit-jupiter-engine</artifactId>
3944
<scope>test</scope>
4045
</dependency>
4146
<dependency>

adapter/src/test/java/com/iluwatar/adapter/AdapterPatternTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
*/
2323
package com.iluwatar.adapter;
2424

25-
import org.junit.Before;
26-
import org.junit.Test;
25+
import org.junit.jupiter.api.BeforeEach;
26+
import org.junit.jupiter.api.Test;
2727

2828
import java.util.HashMap;
2929
import java.util.Map;
@@ -46,7 +46,7 @@ public class AdapterPatternTest {
4646
/**
4747
* This method runs before the test execution and sets the bean objects in the beans Map.
4848
*/
49-
@Before
49+
@BeforeEach
5050
public void setup() {
5151
beans = new HashMap<>();
5252

adapter/src/test/java/com/iluwatar/adapter/AppTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
package com.iluwatar.adapter;
2424

25-
import org.junit.Test;
25+
import org.junit.jupiter.api.Test;
2626

2727
import java.io.IOException;
2828

0 commit comments

Comments
 (0)