Class ScopedObject<T>

  • Type Parameters:
    T - Parameter type
    All Implemented Interfaces:
    java.util.function.Supplier<T>, org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource

    public class ScopedObject<T>
    extends Object
    implements java.util.function.Supplier<T>, org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
    A parameter as an object with a scope and that can be closed when the scope exits.

    This is useful for parameter providers.

    Author:
    Julien Ponge
    • Method Detail

      • close

        public void close()
                   throws Throwable
        Specified by:
        close in interface org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
        Throws:
        Throwable
      • get

        public T get()
        Specified by:
        get in interface java.util.function.Supplier<T>