Source:
public void testInitialClone_WithAuthentication() throws Exception { Repository dst = createBareRepository(); assertFalse(dst.hasObject(A_txt)); try (Transport t = Transport.open(dst, authURI)) { t.setCredentialsProvider(testCredentials); t.fetch(NullProgressMonitor.INSTANCE, mirror(master)); } assertTrue(dst.hasObject(A_txt)); assertEquals(B, dst.exactRef(master).getObjectId()); fsck(dst, B); List<AccessEvent> requests = getRequests(); assertEquals(3, requests.size()); AccessEvent info = requests.get(0); assertEquals("GET", info.getMethod()); assertEquals(401, info.getStatus()); assertNotNull(info.getResponseHeader(HDR_WWW_AUTHENTICATE)); assertTrue(info.getResponseHeader(HDR_WWW_AUTHENTICATE).toLowerCase().startsWith("basic realm=")); info = requests.get(1); assertEquals("GET", info.getMethod()); assertEquals(join(authURI, "info/refs"), info.getPath()); assertEquals(1, info.getParameters().size()); assertEquals("git-upload-pack", info.getParameter("service")); assertEquals(200, info.getStatus()); assertEquals("application/x-git-upload-pack-advertisement", info.getResponseHeader(HDR_CONTENT_TYPE)); assertEquals("gzip", info.getResponseHeader(HDR_CONTENT_ENCODING)); AccessEvent service = requests.get(2); assertEquals("POST", service.getMethod()); assertEquals(join(authURI, "git-upload-pack"), service.getPath()); assertEquals(0, service.getParameters().size()); assertNotNull("has content-length", service.getRequestHeader(HDR_CONTENT_LENGTH)); assertNull("not chunked", service.getRequestHeader(HDR_TRANSFER_ENCODING)); assertEquals(200, service.getStatus()); assertEquals("application/x-git-upload-pack-result", service.getResponseHeader(HDR_CONTENT_TYPE)); }

Target:
public void testInitialClone_WithAuthentication() throws Exception { Repository dst = createBareRepository(); assertFalse(dst.hasObject(A_txt)); try (Transport t = Transport.open(dst, authURI)) { t.setCredentialsProvider(testCredentials); t.fetch(NullProgressMonitor.INSTANCE, mirror(master)); } assertTrue(dst.hasObject(A_txt)); assertEquals(B, dst.exactRef(master).getObjectId()); fsck(dst, B); List<AccessEvent> requests = getRequests(); assertEquals(3, requests.size()); AccessEvent info = requests.get(0); assertEquals("GET", info.getMethod()); assertEquals(401, info.getStatus()); assertStartsWithIgnoreCase(info.getResponseHeader(HDR_WWW_AUTHENTICATE), "basic realm="); info = requests.get(1); assertEquals("GET", info.getMethod()); assertEquals(join(authURI, "info/refs"), info.getPath()); assertEquals(1, info.getParameters().size()); assertEquals("git-upload-pack", info.getParameter("service")); assertEquals(200, info.getStatus()); assertEquals("application/x-git-upload-pack-advertisement", info.getResponseHeader(HDR_CONTENT_TYPE)); assertEquals("gzip", info.getResponseHeader(HDR_CONTENT_ENCODING)); AccessEvent service = requests.get(2); assertEquals("POST", service.getMethod()); assertEquals(join(authURI, "git-upload-pack"), service.getPath()); assertEquals(0, service.getParameters().size()); assertNotNull("has content-length", service.getRequestHeader(HDR_CONTENT_LENGTH)); assertNull("not chunked", service.getRequestHeader(HDR_TRANSFER_ENCODING)); assertEquals(200, service.getStatus()); assertEquals("application/x-git-upload-pack-result", service.getResponseHeader(HDR_CONTENT_TYPE)); }