use of com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputDefinition in project irida by phac-nml.
the class GalaxyWorkflowServiceTest method testGetWorkflowInputIdValid.
/**
* Tests getting a valid workflow input id from a workflow details.
* @throws WorkflowException
*/
@Test
public void testGetWorkflowInputIdValid() throws WorkflowException {
WorkflowDetails details = new WorkflowDetails();
WorkflowInputDefinition validDefinition = new WorkflowInputDefinition();
validDefinition.setLabel("valid");
Map<String, WorkflowInputDefinition> workflowInputMap = new HashMap<>();
workflowInputMap.put("validInputId", validDefinition);
details.setInputs(workflowInputMap);
assertEquals("validInputId", galaxyWorkflowService.getWorkflowInputId(details, "valid"));
}
use of com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputDefinition in project irida by phac-nml.
the class GalaxyWorkflowServiceTest method testGetWorkflowInputIdInvalid.
/**
* Tests failing to find a valid workflow input id from a workflow details.
* @throws WorkflowException
*/
@Test(expected = WorkflowException.class)
public void testGetWorkflowInputIdInvalid() throws WorkflowException {
WorkflowDetails details = new WorkflowDetails();
WorkflowInputDefinition validDefinition = new WorkflowInputDefinition();
validDefinition.setLabel("valid");
Map<String, WorkflowInputDefinition> workflowInputMap = new HashMap<>();
workflowInputMap.put("validInputId", validDefinition);
details.setInputs(workflowInputMap);
galaxyWorkflowService.getWorkflowInputId(details, "invalid");
}
use of com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputDefinition in project irida by phac-nml.
the class GalaxyWorkflowServiceTest method setup.
/**
* Sets up variables for workflow tests.
* @throws URISyntaxException
*/
@Before
public void setup() throws URISyntaxException {
MockitoAnnotations.initMocks(this);
galaxyWorkflowService = new GalaxyWorkflowService(workflowsClient, StandardCharsets.UTF_8);
String workflowInputId = "1";
WorkflowInputDefinition worklowInput = new WorkflowInputDefinition();
worklowInput.setLabel(VALID_INPUT_LABEL);
workflowInputs = new HashMap<String, WorkflowInputDefinition>();
workflowInputs.put(workflowInputId, worklowInput);
when(workflowsClient.showWorkflow(VALID_WORKFLOW_ID)).thenReturn(workflowDetails);
when(workflowDetails.getInputs()).thenReturn(workflowInputs);
}
Aggregations