Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zklgame committed Jul 31, 2023
1 parent f6381d9 commit 0fe9c65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
14 changes: 0 additions & 14 deletions src/test/java/io/iworkflow/integ/SignalTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public void testBasicSignalWorkflow() throws InterruptedException {
client.signalWorkflow(
BasicSignalWorkflow.class, wfId, runId, SIGNAL_CHANNEL_PREFIX_1 + "1", Integer.valueOf(4));

checkWorkflowResultBeforeComplete(client, wfId, runId);

Thread.sleep(1000);// wait for timer to be ready to skip
client.skipTimer(wfId, "", BasicSignalWorkflowState2.class, 1, TIMER_COMMAND_ID);

Expand Down Expand Up @@ -90,18 +88,6 @@ public void testMultipleSameSignalWorkflow() {
Assertions.assertEquals(5, output);
}

private void checkWorkflowResultBeforeComplete(final Client client, final String wfId, final String runId) {
Assertions.assertThrows(FeignException.FeignClientException.class, () -> client.getSimpleWorkflowResultWithWait(Integer.class, wfId));
Assertions.assertThrows(FeignException.FeignClientException.class, () -> client.getSimpleWorkflowResultWithWait(Integer.class, wfId, runId));
Assertions.assertThrows(FeignException.FeignClientException.class, () -> client.getComplexWorkflowResultWithWait(wfId));
Assertions.assertThrows(FeignException.FeignClientException.class, () -> client.getComplexWorkflowResultWithWait(wfId, runId));

Assertions.assertThrows(WorkflowUncompletedException.class, () -> client.tryGettingSimpleWorkflowResult(Integer.class, wfId));
Assertions.assertThrows(WorkflowUncompletedException.class, () -> client.tryGettingSimpleWorkflowResult(Integer.class, wfId, runId));
Assertions.assertThrows(WorkflowUncompletedException.class, () -> client.tryGettingComplexWorkflowResult(wfId));
Assertions.assertThrows(WorkflowUncompletedException.class, () -> client.tryGettingComplexWorkflowResult(wfId, runId));
}

private void checkWorkflowResultAfterComplete(final Client client, final String wfId, final String runId) {
Assertions.assertEquals(6, client.getSimpleWorkflowResultWithWait(Integer.class, wfId, runId));
Assertions.assertEquals(6, client.getSimpleWorkflowResultWithWait(Integer.class, wfId));
Expand Down
7 changes: 5 additions & 2 deletions src/test/java/io/iworkflow/integ/WorkflowUncompletedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ public void testWorkflowWaitTimeout() throws InterruptedException {
final String wfId = "testWorkflowTimeout" + System.currentTimeMillis() / 1000;
final Integer input = 1;

final String runId = client.startWorkflow(BasicSignalWorkflow.class, wfId, 100, input);

client.startWorkflow(BasicSignalWorkflow.class, wfId, 100, input);

Assertions.assertThrows(WorkflowUncompletedException.class, () -> client.tryGettingSimpleWorkflowResult(Integer.class, wfId));
Assertions.assertThrows(WorkflowUncompletedException.class, () -> client.tryGettingSimpleWorkflowResult(Integer.class, wfId, runId));
Assertions.assertThrows(WorkflowUncompletedException.class, () -> client.tryGettingComplexWorkflowResult(wfId));
Assertions.assertThrows(WorkflowUncompletedException.class, () -> client.tryGettingComplexWorkflowResult(wfId, runId));

long startMs = System.currentTimeMillis();
long elapsedMs;
Expand Down

0 comments on commit 0fe9c65

Please sign in to comment.