use of org.mule.runtime.api.exception.LocatedMuleException in project mule by mulesoft.
the class LocatedMuleExceptionTestCase method rawComponent.
@Test
public void rawComponent() {
Object raw = mock(Object.class, withSettings().extraInterfaces(Component.class));
when(raw.toString()).thenReturn("Mock@1");
LocatedMuleException lme = new LocatedMuleException(raw);
assertThat(lme.getInfo().get(INFO_LOCATION_KEY).toString(), is("Mock@1 @ app:internal:-1"));
}
use of org.mule.runtime.api.exception.LocatedMuleException in project mule by mulesoft.
the class LocatedMuleExceptionTestCase method namedComponent.
@Test
public void namedComponent() {
NamedObject named = mock(NamedObject.class, withSettings().extraInterfaces(Component.class));
when(named.getName()).thenReturn("mockComponent");
LocatedMuleException lme = new LocatedMuleException(named);
assertThat(lme.getInfo().get(INFO_LOCATION_KEY).toString(), is("/mockComponent @ app:internal:-1"));
}
use of org.mule.runtime.api.exception.LocatedMuleException in project mule by mulesoft.
the class LocatedMuleExceptionTestCase method namedAnnotatedComponent.
@Test
public void namedAnnotatedComponent() {
Component namedAnnotated = mock(Component.class, withSettings().extraInterfaces(NamedObject.class));
when(((NamedObject) namedAnnotated).getName()).thenReturn("mockComponent");
when(namedAnnotated.getAnnotation(eq(docNameAttrName))).thenReturn("Mock Component");
when(namedAnnotated.toString()).thenReturn("Mock@1");
configureProcessorLocation(namedAnnotated);
LocatedMuleException lme = new LocatedMuleException(namedAnnotated);
assertThat(lme.getInfo().get(INFO_LOCATION_KEY).toString(), is("/mockComponent @ app:muleApp.xml:10 (Mock Component)"));
}
use of org.mule.runtime.api.exception.LocatedMuleException in project mule by mulesoft.
the class LocatedMuleExceptionTestCase method annotatedComponent.
@Test
public void annotatedComponent() {
Component annotated = mock(Component.class);
when(annotated.getAnnotation(eq(docNameAttrName))).thenReturn("Mock Component");
when(annotated.toString()).thenReturn("Mock@1");
configureProcessorLocation(annotated);
LocatedMuleException lme = new LocatedMuleException(annotated);
assertThat(lme.getInfo().get(INFO_LOCATION_KEY).toString(), is("Mock@1 @ app:muleApp.xml:10 (Mock Component)"));
}
Aggregations