agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/managers/JobRequestInputProcessorIT.java
/**
     * Converts a json object into a {@link Map} that can be processed for job request inputs
     *
     * @param key           the key for which the job input should be stored
     * @param jobInputs a {@link ObjectNode} containing the value(s) of the job input under test
     * @return a map of the job inputs converted to a map
     */
Converts a json object into a  Map that can be processed for job request inputs
@param key           the key for which the job input should be stored
@param jobInputs a  ObjectNode containing the value(s) of the job input under test
@return a map of the job inputs converted to a map
Converts a json object into a Map that can be processed for job request inputs @param key the key for which the job input should be stored @param jobInputs a ObjectNode containing the value ( s ) of the job input under test @return a map of the job inputs converted to a map
private HashMap<String, Object> jsonObjectToMap(String key, ObjectNode jobInputs) {
        HashMap<String, Object> inputMap = new HashMap<>();
        if (jobInputs != null) {
            if (jobInputs.isNull() || jobInputs.get(key).isNull()) {
                inputMap.put(key, null);
            } else if (jobInputs.get(key).isArray()) {
                StringBuilder sb = new StringBuilder();
                jobInputs.get(key).forEach(item -> {
                    if (sb.length() > 0) {
                        sb.append(Settings.AGAVE_SERIALIZED_LIST_DELIMITER);
                    }
                    if (!item.isNull() && !item.isMissingNode()) {
                        sb.append(item.asText());
                    }
                });
                inputMap.put(key, sb.toString());
            } else if (jobInputs.get(key).isDouble()) {
                inputMap.put(key, jobInputs.get(key).decimalValue().toPlainString());
            } else if (jobInputs.get(key).isNumber()) {
                inputMap.put(key, jobInputs.get(key).longValue());
            } else if (jobInputs.get(key).isTextual()) {
                inputMap.put(key, jobInputs.get(key).textValue());
            } else if (jobInputs.get(key).isBoolean()) {
                inputMap.put(key, jobInputs.get(key).asBoolean() ? "true" : "false");
            }
        }
        return inputMap;
    }
private HashMap < String , Object > jsonObjectToMap ( String key , ObjectNode jobInputs ) { HashMap < String , Object > inputMap = new HashMap < > ( ) ; if ( jobInputs != null ) { if ( jobInputs . isNull ( ) || jobInputs . get ( key ) . isNull ( ) ) { inputMap . put ( key , null ) ; } else if ( jobInputs . get ( key ) . isArray ( ) ) { StringBuilder sb = new StringBuilder ( ) ; jobInputs . get ( key ) . forEach ( item -> { if ( sb . length ( ) > 0 ) { sb . append ( Settings . AGAVE_SERIALIZED_LIST_DELIMITER ) ; } if ( ! item . isNull ( ) && ! item . isMissingNode ( ) ) { sb . append ( item . asText ( ) ) ; } } ) ; inputMap . put ( key , sb . toString ( ) ) ; } else if ( jobInputs . get ( key ) . isDouble ( ) ) { inputMap . put ( key , jobInputs . get ( key ) . decimalValue ( ) . toPlainString ( ) ) ; } else if ( jobInputs . get ( key ) . isNumber ( ) ) { inputMap . put ( key , jobInputs . get ( key ) . longValue ( ) ) ; } else if ( jobInputs . get ( key ) . isTextual ( ) ) { inputMap . put ( key , jobInputs . get ( key ) . textValue ( ) ) ; } else if ( jobInputs . get ( key ) . isBoolean ( ) ) { inputMap . put ( key , jobInputs . get ( key ) . asBoolean ( ) ? "true" : "false" ) ; } } return inputMap ; }
Converts a json object into a {@link Map} that can be processed for job request inputs
 @param key           the key for which the job input should be stored
 @param jobInputs a {@link ObjectNode} containing the value(s) of the job input under test
 @return a map of the job inputs converted to a map
Converts a json object into a { @link Map } that can be processed for job request inputs @param key the key for which the job input should be stored @param jobInputs a { @link ObjectNode } containing the value ( s ) of the job input under test @return a map of the job inputs converted to a map
// if the inputs were null, we do nothing. we will pass an empty job input map