agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/managers/JobRequestInputProcessorIT.java
/**
     * Tests delimited job app input cardinality on jobs submitted as json
     *
     * @param jobInputs test validation of multiple inputs in a job request
     * @param shouldThrowException true if processing should throw an exception
     * @param message the message to assert for a failed test
     */
Tests delimited job app input cardinality on jobs submitted as json
@param jobInputs test validation of multiple inputs in a job request
@param shouldThrowException true if processing should throw an exception
@param message the message to assert for a failed test
Tests delimited job app input cardinality on jobs submitted as json @param jobInputs test validation of multiple inputs in a job request @param shouldThrowException true if processing should throw an exception @param message the message to assert for a failed test
@Test(dataProvider = "processMultipleDelimitedJobInputsProvider")
    public void processMultipleDelimitedJobInputs(int minCardinality, int maxCardinality, String jobInputs, boolean shouldThrowException, String message)
    {
        try {
            SoftwareInput softwareInput = createInput("testInput", null, null, false, true);
            softwareInput.setMaxCardinality(maxCardinality);
            softwareInput.setMinCardinality(minCardinality);
            ObjectNode processedInputs = _genericProcess(List.of(softwareInput), mapper.createObjectNode().put(softwareInput.getKey(), jobInputs));
            assertFalse(shouldThrowException, message);
            assertTrue(processedInputs.has(softwareInput.getKey()), message);
            assertEquals(processedInputs.get(softwareInput.getKey()).size(), jobInputs.split(";").length,
                    "Incorrect number of inputs returned after processing job inputs.");
            List<String> processedInputValues = new ArrayList<>();
            for (JsonNode jsonNode : processedInputs.get(softwareInput.getKey())) {
                processedInputValues.add(jsonNode.textValue());
            }
            for (String jobInputValue : jobInputs.split(";")) {
                assertTrue(processedInputValues.contains(jobInputValue),
                        "Processed inputs should contain all valid test values. Missing " + jobInputValue);
            }
        } catch (JobProcessingException e) {
            if (!shouldThrowException) {
                fail(message, e);
            }
        } catch (PermissionException e) {
            fail("Failed to setup software input test", e);
        }
    }
@ Test ( dataProvider = "processMultipleDelimitedJobInputsProvider" ) public void processMultipleDelimitedJobInputs ( int minCardinality , int maxCardinality , String jobInputs , boolean shouldThrowException , String message ) { try { SoftwareInput softwareInput = createInput ( "testInput" , null , null , false , true ) ; softwareInput . setMaxCardinality ( maxCardinality ) ; softwareInput . setMinCardinality ( minCardinality ) ; ObjectNode processedInputs = _genericProcess ( List . of ( softwareInput ) , mapper . createObjectNode ( ) . put ( softwareInput . getKey ( ) , jobInputs ) ) ; assertFalse ( shouldThrowException , message ) ; assertTrue ( processedInputs . has ( softwareInput . getKey ( ) ) , message ) ; assertEquals ( processedInputs . get ( softwareInput . getKey ( ) ) . size ( ) , jobInputs . split ( ";" ) . length , "Incorrect number of inputs returned after processing job inputs." ) ; List < String > processedInputValues = new ArrayList < > ( ) ; for ( JsonNode jsonNode : processedInputs . get ( softwareInput . getKey ( ) ) ) { processedInputValues . add ( jsonNode . textValue ( ) ) ; } for ( String jobInputValue : jobInputs . split ( ";" ) ) { assertTrue ( processedInputValues . contains ( jobInputValue ) , "Processed inputs should contain all valid test values. Missing " + jobInputValue ) ; } } catch ( JobProcessingException e ) { if ( ! shouldThrowException ) { fail ( message , e ) ; } } catch ( PermissionException e ) { fail ( "Failed to setup software input test" , e ) ; } }
Tests delimited job app input cardinality on jobs submitted as json
 @param jobInputs test validation of multiple inputs in a job request
 @param shouldThrowException true if processing should throw an exception
 @param message the message to assert for a failed test
Tests delimited job app input cardinality on jobs submitted as json @param jobInputs test validation of multiple inputs in a job request @param shouldThrowException true if processing should throw an exception @param message the message to assert for a failed test
// we now need to compare the resulting inputs from the test inputs