+
+ @Test
+ public void testDestinationGivesError() {
+ Destination destination = mock(Destination.class);
+ when(destination.getName()).thenReturn("name");
+ when(destination.chooseFromTargetTypes(anyCollectionOf(String.class)))
+ .thenReturn(Arrays.asList("any"));
+ doThrow(new RuntimeException("x")).when(destination).receive(
+ any(DOMSource.class));
+ router.registerDestination(destination);
+
+ registerDocumentType("any");
+
+ router.publish("source", source1);
+
+ verify(listener).delivered(any(EventInfo.class),
+ anyListOf(Transformation.class), anyLong(), anyString(), eq(false));
+
+ }