package nl.fifth.postulate.circuit;

import org.junit.Test;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

public class PipeAssemblyTest {
    @Test
    public void shouldCallPipes() {
        Pipe mockPipe = mock(Pipe.class);
        PipeAssembly pipeAssembly = Assembly.with(mockPipe).build();

        pipeAssembly.process();

        verify(mockPipe).process();
    }

    @Test
    public void shouldCallMultiplePipesInARow() {
        Pipe firstMockPipe = mock(Pipe.class);
        Pipe secondMockPipe = mock(Pipe.class);
        PipeAssembly pipeAssembly = Assembly
                .with(firstMockPipe)
                .andThen(secondMockPipe)
                .build();

        pipeAssembly.process();

        verify(firstMockPipe).process();
        verify(secondMockPipe).process();
    }
}

@@ -52,16 +52,44 @@
 it.Test;
+%0Aimport org.mockito.InOrder;
 %0A%0Aimport
@@ -163,16 +163,59 @@
 .verify;
+%0Aimport static org.mockito.Mockito.inOrder;
 %0A%0Apublic
@@ -769,32 +769,98 @@
        .build();
+%0A        InOrder inOrder = inOrder(firstMockPipe, secondMockPipe);
 %0A%0A        pipeAs
@@ -882,24 +882,32 @@
 );%0A%0A        
+inOrder.
 verify(first
@@ -931,24 +931,32 @@
 ();%0A        
+inOrder.
 verify(secon

Make sure pipes are called in order