Top Description Inners Methods
org.junit.platform.engine.support.discovery

public Interface DiscoveryIssueReporter

Annotations
@API
status:EXPERIMENTAL
since:6.0
Static Imports
org.apiguardian.api.API.Status.EXPERIMENTAL

DiscoveryIssueReporter defines the API for reporting DiscoveryIssues.

This interface is not intended to be implemented by clients.

Since
1.13
See Also
SelectorResolver.Context

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
DiscoveryIssueReporter.Condition<T>

A Condition is a union of Predicate and Consumer.

Method Summary

Modifier and TypeMethod and Description
public static DiscoveryIssueReporter
collecting(Collection<? super DiscoveryIssue>
the collection to add issues to; never null
collection
)

Create a new DiscoveryIssueReporter that adds reported issues to the supplied collection.

public static DiscoveryIssueReporter
consuming(Consumer<? super DiscoveryIssue>
the consumer to report issues to; never null
consumer
)

Create a new DiscoveryIssueReporter that adds reported issues to the supplied consumer.

public default <T> DiscoveryIssueReporter.Condition<T>

Returns:

a new Condition; never null
createReportingCondition
(Predicate<T>
the predicate to test; never null
predicate
,
Function<T, DiscoveryIssue>
the function to create the issue with; never null
issueCreator
)

Create a Condition that reports a DiscoveryIssue when the supplied Predicate is not met.

public static DiscoveryIssueReporter
deduplicating(DiscoveryIssueReporter
the delegate to forward issues to; never null
delegate
)

Create a new DiscoveryIssueReporter that avoids reporting duplicate issues.

public static DiscoveryIssueReporter
forwarding(EngineDiscoveryListener
the listener to report issues to; never null
engineDiscoveryListener
,
UniqueId
the unique identifier of the engine; never null
engineId
)

Create a new DiscoveryIssueReporter that reports issues to the supplied EngineDiscoveryListener for the specified engine.

public default void
reportIssue(DiscoveryIssue.Builder builder)

Build the supplied Builder and report the resulting DiscoveryIssue.

public void
reportIssue(DiscoveryIssue issue)

Report the supplied DiscoveryIssue.

Method Detail

collectingback to summary
public static DiscoveryIssueReporter collecting(Collection<? super DiscoveryIssue> collection)

Create a new DiscoveryIssueReporter that adds reported issues to the supplied collection.

Parameters
collection:Collection<? super DiscoveryIssue>

the collection to add issues to; never null

consumingback to summary
public static DiscoveryIssueReporter consuming(Consumer<? super DiscoveryIssue> consumer)

Create a new DiscoveryIssueReporter that adds reported issues to the supplied consumer.

Parameters
consumer:Consumer<? super DiscoveryIssue>

the consumer to report issues to; never null

createReportingConditionback to summary
public default <T> DiscoveryIssueReporter.Condition<T> createReportingCondition(Predicate<T> predicate, Function<T, DiscoveryIssue> issueCreator)

Create a Condition that reports a DiscoveryIssue when the supplied Predicate is not met.

Parameters
predicate:Predicate<T>

the predicate to test; never null

issueCreator:Function<T, DiscoveryIssue>

the function to create the issue with; never null

Returns:DiscoveryIssueReporter.Condition<T>

a new Condition; never null

deduplicatingback to summary
public static DiscoveryIssueReporter deduplicating(DiscoveryIssueReporter delegate)

Create a new DiscoveryIssueReporter that avoids reporting duplicate issues.

The implementation returned by this method is not thread-safe.

Parameters
delegate:DiscoveryIssueReporter

the delegate to forward issues to; never null

forwardingback to summary
public static DiscoveryIssueReporter forwarding(EngineDiscoveryListener engineDiscoveryListener, UniqueId engineId)

Create a new DiscoveryIssueReporter that reports issues to the supplied EngineDiscoveryListener for the specified engine.

Parameters
engineDiscoveryListener:EngineDiscoveryListener

the listener to report issues to; never null

engineId:UniqueId

the unique identifier of the engine; never null

reportIssueback to summary
public default void reportIssue(DiscoveryIssue.Builder builder)

Build the supplied Builder and report the resulting DiscoveryIssue.

reportIssueback to summary
public void reportIssue(DiscoveryIssue issue)

Report the supplied DiscoveryIssue.

org.junit.platform.engine.support.discovery back to summary

public Interface DiscoveryIssueReporter.Condition<T>


A Condition is a union of Predicate and Consumer.

Instances of this type may be used as Predicates or Consumers. For example, a Condition may be passed to java.util.stream.Stream#filter(Predicate) if it is used for filtering, or to java.util.stream.Stream#peek(Consumer) if it is only used for reporting or other side effects.

This interface is not intended to be implemented by clients.

See Also
createReportingCondition(Predicate, Function)

Method Summary

Modifier and TypeMethod and Description
public static <T> DiscoveryIssueReporter.Condition<T>
alwaysSatisfied()

Create a Condition that is always satisfied.

public default DiscoveryIssueReporter.Condition<T>

Returns:

the composed condition; never null
and
(DiscoveryIssueReporter.Condition<? super T> that)

Return a composed condition that represents a logical AND of this and the supplied condition.

public boolean
check(T value)

Evaluate this condition to potentially report an issue.

public default Consumer<T>

Returns:

this condition as a Consumer
toConsumer
()

Returns this condition as a Consumer.

public default Predicate<T>

Returns:

this condition as a Predicate
toPredicate
()

Returns this condition as a Predicate.

Method Detail

alwaysSatisfiedback to summary
public static <T> DiscoveryIssueReporter.Condition<T> alwaysSatisfied()

Create a Condition that is always satisfied.

andback to summary
public default DiscoveryIssueReporter.Condition<T> and(DiscoveryIssueReporter.Condition<? super T> that)

Return a composed condition that represents a logical AND of this and the supplied condition.

The default implementation avoids short-circuiting so both conditions will be evaluated even if this condition returns false to ensure that all issues are reported.

Returns:DiscoveryIssueReporter.Condition<T>

the composed condition; never null

Annotations
@SuppressWarnings:ShortCircuitBoolean
checkback to summary
public boolean check(T value)

Evaluate this condition to potentially report an issue.

toConsumerback to summary
public default Consumer<T> toConsumer()

Returns this condition as a Consumer.

Returns:Consumer<T>

this condition as a Consumer

toPredicateback to summary
public default Predicate<T> toPredicate()

Returns this condition as a Predicate.

Returns:Predicate<T>

this condition as a Predicate