Skip to content

Commit

Permalink
Merge pull request #445 from apjanke/just-expected-as-assertion-param…
Browse files Browse the repository at this point in the history
…eter-name

LocalTestServerContext: use "expected[s]" as assertion parameter name
  • Loading branch information
domesticmouse committed Jul 1, 2018
2 parents d0d9010 + 0899b75 commit 7f5a824
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/test/java/com/google/maps/LocalTestServerContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public String path() throws InterruptedException {
return request.getPath().split("\\?")[0];
}

void assertParamValue(String expectedValue, String paramName)
void assertParamValue(String expected, String paramName)
throws URISyntaxException, InterruptedException {
if (this.params == null) {
this.params = this.actualParams();
Expand All @@ -111,25 +111,25 @@ void assertParamValue(String expectedValue, String paramName)
for (NameValuePair pair : params) {
if (pair.getName().equals(paramName)) {
paramFound = true;
assertEquals(expectedValue, pair.getValue());
assertEquals(expected, pair.getValue());
}
}
assertTrue(paramFound);
}

void assertParamValues(List<String> expectedValues, String paramName)
void assertParamValues(List<String> expecteds, String paramName)
throws URISyntaxException, InterruptedException {
if (this.params == null) {
this.params = this.actualParams();
}
int paramsFound = 0;
for (NameValuePair pair : params) {
if (pair.getName().equals(paramName)) {
assertEquals(expectedValues.get(paramsFound), pair.getValue());
assertEquals(expecteds.get(paramsFound), pair.getValue());
paramsFound++;
}
}
assertEquals(paramsFound, expectedValues.size());
assertEquals(paramsFound, expecteds.size());
}

@Override
Expand Down

0 comments on commit 7f5a824

Please sign in to comment.