@Test(expected = IOException.class)
  public void testCloneWithDeserializationError() throws Throwable {
    TestDeserializeOperatorSpec testOp = new TestDeserializeOperatorSpec(OperatorSpec.OpCode.MAP, "test-failed-op-4");
    this.allOpSpecs.add(testOp);
    inputOpSpecMap.values().stream().findFirst().get().registerNextOperatorSpec(testOp);

    OperatorSpecGraph operatorSpecGraph = new OperatorSpecGraph(mockAppDesc);
    //failed with serialization error
    try {
      operatorSpecGraph.clone();
      fail("Should have failed with serialization error");
    } catch (SamzaException se) {
      throw se.getCause();
    }
  }
Setup two linear transformation pipelines:
1) input1 --> filter --> sendTo
2) input2 --> map --> sink
samza-core/src/test/java/org/apache/samza/operators/TestOperatorSpecGraph.java