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

org.junit.jupiter.api.TestReporter Maven / Gradle / Ivy

There is a newer version: 5.11.0-M1
Show newest version
/*
 * Copyright 2015-2018 the original author or authors.
 *
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v2.0 which
 * accompanies this distribution and is available at
 *
 * http://www.eclipse.org/legal/epl-v20.html
 */

package org.junit.jupiter.api;

import static org.apiguardian.api.API.Status.STABLE;

import java.util.Collections;
import java.util.Map;

import org.apiguardian.api.API;

/**
 * Parameters of type {@code TestReporter} can be injected into
 * {@link BeforeEach @BeforeEach} and {@link AfterEach @AfterEach} lifecycle
 * methods as well as methods annotated with {@link Test @Test},
 * {@link RepeatedTest @RepeatedTest},
 * {@link org.junit.jupiter.params.ParameterizedTest @ParameterizedTest},
 * {@link TestFactory @TestFactory}, etc.
 *
 * 

Within such methods the injected {@code TestReporter} can be used to * publish report entries. * * @since 5.0 * @see #publishEntry(Map) * @see #publishEntry(String, String) */ @FunctionalInterface @API(status = STABLE, since = "5.0") public interface TestReporter { /** * Publish the supplied map of key-value pairs as a report entry. * * @param map the key-value pairs to be published; never {@code null}; * keys and values within entries in the map also must not be * {@code null} or blank * @see #publishEntry(String, String) */ void publishEntry(Map map); /** * Publish the supplied key-value pair as a report entry. * * @param key the key of the entry to publish * @param value the value of the entry to publish * @see #publishEntry(Map) */ default void publishEntry(String key, String value) { this.publishEntry(Collections.singletonMap(key, value)); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy