aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java
index 5233013582..c1ab43eadf 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java
@@ -100,7 +100,7 @@ public class HttpAuthTest {
} catch (IOException e) {
fail("Couldn't instantiate AuthHeadersResponse: " + e.toString());
}
- HttpAuthMethod authMethod = HttpAuthMethod.scanResponse(response);
+ HttpAuthMethod authMethod = HttpAuthMethod.scanResponse(response, null);
if (!expectedAuthMethod.equals(getAuthMethodName(authMethod))) {
fail("Wrong authentication method: expected " + expectedAuthMethod
@@ -113,7 +113,7 @@ public class HttpAuthTest {
}
private static class AuthHeadersResponse extends JDKHttpConnection {
- Map<String, List<String>> headerFields = new HashMap<String, List<String>>();
+ Map<String, List<String>> headerFields = new HashMap<>();
public AuthHeadersResponse(String[] authHeaders)
throws MalformedURLException, IOException {
@@ -133,16 +133,15 @@ public class HttpAuthTest {
@Override
public String getHeaderField(String name) {
- if (!headerFields.containsKey(name))
+ if (!headerFields.containsKey(name)) {
return null;
- else {
- int n = headerFields.get(name).size();
+ }
+ int n = headerFields.get(name).size();
- if (n > 0)
- return headerFields.get(name).get(n - 1);
- else
- return null;
+ if (n > 0) {
+ return headerFields.get(name).get(n - 1);
}
+ return null;
}
@Override
@@ -161,7 +160,7 @@ public class HttpAuthTest {
String value = header.substring(i + 1).trim();
if (!headerFields.containsKey(key))
- headerFields.put(key, new ArrayList<String>());
+ headerFields.put(key, new ArrayList<>());
List<String> values = headerFields.get(key);
values.add(value);