Skip to content

Commit

Permalink
Fix for accidentally disabled integration tests (WebGoat#997)
Browse files Browse the repository at this point in the history
* drop column is no longer required due to better db seperation
'

* integration test fix with BeforeAll
  • Loading branch information
zubcevic authored May 19, 2021
1 parent a1071e9 commit a53ba0a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.hamcrest.MatcherAssert;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.BeforeAll;
import org.owasp.webwolf.WebWolf;
import org.springframework.boot.builder.SpringApplicationBuilder;

Expand Down Expand Up @@ -47,7 +48,7 @@ public abstract class IntegrationTest {

private static boolean started = false;

@BeforeEach
@BeforeAll
public static void beforeAll() {
if (WG_SSL) {
WEBGOAT_URL = WEBGOAT_URL.replace("http:", "https:");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void runTests() throws InterruptedException {
throw new IllegalStateException(e);
}
}).count();
System.out.println("counted status 500: "+countStatusCode500);
System.err.println("counted status 500: "+countStatusCode500);
Assertions.assertThat(countStatusCode500).isLessThanOrEqualTo((NUMBER_OF_CALLS - (NUMBER_OF_CALLS/NUMBER_OF_PARALLEL_THREADS)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public void setUpAndLogin() {
driver.findElement(By.name("agree")).click();
driver.findElement(By.className("btn-primary")).click();
}
} catch (IllegalStateException e) {
System.err.println("Web driver not found here: "+System.getProperty("webdriver.gecko.driver"));
} catch (Exception e) {
System.err.println("Selenium test failed "+System.getProperty("webdriver.gecko.driver")+", message: "+e.getMessage());
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ public void runTests() {
params.put("query", sql_4_add);
checkAssignment(url("/WebGoat/SqlInjection/attack4"), params, true);

params.clear();
params.put("query", sql_4_drop);
checkAssignment(url("/WebGoat/SqlInjection/attack4"), params, false);

params.clear();
params.put("query", sql_5);
checkAssignment(url("/WebGoat/SqlInjection/attack5"), params, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public AttackResult createNewComment(HttpServletRequest request, @RequestBody St
secure = true;
}
Comment comment = comments.parseXml(commentStr, secure);
System.err.println("Comment " + comment);
//System.err.println("Comment " + comment);
comments.addComment(comment, false);
if (checkSolution(comment)) {
return success(this).build();
Expand Down

0 comments on commit a53ba0a

Please sign in to comment.