LoadSequencerWorkflow extends AbstractWorkflow { @Override public List<String> processInput(int stepNumber, ProgressStep step) { if (stepNumber == 0) { step.accept(containerStep); containerModelStep.cancelInput(); for (PartitionStep partitionStep : partitionSteps) { partitionStep.cancelInput(); } if (containerStep.isExistingContainer()) { resetPartitionSteps(containerStep.getContainer().getModel()); } } else if (stepNumber == 1) { if (containerStep.isExistingContainer()) { step.accept(partitionSteps.get(0)); } else { step.accept(containerModelStep); resetPartitionSteps(containerModelStep.getModel()); } } else { int partitionIndex = asPartitionIndex(stepNumber); step.accept(partitionSteps.get(partitionIndex)); } return Collections.emptyList(); }  @Override WorkflowStepPrompt getStep(int stepNumber); @Override boolean isComplete(); @Override List<String> processInput(int stepNumber, ProgressStep step); @Override void cancelInput(); @Override String getConfirmMessage(); @Override void execute(WorkflowExecutor workflowExecutor);  }
@Test public void testChangeToExistingContainer() { enterNewFlowCell(); assertState(true, null); sut.processInput(0, makeContainerStep(SERIAL_NUMBER, MODEL_ALIAS, 2, PlatformType.ILLUMINA)); assertState(false, 1, InputType.POOL, InputType.SKIP); }
@Test public void testChangeToNewContainer() { enterExistingFlowCell(); assertState(true, null); sut.processInput(0, makeStringProgressStep(SERIAL_NUMBER)); assertState(false, 1, InputType.SEQUENCING_CONTAINER_MODEL); }
@Test public void testChangeModel() { enterNewFlowCell(); assertState(true, null); sut.processInput(1, makeModelStep(MODEL_ALIAS, 2, PlatformType.ILLUMINA)); assertState(false, 2, InputType.POOL, InputType.SKIP); }
@Test public void testChangePools() throws IOException { final String pool1 = "alternate pool 1"; final String pool2 = "alternate pool 2"; enterNewFlowCell(); sut.processInput(2, makePoolStep(pool1, "IPO3")); assertState(true, null); sut.processInput(3, makePoolStep(pool2, "IPO4")); assertState(true, null); SequencerPartitionContainer container = executeWorkflow(); assertEquals(pool1, container.getPartitions().get(0).getPool().getAlias()); assertEquals(pool2, container.getPartitions().get(1).getPool().getAlias()); }