Search in sources :

Example 1 with ValidTwoParams

use of io.spine.server.event.given.EventSubscriberMethodTestEnv.ValidTwoParams in project core-java by SpineEventEngine.

the class EventSubscriberMethodShould method invoke_subscriber_method.

@Test
public void invoke_subscriber_method() throws InvocationTargetException {
    final ValidTwoParams subscriberObject;
    subscriberObject = spy(new ValidTwoParams());
    final EventSubscriberMethod subscriber = EventSubscriberMethod.from(subscriberObject.getMethod());
    final RefProjectCreated msg = Given.EventMessage.projectCreated();
    subscriber.invoke(subscriberObject, msg, EventContext.getDefaultInstance());
    verify(subscriberObject, times(1)).handle(msg, EventContext.getDefaultInstance());
}
Also used : RefProjectCreated(io.spine.test.reflect.event.RefProjectCreated) ValidTwoParams(io.spine.server.event.given.EventSubscriberMethodTestEnv.ValidTwoParams) Test(org.junit.Test)

Example 2 with ValidTwoParams

use of io.spine.server.event.given.EventSubscriberMethodTestEnv.ValidTwoParams in project core-java by SpineEventEngine.

the class EventSubscriberMethodShould method consider_subscriber_with_msg_and_context_params_valid.

@Test
public void consider_subscriber_with_msg_and_context_params_valid() {
    final Method subscriber = new ValidTwoParams().getMethod();
    assertIsEventSubscriber(subscriber, true);
}
Also used : Method(java.lang.reflect.Method) ValidTwoParams(io.spine.server.event.given.EventSubscriberMethodTestEnv.ValidTwoParams) Test(org.junit.Test)

Aggregations

ValidTwoParams (io.spine.server.event.given.EventSubscriberMethodTestEnv.ValidTwoParams)2 Test (org.junit.Test)2 RefProjectCreated (io.spine.test.reflect.event.RefProjectCreated)1 Method (java.lang.reflect.Method)1