You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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 insrc/testIntegration
and snapshots are maintained insrc/test/resources
(instead ofsrc/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?
The text was updated successfully, but these errors were encountered: