use of org.finra.herd.model.api.xml.JobDefinitionCreateRequest in project herd by FINRAOS.
the class ExecuteJdbcTestHelper method prepareHerdDatabaseForExecuteJdbcWithReceiveTaskTest.
/**
* Prepares Herd database for ExecuteJdbcWithReceiveTask test by creating and persisting a test job definition entity.
*
* @param jobDefinitionNamespace the namespace for the job definition
* @param jobDefinitionName the name of the job definition
* @param activitiXmlClasspathResourceName the Activiti XML classpath resource location
*
* @throws Exception
*/
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void prepareHerdDatabaseForExecuteJdbcWithReceiveTaskTest(String jobDefinitionNamespace, String jobDefinitionName, String activitiXmlClasspathResourceName) throws Exception {
// Create the test namespace entity.
namespaceDaoTestHelper.createNamespaceEntity(jobDefinitionNamespace);
// Create a job definition create request.
JobDefinitionCreateRequest jobDefinitionCreateRequest = new JobDefinitionCreateRequest();
jobDefinitionCreateRequest.setNamespace(jobDefinitionNamespace);
jobDefinitionCreateRequest.setJobName(jobDefinitionName);
jobDefinitionCreateRequest.setDescription("This is a test job definition.");
jobDefinitionCreateRequest.setActivitiJobXml(IOUtils.toString(resourceLoader.getResource(activitiXmlClasspathResourceName).getInputStream()));
jobDefinitionCreateRequest.setParameters(null);
// Create and persist a valid test job definition.
jobDefinitionService.createJobDefinition(jobDefinitionCreateRequest, false);
}
Aggregations