BasePackWriterTest: use assertThrows instead of @Test(expected=...)

Change-Id: Ib65b06905de3266b8894e121ca61cbb0b6909d60
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BasePackWriterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BasePackWriterTest.java
index d4e4cb3..ef634d6 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BasePackWriterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BasePackWriterTest.java
@@ -16,6 +16,7 @@
 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;
 import static org.mockito.ArgumentMatchers.any;
@@ -201,11 +202,13 @@ public void testWriteEmptyPack2() throws IOException {
 	 *
 	 * @throws IOException
 	 */
-	@Test(expected = MissingObjectException.class)
+	@Test
 	public void testNotIgnoreNonExistingObjects() throws IOException {
 		final ObjectId nonExisting = ObjectId
 				.fromString("0000000000000000000000000000000000000001");
-			createVerifyOpenPack(NONE, haves(nonExisting), false, false);
+		assertThrows(MissingObjectException.class,
+				() -> createVerifyOpenPack(NONE, haves(nonExisting), false,
+						false));
 	}
 
 	/**