use of org.finra.herd.model.api.xml.Parameter in project herd by FINRAOS.
the class SystemJobServiceTest method testRunSystemJobStoragePolicySelectorLowerCaseParameters.
@Test
public void testRunSystemJobStoragePolicySelectorLowerCaseParameters() throws Exception {
// Create a system job run request using lower case input parameters (except for case-sensitive job name).
SystemJobRunRequest systemJobRunRequest = new SystemJobRunRequest(StoragePolicySelectorJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.STORAGE_POLICY_SELECTOR_JOB_MAX_BDATA_INSTANCES.getKey().toLowerCase(), String.valueOf(INTEGER_VALUE))));
// Request to run the system job.
SystemJobRunResponse resultSystemJobRunResponse = systemJobService.runSystemJob(systemJobRunRequest);
// Validate the returned object.
assertEquals(new SystemJobRunResponse(StoragePolicySelectorJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.STORAGE_POLICY_SELECTOR_JOB_MAX_BDATA_INSTANCES.getKey().toLowerCase(), String.valueOf(INTEGER_VALUE)))), resultSystemJobRunResponse);
}
use of org.finra.herd.model.api.xml.Parameter in project herd by FINRAOS.
the class SystemJobServiceTest method testRunSystemJobBusinessObjectDataFinalizeRestoreTrimParameters.
@Test
public void testRunSystemJobBusinessObjectDataFinalizeRestoreTrimParameters() throws Exception {
// Create a system job run request using input parameters with leading
// and trailing empty spaces (except for parameter values that do not get trimmed).
SystemJobRunRequest systemJobRunRequest = new SystemJobRunRequest(addWhitespace(BusinessObjectDataFinalizeRestoreJob.JOB_NAME), Arrays.asList(new Parameter(addWhitespace(ConfigurationValue.BDATA_FINALIZE_RESTORE_JOB_MAX_BDATA_INSTANCES.getKey()), String.valueOf(INTEGER_VALUE))));
// Request to run the system job.
SystemJobRunResponse resultSystemJobRunResponse = systemJobService.runSystemJob(systemJobRunRequest);
// Validate the returned object.
assertEquals(new SystemJobRunResponse(BusinessObjectDataFinalizeRestoreJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.BDATA_FINALIZE_RESTORE_JOB_MAX_BDATA_INSTANCES.getKey(), String.valueOf(INTEGER_VALUE)))), resultSystemJobRunResponse);
}
use of org.finra.herd.model.api.xml.Parameter in project herd by FINRAOS.
the class AddBusinessObjectDataStorageUnitTest method testAddBusinessObjectDataStorageUnitUsingJsonRequest.
@Test
public void testAddBusinessObjectDataStorageUnitUsingJsonRequest() throws Exception {
BusinessObjectDataStorageUnitCreateRequest businessObjectDataStorageUnitCreateRequest = businessObjectDataServiceTestHelper.getBusinessObjectDataStorageUnitCreateRequest();
List<FieldExtension> fieldExtensionList = new ArrayList<>();
fieldExtensionList.add(buildFieldExtension("contentType", "${contentType}"));
fieldExtensionList.add(buildFieldExtension("businessObjectDataStorageUnitCreateRequest", "${businessObjectDataStorageUnitCreateRequest}"));
List<Parameter> parameters = new ArrayList<>();
parameters.add(buildParameter("contentType", "json"));
parameters.add(buildParameter("businessObjectDataStorageUnitCreateRequest", jsonHelper.objectToJson(businessObjectDataStorageUnitCreateRequest)));
Map<String, Object> variableValuesToValidate = new HashMap<>();
variableValuesToValidate.put(BaseJavaDelegate.VARIABLE_JSON_RESPONSE, VARIABLE_VALUE_NOT_NULL);
testActivitiServiceTaskSuccess(AddBusinessObjectDataStorageUnit.class.getCanonicalName(), fieldExtensionList, parameters, variableValuesToValidate);
}
use of org.finra.herd.model.api.xml.Parameter in project herd by FINRAOS.
the class AddEmrStepsTest method testAddShellStepNoStepName.
@Test
public void testAddShellStepNoStepName() throws Exception {
List<Parameter> parameters = new ArrayList<>();
Parameter parameter = new Parameter("clusterName", "testCluster1");
parameters.add(parameter);
parameter = new Parameter("continueOnError", "");
parameters.add(parameter);
parameter = new Parameter("stepName", "");
parameters.add(parameter);
executeWithoutLogging(ActivitiRuntimeHelper.class, () -> {
testActivitiAddEmrStepFailure(AddEmrShellStep.class.getCanonicalName(), new ArrayList<>(), parameters);
});
}
use of org.finra.herd.model.api.xml.Parameter in project herd by FINRAOS.
the class AddEmrStepsTest method testAddShellStepWrongContinueOnError.
@Test
public void testAddShellStepWrongContinueOnError() throws Exception {
List<Parameter> parameters = new ArrayList<>();
Parameter parameter = new Parameter("clusterName", "testCluster1");
parameters.add(parameter);
parameter = new Parameter("stepName", "Shell Step");
parameters.add(parameter);
parameter = new Parameter("continueOnError", "sfsdfsd");
parameters.add(parameter);
parameter = new Parameter("scriptLocation", "A_SCRIPT_LOCATION");
parameters.add(parameter);
executeWithoutLogging(ActivitiRuntimeHelper.class, () -> {
testActivitiAddEmrStepFailure(AddEmrShellStep.class.getCanonicalName(), getScriptStepsFieldExtension(), parameters);
});
}
Aggregations