agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/managers/JobRequestParameterProcessorIT.java
/**
     * Generic method to run the JobManager.processJob(JsonNode, String, String) method.
     *
     * @param json                 the json object representing the job request
     * @param shouldThrowException true if processing should throw an exception
     * @param message              the assertion message to be returned if the test fails
     * @return the processed job parameters
     * @deprecated
     */
Generic method to run the JobManager.processJob(JsonNode, String, String) method.
Generic method to run the JobManager . processJob ( JsonNode String String ) method .
private ObjectNode _genericProcessMultiple(List<SoftwareParameter> softwareParameters, String key, ObjectNode json, boolean shouldThrowException, String message) {
        JobRequestParameterProcessor jobRequestParameterProcessor = mock(JobRequestParameterProcessor.class);
        try {
            Software software = mock(Software.class);
            when(software.getParameters()).thenReturn(softwareParameters);
            when(jobRequestParameterProcessor.getSoftware()).thenReturn(software);
            doCallRealMethod().when(jobRequestParameterProcessor).process(any());
            ObjectMapper mapper = new ObjectMapper();
            when(jobRequestParameterProcessor.getMapper()).thenReturn(mapper);
            jobRequestParameterProcessor.jobParameters = mapper.createObjectNode();
            doNothing().when(jobRequestParameterProcessor).setJobParameters(any());
            when(jobRequestParameterProcessor.getJobParameters()).thenCallRealMethod();
            HashMap<String, Object> parameterMap = jsonObjectToMap(key, json);
            jobRequestParameterProcessor.process(parameterMap);
        } catch (JobProcessingException e) {
            if (!shouldThrowException) {
                fail(message, e);
            }
        }
        return jobRequestParameterProcessor.getJobParameters();
    }
private ObjectNode _genericProcessMultiple ( List < SoftwareParameter > softwareParameters , String key , ObjectNode json , boolean shouldThrowException , String message ) { JobRequestParameterProcessor jobRequestParameterProcessor = mock ( JobRequestParameterProcessor . class ) ; try { Software software = mock ( Software . class ) ; when ( software . getParameters ( ) ) . thenReturn ( softwareParameters ) ; when ( jobRequestParameterProcessor . getSoftware ( ) ) . thenReturn ( software ) ; doCallRealMethod ( ) . when ( jobRequestParameterProcessor ) . process ( any ( ) ) ; ObjectMapper mapper = new ObjectMapper ( ) ; when ( jobRequestParameterProcessor . getMapper ( ) ) . thenReturn ( mapper ) ; jobRequestParameterProcessor . jobParameters = mapper . createObjectNode ( ) ; doNothing ( ) . when ( jobRequestParameterProcessor ) . setJobParameters ( any ( ) ) ; when ( jobRequestParameterProcessor . getJobParameters ( ) ) . thenCallRealMethod ( ) ; HashMap < String , Object > parameterMap = jsonObjectToMap ( key , json ) ; jobRequestParameterProcessor . process ( parameterMap ) ; } catch ( JobProcessingException e ) { if ( ! shouldThrowException ) { fail ( message , e ) ; } } return jobRequestParameterProcessor . getJobParameters ( ) ; }
Generic method to run the JobManager.processJob(JsonNode, String, String) method.
Generic method to run the JobManager . processJob ( JsonNode String String ) method .