2022-01-09 14:16:30 +01:00
|
|
|
package dev.kske.eventbus.core;
|
|
|
|
|
2022-01-12 15:59:45 +01:00
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
|
2022-01-09 14:16:30 +01:00
|
|
|
/**
|
|
|
|
* An abstract class defining a package-private and a private handler for {@link SimpleEvent}.
|
|
|
|
*
|
|
|
|
* @author Kai S. K. Engelbart
|
|
|
|
* @since 1.3.0
|
|
|
|
*/
|
2022-01-12 15:59:45 +01:00
|
|
|
@Priority(200)
|
2022-01-09 14:16:30 +01:00
|
|
|
abstract class SimpleEventListenerBase {
|
|
|
|
|
|
|
|
@Event
|
|
|
|
void onSimpleEventAbstractHandler(SimpleEvent event) {
|
2022-01-12 15:59:45 +01:00
|
|
|
fail("This handler should not be invoked");
|
2022-01-09 14:16:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Event
|
2022-01-12 20:17:24 +01:00
|
|
|
@Priority(150)
|
2022-01-09 14:16:30 +01:00
|
|
|
private void onSimpleEventPrivate(SimpleEvent event) {
|
2022-01-12 15:59:45 +01:00
|
|
|
assertSame(1, event.getCounter());
|
2022-01-09 14:16:30 +01:00
|
|
|
event.increment();
|
|
|
|
}
|
|
|
|
}
|