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

io.cucumber.junit.platform.engine.TestCaseResultObserver Maven / Gradle / Ivy

There is a newer version: 7.20.1
Show newest version
package io.cucumber.junit.platform.engine;

import io.cucumber.core.eventbus.EventBus;
import io.cucumber.plugin.event.EventPublisher;
import org.opentest4j.TestAbortedException;

import java.util.function.Function;

class TestCaseResultObserver implements AutoCloseable {

    private final io.cucumber.core.runtime.TestCaseResultObserver delegate;

    private TestCaseResultObserver(EventPublisher bus) {
        this.delegate = new io.cucumber.core.runtime.TestCaseResultObserver(bus);
    }

    static TestCaseResultObserver observe(EventBus bus) {
        return new TestCaseResultObserver(bus);
    }

    void assertTestCasePassed() {
        delegate.assertTestCasePassed(
            TestAbortedException::new,
            Function.identity(),
            UndefinedStepException::new,
            Function.identity());
    }

    @Override
    public void close() {
        delegate.close();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy