Top Description Fields Constructors Methods
org.junit.platform.testkit.engine

public Class EventStatistics

extends Object
Class Inheritance
Annotations
@API
status:MAINTAINED
since:1.7
Static Imports
org.apiguardian.api.API.Status.MAINTAINED, org.junit.platform.testkit.engine.Assertions.assertEquals

EventStatistics provides a fluent API for asserting statistics for events.

EventStatistics is used in conjunction with Events#assertStatistics(java.util.function.Consumer) as in the following example.

events.assertStatistics(stats -> stats.started(1).succeeded(1).failed(0));

Since
1.4
See Also
Event, Events

Field Summary

Modifier and TypeField and Description
private final Events
private final List<Assertions.Executable>

Constructor Summary

AccessConstructor and Description
pack-priv
EventStatistics(Events events, String category)

Method Summary

Modifier and TypeMethod and Description
public EventStatistics

Returns:

this EventStatistics for method chaining
aborted
(long
the expected number of events
expected
)

Specify the number of expected aborted events.

pack-priv void
public EventStatistics

Returns:

this EventStatistics for method chaining
dynamicallyRegistered
(long
the expected number of events
expected
)

Specify the number of expected dynamic registration events.

public EventStatistics

Returns:

this EventStatistics for method chaining
failed
(long
the expected number of events
expected
)

Specify the number of expected failed events.

public EventStatistics

Returns:

this EventStatistics for method chaining
fileEntryPublished
(long
the expected number of events
expected
)

Specify the number of expected file entry publication events.

public EventStatistics

Returns:

this EventStatistics for method chaining
finished
(long
the expected number of events
expected
)

Specify the number of expected finished events.

public EventStatistics

Returns:

this EventStatistics for method chaining
reportingEntryPublished
(long
the expected number of events
expected
)

Specify the number of expected reporting entry publication events.

public EventStatistics

Returns:

this EventStatistics for method chaining
skipped
(long
the expected number of events
expected
)

Specify the number of expected skipped events.

public EventStatistics

Returns:

this EventStatistics for method chaining
started
(long
the expected number of events
expected
)

Specify the number of expected started events.

public EventStatistics

Returns:

this EventStatistics for method chaining
succeeded
(long
the expected number of events
expected
)

Specify the number of expected succeeded events.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

eventsback to summary
private final Events events
executablesback to summary
private final List<Assertions.Executable> executables

Constructor Detail

EventStatisticsback to summary
pack-priv EventStatistics(Events events, String category)

Method Detail

abortedback to summary
public EventStatistics aborted(long expected)

Specify the number of expected aborted events.

Parameters
expected:long

the expected number of events

Returns:EventStatistics

this EventStatistics for method chaining

assertAllback to summary
pack-priv void assertAll()
dynamicallyRegisteredback to summary
public EventStatistics dynamicallyRegistered(long expected)

Specify the number of expected dynamic registration events.

Parameters
expected:long

the expected number of events

Returns:EventStatistics

this EventStatistics for method chaining

failedback to summary
public EventStatistics failed(long expected)

Specify the number of expected failed events.

Parameters
expected:long

the expected number of events

Returns:EventStatistics

this EventStatistics for method chaining

fileEntryPublishedback to summary
public EventStatistics fileEntryPublished(long expected)

Specify the number of expected file entry publication events.

Parameters
expected:long

the expected number of events

Returns:EventStatistics

this EventStatistics for method chaining

Annotations
@API
status:MAINTAINED
since:1.13.3
Since
1.12
finishedback to summary
public EventStatistics finished(long expected)

Specify the number of expected finished events.

Parameters
expected:long

the expected number of events

Returns:EventStatistics

this EventStatistics for method chaining

reportingEntryPublishedback to summary
public EventStatistics reportingEntryPublished(long expected)

Specify the number of expected reporting entry publication events.

Parameters
expected:long

the expected number of events

Returns:EventStatistics

this EventStatistics for method chaining

skippedback to summary
public EventStatistics skipped(long expected)

Specify the number of expected skipped events.

Parameters
expected:long

the expected number of events

Returns:EventStatistics

this EventStatistics for method chaining

startedback to summary
public EventStatistics started(long expected)

Specify the number of expected started events.

Parameters
expected:long

the expected number of events

Returns:EventStatistics

this EventStatistics for method chaining

succeededback to summary
public EventStatistics succeeded(long expected)

Specify the number of expected succeeded events.

Parameters
expected:long

the expected number of events

Returns:EventStatistics

this EventStatistics for method chaining