Skip to content
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

Better Solution for Response Body Files #106

Open
akefirad opened this issue Aug 22, 2024 · 1 comment
Open

Better Solution for Response Body Files #106

akefirad opened this issue Aug 22, 2024 · 1 comment

Comments

@akefirad
Copy link

Currently expected response body files are being maintained in src/test/resources and the path is hard-coded. There's a way to override the path using a system property, but nevertheless I'd say the current implementation can be slightly improved.
In our case, tests are integration tests (in src/testIntegration, managed by Java Test Suite Gradle plugin). As you can see, in our setup, tests are in src/testIntegration and snapshots are maintained in src/test/resources (instead of src/testIntegration/resources), which is not ideal.

One solution could be using getResources method which can get you the path of the file. But there's catch; the file has to exist (unless there's a trick to get the path even when the file does't exist).

The other solution could be to find the root directly (i.e. src/testIntegration) using the test class itself, but I'm not sure what are the implications.

Any thoughts?

@akefirad
Copy link
Author

Also one thing I noticed; After running all tests, if find a lot of empty folders (for all tests) in src/test/resources folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant