net.masterthought.cucumber.json.support.Status Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cucumber-reporting Show documentation
Show all versions of cucumber-reporting Show documentation
Provides pretty html reports for Cucumber. It works by generating html from the cucumber json file.
package net.masterthought.cucumber.json.support;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import net.masterthought.cucumber.json.deserializers.StatusDeserializer;
/**
* Defines all possible statuses provided by cucumber library.
*
* @author Damian Szczepanik (damianszczepanik@github)
*/
@JsonDeserialize(using = StatusDeserializer.class)
public enum Status {
PASSED,
FAILED,
SKIPPED,
PENDING,
UNDEFINED;
/**
* Returns name of the status converted to lower case characters.
* @return status name as lowercase
*/
public String getRawName() {
return name().toLowerCase();
}
/**
* Returns name of the status formatted with first letter to uppercase and lowercase others.
*
* @return status formatted with first letter to uppercase
*/
public String getLabel() {
return name().substring(0, 1).toUpperCase() + name().substring(1).toLowerCase();
}
/**
* Returns true if status is equal to {@link #PASSED}.
*
* @return true
if the status is PASSED
, otherwise false
*/
public boolean isPassed() {
return this == PASSED;
}
}