agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/managers/JobRequestParameterProcessorIT.java
/**
     * Tests optional hidden {@link SoftwareParameter} uses the default parameter value.
     */
Tests optional hidden  SoftwareParameter uses the default parameter value.
Tests optional hidden SoftwareParameter uses the default parameter value .
@Test(enabled = true, dataProvider = "defaultValueParameterProvider")
    public void processSetsDefaultValueForOptionalHiddenParameter(SoftwareParameterType type, Object defaultValue) {
        String message = String.format("The hidden %s software parameter's default value of %s should be set during parameter parsing",
                type.name(), defaultValue);
        try {
            SoftwareParameter param = createParameter("hiddenparam", type, defaultValue, null, false, false);
            ObjectNode jobParameters = _genericProcess(List.of(param), param.getKey(), null);
            if (type == SoftwareParameterType.bool || type == SoftwareParameterType.flag) {
                assertEquals(jobParameters.get(param.getKey()).asBoolean(), defaultValue, message);
            } else {
                assertEquals(jobParameters.get(param.getKey()).toString(), new JSONArray().put(String.valueOf(defaultValue)).toString(), message);
            }
        } catch (JobProcessingException e) {
            fail(message, e);
        } catch (IOException e) {
            fail("Error creating the software parameter to test", e);
        }
    }
@ Test ( enabled = true , dataProvider = "defaultValueParameterProvider" ) public void processSetsDefaultValueForOptionalHiddenParameter ( SoftwareParameterType type , Object defaultValue ) { String message = String . format ( "The hidden %s software parameter's default value of %s should be set during parameter parsing" , type . name ( ) , defaultValue ) ; try { SoftwareParameter param = createParameter ( "hiddenparam" , type , defaultValue , null , false , false ) ; ObjectNode jobParameters = _genericProcess ( List . of ( param ) , param . getKey ( ) , null ) ; if ( type == SoftwareParameterType . bool || type == SoftwareParameterType . flag ) { assertEquals ( jobParameters . get ( param . getKey ( ) ) . asBoolean ( ) , defaultValue , message ) ; } else { assertEquals ( jobParameters . get ( param . getKey ( ) ) . toString ( ) , new JSONArray ( ) . put ( String . valueOf ( defaultValue ) ) . toString ( ) , message ) ; } } catch ( JobProcessingException e ) { fail ( message , e ) ; } catch ( IOException e ) { fail ( "Error creating the software parameter to test" , e ) ; } }
Tests optional hidden {@link SoftwareParameter} uses the default parameter value.
Tests optional hidden { @link SoftwareParameter } uses the default parameter value .
// boolean and flag parameter types cannot have multiple values. it makes no sense, so we don't // get an array back for their default value, we just get boolean value