chore: cleanup IT tests (#2040)

This commit is contained in:
Nanne Baars
2025-02-28 18:39:23 +01:00
committed by GitHub
parent b5af30c819
commit 55bd0a49db
24 changed files with 233 additions and 297 deletions

View File

@ -21,14 +21,14 @@ public class LabelAndHintIntegrationTest extends IntegrationTest {
@Test
public void testSingleLabel() {
Assertions.assertTrue(true);
JsonPath jsonPath =
JsonPath jsonPath =
RestAssured.given()
.when()
.relaxedHTTPSValidation()
.contentType(ContentType.JSON)
.header("Accept-Language", "en")
.cookie("JSESSIONID", getWebGoatCookie())
.get(url("service/labels.mvc"))
.get(webGoatUrlConfig.url("service/labels.mvc"))
.then()
.statusCode(200)
.extract()
@ -39,14 +39,14 @@ public class LabelAndHintIntegrationTest extends IntegrationTest {
jsonPath.getString(ESCAPE_JSON_PATH_CHAR + "http-basics.close" + ESCAPE_JSON_PATH_CHAR));
// check if lang parameter overrules Accept-Language parameter
jsonPath =
jsonPath =
RestAssured.given()
.when()
.relaxedHTTPSValidation()
.contentType(ContentType.JSON)
.header("Accept-Language", "en")
.cookie("JSESSIONID", getWebGoatCookie())
.get(url("service/labels.mvc?lang=nl"))
.get(webGoatUrlConfig.url("service/labels.mvc?lang=nl"))
.then()
.statusCode(200)
.extract()
@ -55,14 +55,14 @@ public class LabelAndHintIntegrationTest extends IntegrationTest {
"Gebruikersnaam",
jsonPath.getString(ESCAPE_JSON_PATH_CHAR + "username" + ESCAPE_JSON_PATH_CHAR));
jsonPath =
jsonPath =
RestAssured.given()
.when()
.relaxedHTTPSValidation()
.contentType(ContentType.JSON)
.header("Accept-Language", "en")
.cookie("JSESSIONID", getWebGoatCookie())
.get(url("service/labels.mvc?lang=de"))
.get(webGoatUrlConfig.url("service/labels.mvc?lang=de"))
.then()
.statusCode(200)
.extract()
@ -72,14 +72,14 @@ public class LabelAndHintIntegrationTest extends IntegrationTest {
jsonPath.getString(ESCAPE_JSON_PATH_CHAR + "username" + ESCAPE_JSON_PATH_CHAR));
// check if invalid language returns english
jsonPath =
jsonPath =
RestAssured.given()
.when()
.relaxedHTTPSValidation()
.contentType(ContentType.JSON)
.header("Accept-Language", "nl")
.cookie("JSESSIONID", getWebGoatCookie())
.get(url("service/labels.mvc?lang=xx"))
.get(webGoatUrlConfig.url("service/labels.mvc?lang=xx"))
.then()
.statusCode(200)
.extract()
@ -88,14 +88,14 @@ public class LabelAndHintIntegrationTest extends IntegrationTest {
"Username", jsonPath.getString(ESCAPE_JSON_PATH_CHAR + "username" + ESCAPE_JSON_PATH_CHAR));
// check if invalid language returns english
jsonPath =
jsonPath =
RestAssured.given()
.when()
.relaxedHTTPSValidation()
.contentType(ContentType.JSON)
.header("Accept-Language", "xx_YY")
.cookie("JSESSIONID", getWebGoatCookie())
.get(url("service/labels.mvc"))
.get(webGoatUrlConfig.url("service/labels.mvc"))
.then()
.statusCode(200)
.extract()
@ -200,14 +200,14 @@ public class LabelAndHintIntegrationTest extends IntegrationTest {
}
private JsonPath getLabels(String lang) {
return RestAssured.given()
return RestAssured.given()
.when()
.relaxedHTTPSValidation()
.contentType(ContentType.JSON)
.header("Accept-Language", lang)
.cookie("JSESSIONID", getWebGoatCookie())
// .log().headers()
.get(url("service/labels.mvc"))
.get(webGoatUrlConfig.url("service/labels.mvc"))
.then()
// .log().all()
.statusCode(200)
@ -216,13 +216,13 @@ public class LabelAndHintIntegrationTest extends IntegrationTest {
}
private List<String> getHints() {
JsonPath jsonPath =
JsonPath jsonPath =
RestAssured.given()
.when()
.relaxedHTTPSValidation()
.contentType(ContentType.JSON)
.cookie("JSESSIONID", getWebGoatCookie())
.get(url("service/hint.mvc"))
.get(webGoatUrlConfig.url("service/hint.mvc"))
.then()
// .log().all()
.statusCode(200)