-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mock (unit) testing Java example #553
Comments
API that I'm working on:
There will also be I'm also leaning towards having The fact that we set a global singleton is an implementation detail, and it is also true for the |
An advanced, internal test would look similar to (this was a work in progres version but close to what I have in mind): https://github.com/pulumi/pulumi-java/pull/590/files#diff-2fd8390afc1feee0a2d9b1064a0378ac8a486ca7c33716e8c42a0a39d803e804R39
|
And include ideas how to clean up the mock testing API. |
See #591 (comment) with what's possible now and current pain-points. |
Thank you for providing usage for the current API. We are really close to what I want to propose as the final state. Current (as of writing):
Proposed changes:
|
Curious, CallArgs and ResourceArgs are empty classes - I'm not sure actually we even use them or need them. Unifying them with MockCallArgs may be possible but we need to expose the structure that MockCallArgs exposes for the test logic for example. This may have implications for prod logic but may be workable. |
Hello!
Issue details
This would illustrate how to do https://www.pulumi.com/docs/guides/testing/ for Java. See the Unit Testing section that mentions examples in other languages. We would first add an examples and then add Java reference to tag page. Note that APIs used for "unit" testing Pulumi programs need to become stable, so we might need to review these APIs before taking a further commitment.
@pawelprazak mentioned that mockito dependency is unfortunate, perhaps that can be avoided.
Affected area/feature
The text was updated successfully, but these errors were encountered: