import org.wamblee.xmlrouter.config.DocumentType;
import org.wamblee.xmlrouter.config.RouterConfig;
import org.wamblee.xmlrouter.config.Transformation;
import org.wamblee.xmlrouter.config.DocumentType;
import org.wamblee.xmlrouter.config.RouterConfig;
import org.wamblee.xmlrouter.config.Transformation;
EventListener logListener = new LoggingEventListener(Level.INFO);
listener = spy(logListener);
routerService = new XMLRouter(new SystemClock(), config, listener);
EventListener logListener = new LoggingEventListener(Level.INFO);
listener = spy(logListener);
routerService = new XMLRouter(new SystemClock(), config, listener);
DocumentType type = mock(DocumentType.class);
when(type.isInstance(any(DOMSource.class))).thenReturn(true);
when(type.getName()).thenReturn(aType);
DocumentType type = mock(DocumentType.class);
when(type.isInstance(any(DOMSource.class))).thenReturn(true);
when(type.getName()).thenReturn(aType);
public void testOneTransformationOneDestination() {
RouterConfig routerConfig = registerDocumentType("any");
Transformation transformation = mock(Transformation.class);
public void testOneTransformationOneDestination() {
RouterConfig routerConfig = registerDocumentType("any");
Transformation transformation = mock(Transformation.class);
when(transformation.getFromType()).thenReturn("any");
when(transformation.getToType()).thenReturn("bla");
when(transformation.transform(same(source1))).thenReturn(source2);
when(transformation.getFromType()).thenReturn("any");
when(transformation.getToType()).thenReturn("bla");
when(transformation.transform(same(source1))).thenReturn(source2);
when(destination.receive(any(DOMSource.class))).thenReturn(true);
routerService.publish("bla", source1);
verify(listener).delivered(any(EventInfo.class),
when(destination.receive(any(DOMSource.class))).thenReturn(true);
routerService.publish("bla", source1);
verify(listener).delivered(any(EventInfo.class),
- anyListOf(Transformation.class), anyLong(), anyString(), eq(true));
+ anyListOf(Transformation.class), anyString(), eq(true));