From 235a768ac34f1885ae6a81835583c726b3000654 Mon Sep 17 00:00:00 2001 From: Shijie Sheng Date: Thu, 7 Nov 2024 15:14:51 -0800 Subject: [PATCH] address comments --- .../workflow/WorkflowMigrationTest.java | 28 ++++--------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/src/test/java/com/uber/cadence/workflow/WorkflowMigrationTest.java b/src/test/java/com/uber/cadence/workflow/WorkflowMigrationTest.java index 09131cd8..15c92ffb 100644 --- a/src/test/java/com/uber/cadence/workflow/WorkflowMigrationTest.java +++ b/src/test/java/com/uber/cadence/workflow/WorkflowMigrationTest.java @@ -34,7 +34,6 @@ import com.uber.cadence.serviceclient.IWorkflowService; import com.uber.cadence.serviceclient.WorkflowServiceTChannel; import com.uber.cadence.testUtils.CadenceTestRule; -import com.uber.cadence.testing.TestWorkflowEnvironment; import com.uber.cadence.worker.Worker; import com.uber.cadence.worker.WorkerFactory; import com.uber.cadence.worker.WorkerFactoryOptions; @@ -53,27 +52,14 @@ public class WorkflowMigrationTest { WorkerFactory factoryCurr, factoryNew; Worker workerCurr, workerNew; - @Rule - public CadenceTestRule testRuleCur = - CadenceTestRule.builder() - .withDomain(DOMAIN) - .withWorkflowTypes(CrossDomainWorkflowTest.TestWorkflowCrossDomainImpl.class) - .startWorkersAutomatically() - .withTestEnvironmentProvider(TestWorkflowEnvironment::newInstance) - .build(); - - @Rule - public CadenceTestRule testRuleNew = - CadenceTestRule.builder() - .withDomain(DOMAIN2) - .withWorkflowTypes(WorkflowTest.TestWorkflowSignaledSimple.class) - .startWorkersAutomatically() - .withTestEnvironmentProvider(TestWorkflowEnvironment::newInstance) - .build(); + @Rule public CadenceTestRule testRuleCur = CadenceTestRule.builder().withDomain(DOMAIN).build(); + + @Rule public CadenceTestRule testRuleNew = CadenceTestRule.builder().withDomain(DOMAIN2).build(); @Before public void setUp() { - IWorkflowService serviceNew, serviceCur; + IWorkflowService serviceCur = testRuleCur.getWorkflowClient().getService(); + IWorkflowService serviceNew = testRuleNew.getWorkflowClient().getService(); if (useDockerService) { serviceCur = new WorkflowServiceTChannel( @@ -82,9 +68,6 @@ public void setUp() { new FeatureFlags().setWorkflowExecutionAlreadyCompletedErrorEnabled(true)) .build()); serviceNew = serviceCur; // docker only starts one server so share the same service - } else { - serviceCur = testRuleCur.getWorkflowClient().getService(); - serviceNew = testRuleNew.getWorkflowClient().getService(); } workflowClientCurr = WorkflowClient.newInstance( @@ -179,7 +162,6 @@ public void execute(int iter) { @Test public void whenUseDockerService_cronWorkflowMigration() { - // Assume.assumeTrue(useDockerService); String workflowID = UUID.randomUUID().toString(); try { workflowClientCurr