Search in sources :

Example 1 with LocationPart

use of org.mule.runtime.api.component.location.LocationPart in project mule by mulesoft.

the class NotificationHelperTestCase method fireNotificationUsingLocation.

@Test
public void fireNotificationUsingLocation() {
    final LocationPart flowPart = mock(LocationPart.class);
    when(flowPart.getPartPath()).thenReturn("flowName");
    final ComponentLocation location = mock(ComponentLocation.class);
    when(location.getParts()).thenReturn(Collections.singletonList(flowPart));
    when(location.getComponentIdentifier()).thenReturn(TypedComponentIdentifier.builder().type(SOURCE).identifier(buildFromStringRepresentation("http:listener")).build());
    when(messageSource.getLocation()).thenReturn(location);
    final FlowConstruct flowConstruct = mock(FlowConstruct.class, withSettings().extraInterfaces(Component.class));
    when(flowConstruct.getMuleContext()).thenReturn(muleContext);
    final int action = 100;
    helper.fireNotification(messageSource, event, location, action);
    assertConnectorMessageNotification(eventNotificationHandler, messageSource, location, action);
}
Also used : ComponentLocation(org.mule.runtime.api.component.location.ComponentLocation) LocationPart(org.mule.runtime.api.component.location.LocationPart) FlowConstruct(org.mule.runtime.core.api.construct.FlowConstruct) Component(org.mule.runtime.api.component.Component) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Component (org.mule.runtime.api.component.Component)1 ComponentLocation (org.mule.runtime.api.component.location.ComponentLocation)1 LocationPart (org.mule.runtime.api.component.location.LocationPart)1 FlowConstruct (org.mule.runtime.core.api.construct.FlowConstruct)1 SmallTest (org.mule.tck.size.SmallTest)1