GitServletResponseTest: Fix testObjectCheckerException

The recent ObjectChecker changes to pass in AnyObjectId as part
of the checkCommit method signature meant the override here was no
longer throwing an exception as expected.

Change-Id: I0383018b48426e25a0bc562387e8cd73cbe13129
This commit is contained in:
Shawn Pearce 2016-01-06 10:17:52 -08:00
parent 5001038f52
commit 24cd8e170d
1 changed files with 4 additions and 2 deletions

View File

@ -60,6 +60,7 @@
import org.eclipse.jgit.http.server.resolver.DefaultReceivePackFactory; import org.eclipse.jgit.http.server.resolver.DefaultReceivePackFactory;
import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.junit.http.HttpTestCase; import org.eclipse.jgit.junit.http.HttpTestCase;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.NullProgressMonitor; import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectChecker; import org.eclipse.jgit.lib.ObjectChecker;
@ -221,8 +222,9 @@ public void testObjectCheckerException() throws Exception {
preHook = null; preHook = null;
oc = new ObjectChecker() { oc = new ObjectChecker() {
@Override @Override
public void checkCommit(byte[] raw) throws CorruptObjectException { public void checkCommit(AnyObjectId id, byte[] raw)
throw new IllegalStateException(); throws CorruptObjectException {
throw new CorruptObjectException("refusing all commits");
} }
}; };