Browse Source

SmartClientSmartServerTest: Stop using deprecated Repository#hasObject

Change-Id: I75d1105934aeaac89476603e15cf642a65a3acbe
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.4
David Pursehouse 6 years ago
parent
commit
283830a643
  1. 8
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java

8
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java

@ -487,20 +487,20 @@ public class SmartClientSmartServerTest extends HttpTestCase {
@Test @Test
public void testFetchBySHA1() throws Exception { public void testFetchBySHA1() throws Exception {
Repository dst = createBareRepository(); Repository dst = createBareRepository();
assertFalse(dst.hasObject(A_txt)); assertFalse(dst.getObjectDatabase().has(A_txt));
try (Transport t = Transport.open(dst, remoteURI)) { try (Transport t = Transport.open(dst, remoteURI)) {
t.fetch(NullProgressMonitor.INSTANCE, t.fetch(NullProgressMonitor.INSTANCE,
Collections.singletonList(new RefSpec(B.name()))); Collections.singletonList(new RefSpec(B.name())));
} }
assertTrue(dst.hasObject(A_txt)); assertTrue(dst.getObjectDatabase().has(A_txt));
} }
@Test @Test
public void testFetchBySHA1Unreachable() throws Exception { public void testFetchBySHA1Unreachable() throws Exception {
Repository dst = createBareRepository(); Repository dst = createBareRepository();
assertFalse(dst.hasObject(A_txt)); assertFalse(dst.getObjectDatabase().has(A_txt));
try (Transport t = Transport.open(dst, remoteURI)) { try (Transport t = Transport.open(dst, remoteURI)) {
thrown.expect(TransportException.class); thrown.expect(TransportException.class);
@ -515,7 +515,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
public void testFetchBySHA1UnreachableByAdvertiseRefsHook() public void testFetchBySHA1UnreachableByAdvertiseRefsHook()
throws Exception { throws Exception {
Repository dst = createBareRepository(); Repository dst = createBareRepository();
assertFalse(dst.hasObject(A_txt)); assertFalse(dst.getObjectDatabase().has(A_txt));
advertiseRefsHook = new AbstractAdvertiseRefsHook() { advertiseRefsHook = new AbstractAdvertiseRefsHook() {
@Override @Override

Loading…
Cancel
Save