aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ProtocolV2ParserTest.java
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2020-01-22 00:48:24 +0100
committerDavid Pursehouse <david.pursehouse@gmail.com>2020-01-24 15:46:08 +0900
commit8ada9048c5add754c3b34851b1bd501ce28b3321 (patch)
tree9585b6b6a4bb3459039cda84bacac1311b2ebc7a /org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ProtocolV2ParserTest.java
parentb5cabfbff207c30cff0b082d0aed553b5ae8a785 (diff)
downloadjgit-8ada9048c5add754c3b34851b1bd501ce28b3321.tar.gz
jgit-8ada9048c5add754c3b34851b1bd501ce28b3321.zip
Replace ExpectedException which was deprecated in junit 4.13
Change-Id: I64b0c057dd0a12aef2f3d56fa0c8a10e3b23fffd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ProtocolV2ParserTest.java')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ProtocolV2ParserTest.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ProtocolV2ParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ProtocolV2ParserTest.java
index f9300cd0fc..038ce717b3 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ProtocolV2ParserTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ProtocolV2ParserTest.java
@@ -14,6 +14,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItems;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayInputStream;
@@ -27,15 +28,10 @@ import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.revwalk.RevCommit;
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.ExpectedException;
public class ProtocolV2ParserTest {
- @Rule
- public ExpectedException thrown = ExpectedException.none();
-
private TestRepository<InMemoryRepository> testRepo;
@Before
@@ -236,8 +232,8 @@ public class ProtocolV2ParserTest {
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.start().allowFilter().done());
- thrown.expect(PackProtocolException.class);
- parser.parseFetchRequest(pckIn);
+ assertThrows(PackProtocolException.class,
+ () -> parser.parseFetchRequest(pckIn));
}
@Test
@@ -247,8 +243,8 @@ public class ProtocolV2ParserTest {
ProtocolV2Parser parser = new ProtocolV2Parser(
ConfigBuilder.getDefault());
- thrown.expect(PackProtocolException.class);
- parser.parseFetchRequest(pckIn);
+ assertThrows(PackProtocolException.class,
+ () -> parser.parseFetchRequest(pckIn));
}
@Test