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);
}
Aggregations