Search in sources :

Example 6 with SystemJobRunResponse

use of org.finra.herd.model.api.xml.SystemJobRunResponse 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);
}
Also used : SystemJobRunRequest(org.finra.herd.model.api.xml.SystemJobRunRequest) Parameter(org.finra.herd.model.api.xml.Parameter) SystemJobRunResponse(org.finra.herd.model.api.xml.SystemJobRunResponse) Test(org.junit.Test)

Example 7 with SystemJobRunResponse

use of org.finra.herd.model.api.xml.SystemJobRunResponse in project herd by FINRAOS.

the class SystemJobServiceTest method testRunSystemJobFileUploadCleanup.

// File upload cleanup system job
@Test
public void testRunSystemJobFileUploadCleanup() throws Exception {
    // Create the system job run request.
    SystemJobRunRequest systemJobRunRequest = new SystemJobRunRequest(FileUploadCleanupJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.FILE_UPLOAD_CLEANUP_JOB_THRESHOLD_MINUTES.getKey(), String.valueOf(INTEGER_VALUE))));
    // Request to run the system job.
    SystemJobRunResponse resultSystemJobRunResponse = systemJobService.runSystemJob(systemJobRunRequest);
    // Validate the returned object.
    assertEquals(new SystemJobRunResponse(FileUploadCleanupJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.FILE_UPLOAD_CLEANUP_JOB_THRESHOLD_MINUTES.getKey(), String.valueOf(INTEGER_VALUE)))), resultSystemJobRunResponse);
}
Also used : SystemJobRunRequest(org.finra.herd.model.api.xml.SystemJobRunRequest) Parameter(org.finra.herd.model.api.xml.Parameter) SystemJobRunResponse(org.finra.herd.model.api.xml.SystemJobRunResponse) Test(org.junit.Test)

Example 8 with SystemJobRunResponse

use of org.finra.herd.model.api.xml.SystemJobRunResponse in project herd by FINRAOS.

the class SystemJobServiceTest method testRunSystemJobFileUploadCleanupMissingOptionalParameters.

@Test
public void testRunSystemJobFileUploadCleanupMissingOptionalParameters() throws Exception {
    // Create the system job run request without parameters.
    SystemJobRunRequest systemJobRunRequest = new SystemJobRunRequest(FileUploadCleanupJob.JOB_NAME, null);
    // Request to run the system job.
    SystemJobRunResponse resultSystemJobRunResponse = systemJobService.runSystemJob(systemJobRunRequest);
    // Validate the returned object.
    assertEquals(new SystemJobRunResponse(FileUploadCleanupJob.JOB_NAME, null), resultSystemJobRunResponse);
}
Also used : SystemJobRunRequest(org.finra.herd.model.api.xml.SystemJobRunRequest) SystemJobRunResponse(org.finra.herd.model.api.xml.SystemJobRunResponse) Test(org.junit.Test)

Example 9 with SystemJobRunResponse

use of org.finra.herd.model.api.xml.SystemJobRunResponse in project herd by FINRAOS.

the class SystemJobServiceTest method testRunSystemJobStoragePolicySelectorUpperCaseParameters.

@Test
public void testRunSystemJobStoragePolicySelectorUpperCaseParameters() throws Exception {
    // Create a system job run request using upper 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().toUpperCase(), 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().toUpperCase(), String.valueOf(INTEGER_VALUE)))), resultSystemJobRunResponse);
}
Also used : SystemJobRunRequest(org.finra.herd.model.api.xml.SystemJobRunRequest) Parameter(org.finra.herd.model.api.xml.Parameter) SystemJobRunResponse(org.finra.herd.model.api.xml.SystemJobRunResponse) Test(org.junit.Test)

Example 10 with SystemJobRunResponse

use of org.finra.herd.model.api.xml.SystemJobRunResponse in project herd by FINRAOS.

the class SystemJobServiceTest method testRunSystemJobBusinessObjectDataFinalizeRestoreLowerCaseParameters.

@Test
public void testRunSystemJobBusinessObjectDataFinalizeRestoreLowerCaseParameters() throws Exception {
    // Create a system job run request using lower case input parameters (except for case-sensitive job name).
    SystemJobRunRequest systemJobRunRequest = new SystemJobRunRequest(BusinessObjectDataFinalizeRestoreJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.BDATA_FINALIZE_RESTORE_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(BusinessObjectDataFinalizeRestoreJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.BDATA_FINALIZE_RESTORE_JOB_MAX_BDATA_INSTANCES.getKey().toLowerCase(), String.valueOf(INTEGER_VALUE)))), resultSystemJobRunResponse);
}
Also used : SystemJobRunRequest(org.finra.herd.model.api.xml.SystemJobRunRequest) Parameter(org.finra.herd.model.api.xml.Parameter) SystemJobRunResponse(org.finra.herd.model.api.xml.SystemJobRunResponse) Test(org.junit.Test)

Aggregations

SystemJobRunResponse (org.finra.herd.model.api.xml.SystemJobRunResponse)20 SystemJobRunRequest (org.finra.herd.model.api.xml.SystemJobRunRequest)19 Test (org.junit.Test)19 Parameter (org.finra.herd.model.api.xml.Parameter)14