
com.github.invictum.Session Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of invictum-test-core Show documentation
Show all versions of invictum-test-core Show documentation
Used as a base for automation. Based on Serenity BDD project.
The newest version!
package com.github.invictum;
import net.serenitybdd.core.Serenity;
public class Session {
private Session() {
//disable constructor
}
public static void put(Object key, Object value) {
Serenity.getCurrentSession().put(key, value);
}
public static void putGracefully(Object key, Object value) {
if (!Serenity.getCurrentSession().containsKey(key)) {
Serenity.getCurrentSession().put(key, value);
}
}
public static String get(Object key) {
return (String) Serenity.getCurrentSession().get(key);
}
@SuppressWarnings("unchecked")
public static T get(final Object key, final Class valueClass) {
Object raw = Serenity.getCurrentSession().get(key);
return (raw != null && raw.getClass().equals(valueClass)) ? (T) raw : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy