Polishing

This commit is contained in:
Andy Wilkinson
2016-08-10 17:08:18 +01:00
parent a9305cba87
commit b430a88796
3 changed files with 10 additions and 12 deletions

View File

@@ -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) {

View File

@@ -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

View File

@@ -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