Skip to content

Commit

Permalink
Persist valid job config
Browse files Browse the repository at this point in the history
  • Loading branch information
azexcy committed Nov 22, 2023
1 parent 557dbca commit 6d52bef
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import org.apache.shardingsphere.data.pipeline.core.task.PipelineTaskUtils;
import org.apache.shardingsphere.data.pipeline.scenario.migration.config.MigrationTaskConfiguration;
import org.apache.shardingsphere.data.pipeline.scenario.migration.context.MigrationJobItemContext;
import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.mode.event.DataChangedEvent;
import org.apache.shardingsphere.mode.event.DataChangedEvent.Type;
import org.apache.shardingsphere.mode.manager.ContextManager;
Expand Down Expand Up @@ -85,10 +87,11 @@ private static void watch() {
@Test
void assertIsJobConfigurationExisted() {
assertFalse(governanceRepositoryAPI.isJobConfigurationExisted("foo_job"));
getClusterPersistRepository().persist("/pipeline/jobs/foo_job/config", "foo");
JobConfigurationPOJO value = new JobConfigurationPOJO();
value.setJobName("foo_job");
value.setShardingTotalCount(1);
getClusterPersistRepository().persist("/pipeline/jobs/foo_job/config", YamlEngine.marshal(value));
assertTrue(governanceRepositoryAPI.isJobConfigurationExisted("foo_job"));
getClusterPersistRepository().delete("/pipeline/jobs/foo_job/config");
assertFalse(governanceRepositoryAPI.isJobConfigurationExisted("foo_job"));
}

@Test
Expand Down

0 comments on commit 6d52bef

Please sign in to comment.