Search in sources :

Example 16 with SystemJobRunResponse

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

the class SystemJobRestControllerTest method testRunSystemJobStoragePolicySelector.

@Test
public void testRunSystemJobStoragePolicySelector() throws Exception {
    // Create the system job run request.
    SystemJobRunRequest systemJobRunRequest = new SystemJobRunRequest(StoragePolicySelectorJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.STORAGE_POLICY_SELECTOR_JOB_MAX_BDATA_INSTANCES.getKey(), String.valueOf(INTEGER_VALUE))));
    SystemJobRunResponse systemJobRunResponse = new SystemJobRunResponse(StoragePolicySelectorJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.STORAGE_POLICY_SELECTOR_JOB_MAX_BDATA_INSTANCES.getKey(), String.valueOf(INTEGER_VALUE))));
    when(systemJobService.runSystemJob(systemJobRunRequest)).thenReturn(systemJobRunResponse);
    // Request to run the system job.
    SystemJobRunResponse resultSystemJobRunResponse = systemJobRestController.runSystemJob(systemJobRunRequest);
    // Verify the external calls.
    verify(systemJobService).runSystemJob(systemJobRunRequest);
    verifyNoMoreInteractions(systemJobService);
    // Validate the returned object.
    assertEquals(systemJobRunResponse, 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 17 with SystemJobRunResponse

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

the class SystemJobServiceTest method testRunSystemJobStoragePolicySelector.

// Storage policy selector system job
@Test
public void testRunSystemJobStoragePolicySelector() throws Exception {
    // Create the system job run request.
    SystemJobRunRequest systemJobRunRequest = new SystemJobRunRequest(StoragePolicySelectorJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.STORAGE_POLICY_SELECTOR_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(StoragePolicySelectorJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.STORAGE_POLICY_SELECTOR_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 18 with SystemJobRunResponse

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

the class SystemJobServiceTest method testRunSystemJobFileUploadCleanupUpperCaseParameters.

@Test
public void testRunSystemJobFileUploadCleanupUpperCaseParameters() throws Exception {
    // Create a system job run request using upper case input parameters (except for case-sensitive job name).
    SystemJobRunRequest systemJobRunRequest = new SystemJobRunRequest(FileUploadCleanupJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.FILE_UPLOAD_CLEANUP_JOB_THRESHOLD_MINUTES.getKey().toUpperCase(), 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().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 19 with SystemJobRunResponse

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

the class SystemJobServiceTest method testRunSystemJobFileUploadCleanupTrimParameters.

@Test
public void testRunSystemJobFileUploadCleanupTrimParameters() 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(FileUploadCleanupJob.JOB_NAME), Arrays.asList(new Parameter(addWhitespace(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 20 with SystemJobRunResponse

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

the class SystemJobServiceTest method testRunSystemJobStoragePolicySelectorTrimParameters.

@Test
public void testRunSystemJobStoragePolicySelectorTrimParameters() 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(StoragePolicySelectorJob.JOB_NAME), Arrays.asList(new Parameter(addWhitespace(ConfigurationValue.STORAGE_POLICY_SELECTOR_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(StoragePolicySelectorJob.JOB_NAME, Arrays.asList(new Parameter(ConfigurationValue.STORAGE_POLICY_SELECTOR_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)

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