All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.cucumber.plugin.event.Status Maven / Gradle / Ivy

There is a newer version: 7.18.1
Show newest version
package io.cucumber.plugin.event;

import org.apiguardian.api.API;

@API(status = API.Status.STABLE)
public enum Status {
    PASSED,
    SKIPPED,
    PENDING,
    UNDEFINED,
    AMBIGUOUS,
    FAILED,
    UNUSED;

    public boolean is(Status status) {
        return this == status;
    }

    public boolean isOk(boolean isStrict) {
        return hasAlwaysOkStatus() || !isStrict && hasOkWhenNotStrictStatus();
    }

    private boolean hasAlwaysOkStatus() {
        return is(Status.PASSED) || is(Status.SKIPPED);
    }

    private boolean hasOkWhenNotStrictStatus() {
        return is(Status.UNDEFINED) || is(Status.PENDING);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy