Polishing
This commit is contained in:
@@ -223,10 +223,7 @@ public class CurlRequestSnippet extends TemplatedSnippet {
|
||||
|
||||
@Override
|
||||
public boolean allow(String name, List<String> value) {
|
||||
if (HttpHeaders.AUTHORIZATION.equals(name) && isBasicAuthHeader(value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return !(HttpHeaders.AUTHORIZATION.equals(name) && isBasicAuthHeader(value));
|
||||
}
|
||||
|
||||
static boolean isBasicAuthHeader(List<String> value) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -80,10 +80,7 @@ public class Link {
|
||||
if (!this.href.equals(other.href)) {
|
||||
return false;
|
||||
}
|
||||
if (!this.rel.equals(other.rel)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return this.rel.equals(other.rel);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -82,10 +82,14 @@ public final class SnippetMatchers {
|
||||
}
|
||||
|
||||
protected void addLine(int index, String line) {
|
||||
if (index < 0) {
|
||||
index = index + this.lines.size();
|
||||
this.lines.add(determineIndex(index), line);
|
||||
}
|
||||
|
||||
private int determineIndex(int index) {
|
||||
if (index >= 0) {
|
||||
return index;
|
||||
}
|
||||
this.lines.add(index, line);
|
||||
return index + this.lines.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user