Browse Source

HttpClientConnectionTest: Reformat with the Eclipse style

Change-Id: I1066dea0bbb4573aabaf417365fb46772f0f4d0e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.1
David Pursehouse 6 years ago
parent
commit
0a13545966
  1. 15
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/transport/http/apache/HttpClientConnectionTest.java

15
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/transport/http/apache/HttpClientConnectionTest.java

@ -58,22 +58,26 @@ import static org.junit.Assert.assertTrue;
public class HttpClientConnectionTest { public class HttpClientConnectionTest {
@Test @Test
public void testGetHeaderFieldsAllowMultipleValues() throws MalformedURLException { public void testGetHeaderFieldsAllowMultipleValues()
throws MalformedURLException {
HttpResponse responseMock = new HttpResponseMock(); HttpResponse responseMock = new HttpResponseMock();
String headerField = "WWW-Authenticate"; String headerField = "WWW-Authenticate";
responseMock.addHeader(headerField, "Basic"); responseMock.addHeader(headerField, "Basic");
responseMock.addHeader(headerField, "Digest"); responseMock.addHeader(headerField, "Digest");
responseMock.addHeader(headerField, "NTLM"); responseMock.addHeader(headerField, "NTLM");
HttpClientConnection connection = new HttpClientConnection("http://0.0.0.0/"); HttpClientConnection connection = new HttpClientConnection(
"http://0.0.0.0/");
connection.resp = responseMock; connection.resp = responseMock;
List<String> headerValues = connection.getHeaderFields().get(headerField); List<String> headerValues = connection.getHeaderFields()
.get(headerField);
assertEquals(3, headerValues.size()); assertEquals(3, headerValues.size());
assertTrue(headerValues.contains("Basic")); assertTrue(headerValues.contains("Basic"));
assertTrue(headerValues.contains("Digest")); assertTrue(headerValues.contains("Digest"));
assertTrue(headerValues.contains("NTLM")); assertTrue(headerValues.contains("NTLM"));
} }
private class HttpResponseMock extends AbstractHttpMessage implements HttpResponse { private class HttpResponseMock extends AbstractHttpMessage
implements HttpResponse {
@Override @Override
public StatusLine getStatusLine() { public StatusLine getStatusLine() {
return null; return null;
@ -90,7 +94,8 @@ public class HttpClientConnectionTest {
} }
@Override @Override
public void setStatusLine(ProtocolVersion protocolVersion, int i, String s) { public void setStatusLine(ProtocolVersion protocolVersion, int i,
String s) {
} }

Loading…
Cancel
Save