Switch (mostly) to JPA generic events (#2104)

instead of EclipseLink specific

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-11-26 12:59:45 +02:00
committed by GitHub
parent 46c83feb6b
commit d435c0a424
18 changed files with 219 additions and 481 deletions

View File

@@ -58,21 +58,20 @@ public class EventVerifier extends AbstractTestExecutionListener {
* executor in the ApplicationEventMultiCaster, so the order of the events
* keep the same.
*
* @param publisher the {@link ApplicationEventPublisher} to publish the marker
* event to
* @param publisher the {@link ApplicationEventPublisher} to publish the marker event to
*/
public static void publishResetMarkerEvent(final ApplicationEventPublisher publisher) {
publisher.publishEvent(new ResetCounterMarkerEvent());
}
@Override
public void beforeTestMethod(final TestContext testContext) throws Exception {
public void beforeTestMethod(final TestContext testContext) {
final Optional<Expect[]> expectedEvents = getExpectationsFrom(testContext.getTestMethod());
expectedEvents.ifPresent(events -> beforeTest(testContext));
}
@Override
public void afterTestMethod(final TestContext testContext) throws Exception {
public void afterTestMethod(final TestContext testContext) {
final Optional<Expect[]> expectedEvents = getExpectationsFrom(testContext.getTestMethod());
try {
expectedEvents.ifPresent(events -> afterTest(events));