@Test
public void testVerifyForm() throws IOException {
- executeSuccess("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
+ String body = executeSuccess("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10");
+ assertThat(body, containsString("10"));
+ assertThat(body, containsString(applicantM));
}
@Test
uc.getOutputStream().write(("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10").getBytes("UTF-8"));
uc.getOutputStream().flush();
assertEquals(500, uc.getResponseCode());
+ uc.getErrorStream().close();
}
@Test
uc.getOutputStream().write(("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10&csrf=aragc").getBytes("UTF-8"));
uc.getOutputStream().flush();
assertEquals(500, uc.getResponseCode());
+ uc.getErrorStream().close();
}
@Test
}
- private void executeSuccess(String query) throws MalformedURLException, IOException {
- assertThat(execute(query), hasNoError());
-
+ private String executeSuccess(String query) throws MalformedURLException, IOException {
+ String response = execute(query);
+ assertThat(response, hasNoError());
+ return response;
}
private String execute(String query) throws MalformedURLException, IOException {