Skip to content

Commit 66a5e4d

Browse files
committed
Port to JUnit 5
1 parent 906720b commit 66a5e4d

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
.project
44
.settings/
55
/site-content/
6+
/.idea/

src/test/java/org/apache/commons/beanutils/bugs/Jira422TestCase.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
1718
package org.apache.commons.beanutils.bugs;
1819

19-
import static org.junit.Assert.assertEquals;
20+
import static org.junit.jupiter.api.Assertions.assertEquals;
2021

2122
import java.beans.BeanInfo;
2223
import java.beans.IndexedPropertyDescriptor;
@@ -26,8 +27,8 @@
2627
import java.util.List;
2728

2829
import org.apache.commons.beanutils.PropertyUtils;
29-
import org.junit.Assert;
30-
import org.junit.Assume;
30+
import org.junit.jupiter.api.Assertions;
31+
import org.junit.jupiter.api.Assumptions;
3132
import org.junit.jupiter.api.BeforeAll;
3233
import org.junit.jupiter.api.Test;
3334

@@ -37,8 +38,7 @@ class FirstChildBean extends RootBean {
3738
/**
3839
* getPropertyType return null on second descendant class
3940
* <p>
40-
* This test only work in Java 7 or earlier (See BEANUTILS-492) - as
41-
* a weaker alternative, see {@link Jira422bTestCase}.
41+
* This test only work in Java 7 or earlier (See BEANUTILS-492) - as a weaker alternative, see {@link Jira422bTestCase}.
4242
*
4343
*
4444
* @see <a href="https://issues.apache.org/jira/browse/BEANUTILS-422">https://issues.apache.org/jira/browse/BEANUTILS-422</a>
@@ -55,12 +55,12 @@ public static void assumeSupportsIndexedLists() throws IntrospectionException {
5555
final BeanInfo beanInfo = Introspector.getBeanInfo(RootBean.class);
5656
for (final PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
5757
if (pd.getName().equals("file")) {
58-
Assume.assumeTrue("BEANUTILS-492: IndexedPropertyDescriptor no longer supported for java.util.List",
59-
pd instanceof IndexedPropertyDescriptor);
58+
Assumptions.assumeTrue(pd instanceof IndexedPropertyDescriptor,
59+
"BEANUTILS-492: IndexedPropertyDescriptor no longer supported for java.util.List");
6060
return;
6161
}
6262
}
63-
Assert.fail("Could not find PropertyDescriptor for 'file'");
63+
Assertions.fail("Could not find PropertyDescriptor for 'file'");
6464
}
6565

6666
@Test
@@ -76,7 +76,6 @@ public void testSecondChildBean() throws Exception {
7676
final Class<?> propertyType = PropertyUtils.getPropertyType(bean, "file[0]");
7777
assertEquals(String.class.getName(), propertyType.getName());
7878
}
79-
8079
}
8180

8281
@SuppressWarnings("rawtypes")
@@ -100,7 +99,6 @@ public void setFile(final int i, final String file) {
10099
public void setFile(final List file) {
101100
this.file = file;
102101
}
103-
104102
}
105103

106104
class SecondChildBean extends RootBean {

0 commit comments

Comments
 (0)