agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/managers/JobRequestInputProcessorIT.java
/**
     * Creates a mock of the {@link JobRequestInputProcessor} class, passing through all the doProcessSoftwareInputValue and
     * doProcessSingleValue methods. The mock will ensure {@link JobRequestInputProcessor#canUserReadUri(String, String, URI)}
     * always returns true since the {@link PermissionManager#canUserReadUri(String, String, URI)} method is already
     * independently tested.
     *
     * @param softwareInputs the {@link SoftwareInput} instances to return when {@link Software#getInputs()} is called.
     * @return a testable mock of the {@link JobRequestInputProcessor} class.
     * @throws JobProcessingException if the init of the {@link JobRequestInputProcessor} failed.
     * @throws PermissionException if the mock of the {@link JobRequestInputProcessor#canUserReadUri(String, String, URI)} fails.
     */
Creates a mock of the  JobRequestInputProcessor class, passing through all the doProcessSoftwareInputValue and
doProcessSingleValue methods. The mock will ensure  JobRequestInputProcessor#canUserReadUri(String, String, URI)
always returns true since the  PermissionManager#canUserReadUri(String, String, URI) method is already
independently tested.

@param softwareInputs the  SoftwareInput instances to return when  Software#getInputs() is called.
@return a testable mock of the  JobRequestInputProcessor class.
@throws JobProcessingException if the init of the  JobRequestInputProcessor failed.
@throws PermissionException if the mock of the  JobRequestInputProcessor#canUserReadUri(String, String, URI) fails.
Creates a mock of the JobRequestInputProcessor class passing through all the doProcessSoftwareInputValue and doProcessSingleValue methods . The mock will ensure JobRequestInputProcessor#canUserReadUri ( String String URI ) always returns true since the PermissionManager#canUserReadUri ( String String URI ) method is already independently tested . @param softwareInputs the SoftwareInput instances to return when Software#getInputs () is called . @return a testable mock of the JobRequestInputProcessor class . @throws JobProcessingException if the init of the JobRequestInputProcessor failed . @throws PermissionException if the mock of the JobRequestInputProcessor#canUserReadUri ( String String URI ) fails .
private JobRequestInputProcessor createMockJobRequestInputProcessor(List<SoftwareInput> softwareInputs) throws JobProcessingException, PermissionException {
        Software software = mock(Software.class);
        when(software.getInputs()).thenReturn(softwareInputs);
        JobRequestInputProcessor jobRequestInputProcessor = mock(JobRequestInputProcessor.class);
        when(jobRequestInputProcessor.getMapper()).thenReturn(mapper);
        when(jobRequestInputProcessor.getSoftware()).thenReturn(software);
        when(jobRequestInputProcessor.doProcessSoftwareInputValue(any(SoftwareInput.class), any(Object.class))).thenCallRealMethod();
        when(jobRequestInputProcessor.doProcessSoftwareInputValue(any(SoftwareInput.class), anyString())).thenCallRealMethod();
        when(jobRequestInputProcessor.doProcessSoftwareInputValue(any(SoftwareInput.class), any(String[].class))).thenCallRealMethod();
        when(jobRequestInputProcessor.doProcessSoftwareInputValue(any(SoftwareInput.class), any(ArrayNode.class))).thenCallRealMethod();
        when(jobRequestInputProcessor.doProcessSingleValue(any(SoftwareInput.class), anyString())).thenCallRealMethod();
        doCallRealMethod().when(jobRequestInputProcessor).process(any());
        when(jobRequestInputProcessor.canUserReadUri(any(), any(), any())).thenReturn(true);
        jobRequestInputProcessor.jobInputs = mapper.createObjectNode();
        doNothing().when(jobRequestInputProcessor).setJobInputs(any());
        when(jobRequestInputProcessor.getJobInputs()).thenCallRealMethod();
        return jobRequestInputProcessor;
    }
private JobRequestInputProcessor createMockJobRequestInputProcessor ( List < SoftwareInput > softwareInputs ) throws JobProcessingException , PermissionException { Software software = mock ( Software . class ) ; when ( software . getInputs ( ) ) . thenReturn ( softwareInputs ) ; JobRequestInputProcessor jobRequestInputProcessor = mock ( JobRequestInputProcessor . class ) ; when ( jobRequestInputProcessor . getMapper ( ) ) . thenReturn ( mapper ) ; when ( jobRequestInputProcessor . getSoftware ( ) ) . thenReturn ( software ) ; when ( jobRequestInputProcessor . doProcessSoftwareInputValue ( any ( SoftwareInput . class ) , any ( Object . class ) ) ) . thenCallRealMethod ( ) ; when ( jobRequestInputProcessor . doProcessSoftwareInputValue ( any ( SoftwareInput . class ) , anyString ( ) ) ) . thenCallRealMethod ( ) ; when ( jobRequestInputProcessor . doProcessSoftwareInputValue ( any ( SoftwareInput . class ) , any ( String [ ] . class ) ) ) . thenCallRealMethod ( ) ; when ( jobRequestInputProcessor . doProcessSoftwareInputValue ( any ( SoftwareInput . class ) , any ( ArrayNode . class ) ) ) . thenCallRealMethod ( ) ; when ( jobRequestInputProcessor . doProcessSingleValue ( any ( SoftwareInput . class ) , anyString ( ) ) ) . thenCallRealMethod ( ) ; doCallRealMethod ( ) . when ( jobRequestInputProcessor ) . process ( any ( ) ) ; when ( jobRequestInputProcessor . canUserReadUri ( any ( ) , any ( ) , any ( ) ) ) . thenReturn ( true ) ; jobRequestInputProcessor . jobInputs = mapper . createObjectNode ( ) ; doNothing ( ) . when ( jobRequestInputProcessor ) . setJobInputs ( any ( ) ) ; when ( jobRequestInputProcessor . getJobInputs ( ) ) . thenCallRealMethod ( ) ; return jobRequestInputProcessor ; }
Creates a mock of the {@link JobRequestInputProcessor} class, passing through all the doProcessSoftwareInputValue and
 doProcessSingleValue methods.
Creates a mock of the { @link JobRequestInputProcessor } class passing through all the doProcessSoftwareInputValue and doProcessSingleValue methods .
// ignore permissino check as there are already tests for the PermissionManager#canUserReadUri(String, String, URI) method