Class ScopedObject<T>

java.lang.Object
io.vertx.junit5.ScopedObject<T>
Type Parameters:
T - Parameter type
All Implemented Interfaces:
AutoCloseable, Supplier<T>, org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource

public class ScopedObject<T> extends Object implements Supplier<T>, org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource, AutoCloseable
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 Details

    • close

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

      public T get()
      Specified by:
      get in interface Supplier<T>