use of io.spine.server.rejection.given.MultipleRejectionSubscriber in project core-java by SpineEventEngine.
the class RejectionBusShould method call_subscriber_by_rejection_and_command_message_when_rejection_posted.
@Test
public void call_subscriber_by_rejection_and_command_message_when_rejection_posted() {
final MultipleRejectionSubscriber subscriber = new MultipleRejectionSubscriber();
rejectionBus.register(subscriber);
final Class<RjStartProject> commandMessageCls = RjStartProject.class;
final Rejection rejection = cannotModifyDeletedEntity(commandMessageCls);
rejectionBus.post(rejection);
assertEquals(1, subscriber.numberOfSubscriberCalls());
assertEquals(commandMessageCls, subscriber.commandMessageClass());
}
use of io.spine.server.rejection.given.MultipleRejectionSubscriber in project core-java by SpineEventEngine.
the class RejectionBusShould method call_subscriber_by_rejection_message_only.
@Test
public void call_subscriber_by_rejection_message_only() {
final MultipleRejectionSubscriber subscriber = new MultipleRejectionSubscriber();
rejectionBus.register(subscriber);
final Rejection rejection = cannotModifyDeletedEntity(StringValue.class);
rejectionBus.post(rejection);
assertEquals(1, subscriber.numberOfSubscriberCalls());
assertNull(subscriber.commandMessageClass());
}
Aggregations