1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
Origin: upstream, 2317552993fd5180a84083d599b8cbdb05a07bab
From: Allon Murienik <mureinik@gmail.com>
Date: Mon, 7 Oct 2019 16:28:36 +0300
Subject: FILEUPLOAD-302: JUnit Jupiter migration (#23)
Debian: Backport one assertThrows of the original commit.
@@ -19,6 +19,7 @@ package org.apache.commons.fileupload;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -146,13 +147,13 @@ public void testValidRepository() {
/**
* Test deserialization fails when repository contains a null character.
*/
- @Test(expected=IOException.class)
- public void testInvalidRepositoryWithNullChar() throws Exception {
+ @Test
+ public void testInvalidRepositoryWithNullChar() {
// Create the FileItem
byte[] testFieldValueBytes = createContentBytes(threshold);
File repository = new File(System.getProperty("java.io.tmpdir"), "\0");
FileItem item = createFileItem(testFieldValueBytes, repository);
- deserialize(serialize(item));
+ assertThrows(IOException.class, () -> deserialize(serialize(item)));
}
/**
|