use of org.mule.runtime.core.internal.interception.DefaultInterceptionEvent in project mule by mulesoft.
the class DefaultInterceptionEventTestCase method addSession.
@Test
public void addSession() throws MuleException {
final InternalEvent event = this.<InternalEvent.Builder>getEventBuilder().message(of(TEST_PAYLOAD)).build();
final DefaultInterceptionEvent interceptionEvent = new DefaultInterceptionEvent(event);
final MuleSession session = mock(MuleSession.class);
interceptionEvent.session(session);
assertThat(((PrivilegedEvent) interceptionEvent.resolve()).getSession(), sameInstance(session));
}
use of org.mule.runtime.core.internal.interception.DefaultInterceptionEvent in project mule by mulesoft.
the class DefaultInterceptionEventTestCase method changeSession.
@Test
public void changeSession() throws MuleException {
final InternalEvent event = this.<InternalEvent.Builder>getEventBuilder().message(of(TEST_PAYLOAD)).session(mock(MuleSession.class)).build();
final DefaultInterceptionEvent interceptionEvent = new DefaultInterceptionEvent(event);
final MuleSession session = mock(MuleSession.class);
interceptionEvent.session(session);
assertThat(((PrivilegedEvent) interceptionEvent.resolve()).getSession(), sameInstance(session));
}
Aggregations