/** * Signals job with both S3 properties and request parameters set. If there are name clashes, the request parameter should take precedence. * * @throws Exception */ @Test public void testSignalJobWithS3PropertiesPrecedenceRequestParamsOverridesS3() throws Exception { jobDefinitionServiceTestHelper.createJobDefinition(ACTIVITI_XML_TEST_RECEIVE_TASK_WITH_CLASSPATH); Parameter s3Parameter = new Parameter("testName", "testValue"); Parameter requestParameter = new Parameter("testName", "expectedValue"); S3PropertiesLocation s3PropertiesLocation = getS3PropertiesLocation("s3BucketName", "s3ObjectKey", s3Parameter); // Start the job. Job job = jobService.createAndStartJob(jobServiceTestHelper.createJobCreateRequest(TEST_ACTIVITI_NAMESPACE_CD, TEST_ACTIVITI_JOB_NAME)); JobSignalRequest jobSignalRequest = new JobSignalRequest(job.getId(), "receivetask1", null, null); jobSignalRequest.setS3PropertiesLocation(s3PropertiesLocation); jobSignalRequest.setParameters(Arrays.asList(requestParameter)); Job signalJob = jobService.signalJob(jobSignalRequest); assertParameterEquals(requestParameter, signalJob.getParameters()); }
/** * Signals job with S3 properties set. Parameters should be populated from the properties. * * @throws Exception */ @Test public void testSignalJobWithS3Properties() throws Exception { jobDefinitionServiceTestHelper.createJobDefinition(ACTIVITI_XML_TEST_RECEIVE_TASK_WITH_CLASSPATH); Parameter parameter = new Parameter("testName", "testValue"); S3PropertiesLocation s3PropertiesLocation = getS3PropertiesLocation("s3BucketName", "s3ObjectKey", parameter); // Start the job. Job job = jobService.createAndStartJob(jobServiceTestHelper.createJobCreateRequest(TEST_ACTIVITI_NAMESPACE_CD, TEST_ACTIVITI_JOB_NAME)); JobSignalRequest jobSignalRequest = new JobSignalRequest(job.getId(), "receivetask1", null, null); jobSignalRequest.setS3PropertiesLocation(s3PropertiesLocation); Job signalJob = jobService.signalJob(jobSignalRequest); assertParameterEquals(parameter, signalJob.getParameters()); }
sourceS3PropertiesLocation = this.getS3PropertiesLocation(); S3PropertiesLocation copyS3PropertiesLocation = ((S3PropertiesLocation) strategy.copy(LocatorUtils.property(locator, "s3PropertiesLocation", sourceS3PropertiesLocation), sourceS3PropertiesLocation, (this.s3PropertiesLocation!= null))); copy.setS3PropertiesLocation(copyS3PropertiesLocation); } else { if (s3PropertiesLocationShouldBeCopiedAndSet == Boolean.FALSE) {
sourceS3PropertiesLocation = this.getS3PropertiesLocation(); S3PropertiesLocation copyS3PropertiesLocation = ((S3PropertiesLocation) strategy.copy(LocatorUtils.property(locator, "s3PropertiesLocation", sourceS3PropertiesLocation), sourceS3PropertiesLocation, (this.s3PropertiesLocation!= null))); copy.setS3PropertiesLocation(copyS3PropertiesLocation); } else { if (s3PropertiesLocationShouldBeCopiedAndSet == Boolean.FALSE) {
sourceS3PropertiesLocation = this.getS3PropertiesLocation(); S3PropertiesLocation copyS3PropertiesLocation = ((S3PropertiesLocation) strategy.copy(LocatorUtils.property(locator, "s3PropertiesLocation", sourceS3PropertiesLocation), sourceS3PropertiesLocation, (this.s3PropertiesLocation!= null))); copy.setS3PropertiesLocation(copyS3PropertiesLocation); } else { if (s3PropertiesLocationShouldBeCopiedAndSet == Boolean.FALSE) {