[
https://issues.apache.org/jira/browse/COLLECTIONS-807?focusedWorklogId=748371&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-748371
]
ASF GitHub Bot logged work on COLLECTIONS-807:
----------------------------------------------
Author: ASF GitHub Bot
Created on: 27/Mar/22 21:25
Start Date: 27/Mar/22 21:25
Worklog Time Spent: 10m
Work Description: pradeesh-kumar opened a new pull request #295:
URL: https://github.com/apache/commons-collections/pull/295
**Jira:** https://issues.apache.org/jira/browse/COLLECTIONS-807
**Description:** COLLECTIONS-807 is a subtask of the main task
[COLLECTIONS-777-Fully migrate to JUnit
5](https://issues.apache.org/jira/browse/COLLECTIONS-777)
**Subtask COLLECTIONS-807 description:** Upgrade org.junit.Test to
org.junit.jupiter.api.Test
**Major Changes**
1. pom.xml
Added the dependency _junit-jupiter-params_ in order to fix the
parameterized test case issues after upgrading the Test annotation in the
classes AbstractPropertiesFactoryTest.java, SortedPropertiesFactoryTest.java,
PropertiesFactoryTest.java
```
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${commons.junit.version}</version>
<scope>test</scope>
</dependency>
```
2. Annotated setup() methods with @BeforeEach annotation
Example:
```
@Override
public void setUp() {
testList = new ArrayList<>();
testList.addAll(Arrays.asList(testArray));
}
```
Rewritten to
```
@BeforeEach
public void setUp() {
testList = new ArrayList<>();
testList.addAll(Arrays.asList(testArray));
}
```
3. Removed the String parameter testName from all the Junit test classes.
Reason: Junit below 5 was supporting the constructor to have a String
parameter, which will be injected with the current Display name of the test
case being run. This is no more supported in JUnit 5. Since JUnit 5, a
constructor with arguments is considered to as a Parameterized test case. To
remove the test execution issue after upgrading the annotation, removed the
parameter from constructor, instead pass the current class name (which is equal
to the test case name) to the super classes.
```
public BooleanComparatorTest(String testName) {
super(testName);
}
```
Rewritten as
```
public BooleanComparatorTest() {
super(BooleanComparatorTest.class.getSimpleName());
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 748371)
Remaining Estimate: 0h
Time Spent: 10m
> Upgrade org.junit.Test to org.junit.jupiter.api.Test
> ----------------------------------------------------
>
> Key: COLLECTIONS-807
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-807
> Project: Commons Collections
> Issue Type: Sub-task
> Reporter: John Patrick
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Covers '17' usages of legacy usage of;
> {code:java}
> import org.junit.Test;
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)