Interface TestReporter

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    @API(status=STABLE,
         since="5.0")
    public interface TestReporter
    Parameters of type TestReporter can be injected into @BeforeEach and @AfterEach lifecycle methods as well as methods annotated with @Test, @RepeatedTest, @ParameterizedTest, @TestFactory, etc.

    Within such methods the injected TestReporter can be used to publish report entries for the current container or test to the reporting infrastructure.

    Since:
    5.0
    See Also:
    publishEntry(Map), publishEntry(String, String)
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void publishEntry​(java.lang.String value)
      Publish the supplied value as a report entry.
      default void publishEntry​(java.lang.String key, java.lang.String value)
      Publish the supplied key-value pair as a report entry.
      void publishEntry​(java.util.Map<java.lang.String,​java.lang.String> map)
      Publish the supplied map of key-value pairs as a report entry.
    • Method Detail

      • publishEntry

        void publishEntry​(java.util.Map<java.lang.String,​java.lang.String> map)
        Publish the supplied map of key-value pairs as a report entry.
        Parameters:
        map - the key-value pairs to be published; never null; keys and values within entries in the map also must not be null or blank
        See Also:
        publishEntry(String, String), publishEntry(String)
      • publishEntry

        default void publishEntry​(java.lang.String key,
                                  java.lang.String value)
        Publish the supplied key-value pair as a report entry.
        Parameters:
        key - the key of the entry to publish; never null or blank
        value - the value of the entry to publish; never null or blank
        See Also:
        publishEntry(Map), publishEntry(String)
      • publishEntry

        @API(status=STABLE,
             since="5.3")
        default void publishEntry​(java.lang.String value)
        Publish the supplied value as a report entry.

        This method delegates to publishEntry(String, String), supplying "value" as the key and the supplied value argument as the value.

        Parameters:
        value - the value to be published; never null or blank
        Since:
        5.3
        See Also:
        publishEntry(Map), publishEntry(String, String)