Flow { public byte[] prepareReplay() { setReplayTime(currentTime()); incrementReplayCount(); clearErrorStatus(); for (FlowPart part: getParts()){ if (part.getStatus().equals(FlowStatus.ERROR)){ part.setFlowPartMessageText(null); } } return getPacket(); } Flow();  Flow(String application); Long getIdentifier(); void setIdentifier(Long identifier); String getApplication(); void setApplication(String application); byte[] getPacket(); void setPacket(byte[] packet); Date getCreationTime(); void setCreationTime(Date start); Date getReplayTime(); void setReplayTime(Date replayTime); int getReplayCount(); void setReplayCount(int replayCount); void incrementReplayCount(); int getAckCountExpected(); void setAckCountExpected(int ackCountExpected); FlowStatus getDerivedStatus(); void setDerivedStatus(FlowStatus derivedStatus); Set<FlowPart> getParts(); FlowPart getPart(String path, FlowStatus status); FlowPart getPart(String path); String getFlowMessageText(); void setFlowMessageText(String message); boolean isAckCountExpectationSet(); boolean isAckCountExpectedReached(); int getStatusCount(FlowStatus status); FlowStatus getStatus(); void clearErrorStatus(); Date getLatestUpdate(); long getPartDuration(FlowPart part); void acknowledge(String path, boolean cleanup); void acknowledge(String path, boolean cleanup, String partMessageText); void invalidate(String path); void invalidate(String path, String partTextMessage); boolean filter(String path); boolean isReplayable(); byte[] prepareReplay(); @Override boolean equals(Object obj); @Override int hashCode(); FlowInfo getInfo(); FlowInfo getInfo(boolean includeText); static List<FlowInfo> getInfos(List<Flow> flows);  }
@Test public void testPrepareReplay() throws Exception { Flow flow = createFlow("blah"); flow.getPart("0.0").setStatus(ERROR); assertEquals(1, flow.getStatusCount(CLEAN)); assertEquals(1, flow.getStatusCount(ERROR)); flow.prepareReplay(); assertEquals(1, flow.getStatusCount(CLEAN)); assertEquals(0, flow.getStatusCount(ERROR)); }