From 981e403e599fc152ef11b1f919464d513973b3e5 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Sat, 29 Sep 2018 13:20:02 +0900 Subject: [PATCH] TestProtocolTest: Add missing calls to fail() Error Prone reports: Not calling fail() when expecting an exception masks bugs See https://errorprone.info/bugpattern/MissingFail Change-Id: I58ad45a87dcf7d646dce056d20776d62faafbfef Signed-off-by: David Pursehouse --- .../tst/org/eclipse/jgit/transport/TestProtocolTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TestProtocolTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TestProtocolTest.java index 953c9fc30..1c4d0cfe2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TestProtocolTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TestProtocolTest.java @@ -46,6 +46,7 @@ package org.eclipse.jgit.transport; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.util.ArrayList; import java.util.List; @@ -238,6 +239,7 @@ public class TestProtocolTest { .setRemote(user1Uri.toString()) .setRefSpecs(MASTER) .call(); + fail("accepted not permitted fetch"); } catch (InvalidRemoteException expected) { // Expected. } @@ -282,6 +284,7 @@ public class TestProtocolTest { .setRemote(user1Uri.toString()) .setRefSpecs(HEADS) .call(); + fail("accepted not permitted push"); } catch (TransportException expected) { assertTrue(expected.getMessage().contains( JGitText.get().pushNotPermitted));