Skip to content

A free, open-source alternative to Burp Suite: an intercepting proxy and web app security testing suite with Repeater, Intruder, Collaborator and a built-in OWASP ZAP scanner. Linux, AGPL-3.0.

929 B
Raw Blame
package opensuite.ui;

import opensuite.testkit.Expect;
import opensuite.testkit.Harness;

/** The application closes at once when nothing would be lost, and says what would be when something would. */
public final class ExitPromptTest {
    public void run() {
        Harness.suite("exit prompt");

        Harness.test("nothing to lose: no question", () -> {
            Expect.equal(ExitPrompt.risk(false, false), "", "the close button simply closes");
        });

        Harness.test("what would be lost is said", () -> {
            Expect.isTrue(ExitPrompt.risk(true, false).contains("scan is running"), "a running scan");
            Expect.isTrue(ExitPrompt.risk(false, true).contains("not saved to a file"), "a project in no file");
            String both = ExitPrompt.risk(true, true);
            Expect.isTrue(both.contains("scan is running") && both.contains("not saved to a file"), "both");
        });
    }
}