-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test-utils): publish test utils (#1078)
Co-authored-by: Eduwer Camacaro <[email protected]> Co-authored-by: Mijail Rondon <[email protected]>
- Loading branch information
1 parent
0944892
commit cf06f7d
Showing
43 changed files
with
1,125 additions
and
551 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,98 @@ | ||
package e2e; | ||
|
||
import io.littlehorse.sdk.common.config.LHConfig; | ||
import io.littlehorse.sdk.common.proto.LHStatus; | ||
import io.littlehorse.sdk.wfsdk.WfRunVariable; | ||
import io.littlehorse.sdk.wfsdk.Workflow; | ||
import io.littlehorse.sdk.wfsdk.internal.WorkflowImpl; | ||
import io.littlehorse.sdk.worker.LHTaskMethod; | ||
import io.littlehorse.test.LHTest; | ||
import io.littlehorse.test.LHWorkflow; | ||
import io.littlehorse.test.WithWorkers; | ||
import io.littlehorse.test.WorkflowVerifier; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@LHTest | ||
@WithWorkers(value = "basicWorker") | ||
@WithWorkers(value = "basicWorker2", lhMethods = "five") | ||
public class BasicTest { | ||
|
||
@LHWorkflow("test-basic") | ||
private Workflow basicWf; | ||
|
||
private LHConfig config; | ||
|
||
private WorkflowVerifier verifier; | ||
|
||
@Test | ||
@WithWorkers(value = "basicWorker3") | ||
public void shouldDoBasic() { | ||
verifier.prepareRun(basicWf).waitForStatus(LHStatus.COMPLETED).start(); | ||
} | ||
|
||
@LHWorkflow("test-basic") | ||
public Workflow getBasic() { | ||
return new WorkflowImpl("test-basic", thread -> { | ||
WfRunVariable asdf = thread.declareBool("asdf"); | ||
asdf.assign(thread.execute("ag-one")); | ||
thread.execute("one"); | ||
thread.execute("two"); | ||
thread.execute("three"); | ||
thread.execute("five"); | ||
thread.execute("seven"); | ||
}); | ||
} | ||
|
||
@LHTaskMethod("ag-one") | ||
public boolean one() { | ||
return true; | ||
public Object basicWorker() { | ||
return new BasicWorker(); | ||
} | ||
|
||
public Object basicWorker2() { | ||
return new BasicWorker2(); | ||
} | ||
|
||
public Object basicWorker3() { | ||
return new BasicWorker3(); | ||
} | ||
|
||
public class BasicWorker { | ||
|
||
@LHTaskMethod("one") | ||
public boolean one() { | ||
return true; | ||
} | ||
|
||
@LHTaskMethod("two") | ||
public boolean two() { | ||
return true; | ||
} | ||
|
||
@LHTaskMethod("three") | ||
public boolean three() { | ||
return true; | ||
} | ||
} | ||
|
||
public class BasicWorker2 { | ||
|
||
@LHTaskMethod("four") | ||
public boolean one() { | ||
return true; | ||
} | ||
|
||
@LHTaskMethod("five") | ||
public boolean two() { | ||
return true; | ||
} | ||
|
||
@LHTaskMethod("six") | ||
public boolean three() { | ||
return true; | ||
} | ||
} | ||
|
||
public class BasicWorker3 { | ||
|
||
@LHTaskMethod("seven") | ||
public boolean one() { | ||
return true; | ||
} | ||
} | ||
} |
Oops, something went wrong.