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

com.liveperson.ephemerals.junit.EphemeralResource Maven / Gradle / Ivy

There is a newer version: 1.0.0.7
Show newest version
package com.liveperson.ephemerals.junit;

import com.liveperson.ephemerals.Ephemeral;
import org.junit.rules.ExternalResource;

/**
 * Created by waseemh on 9/21/16.
 */
public class EphemeralResource extends ExternalResource {

    private Ephemeral ephemeral;

    public EphemeralResource(Ephemeral ephemeral) {
        this.ephemeral = ephemeral;
    }

    @Override
    protected void before() throws Throwable {
        ephemeral.get();
    }

    @Override
    protected void after() {
        ephemeral.destroy();
    }

    public Ephemeral getEphemeral() {
        return ephemeral;
    }

    public T get() {
        return getEphemeral().get();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy