-
Notifications
You must be signed in to change notification settings - Fork 244
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
refactor: e2e pull transfer tests #4733
base: main
Are you sure you want to change the base?
refactor: e2e pull transfer tests #4733
Conversation
...2e-transfer-test/runner/src/test/java/org/eclipse/edc/test/e2e/TransferPullEndToEndTest.java
Outdated
Show resolved
Hide resolved
...2e-transfer-test/runner/src/test/java/org/eclipse/edc/test/e2e/TransferPullEndToEndTest.java
Outdated
Show resolved
Hide resolved
...2e-transfer-test/runner/src/test/java/org/eclipse/edc/test/e2e/TransferPullEndToEndTest.java
Outdated
Show resolved
Hide resolved
...2e-transfer-test/runner/src/test/java/org/eclipse/edc/test/e2e/TransferPullEndToEndTest.java
Outdated
Show resolved
Hide resolved
...2e-transfer-test/runner/src/test/java/org/eclipse/edc/test/e2e/TransferPullEndToEndTest.java
Outdated
Show resolved
Hide resolved
3079e66
to
3d85043
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the code more complex and difficult to reason about than the original due to the added layers of indirection. For example:
createResourcesOnProvider(assetId, PolicyFixtures.contractExpiresIn("10s"), httpSourceDataAddress());
var startedTransferContext = startTransferProcess(assetId);
var edrMessageContext = assertDataIsAccessible(startedTransferContext.consumerTransferProcessId);
assertDataIsNotAccessible(startedTransferContext.consumerTransferProcessId, edrMessageContext);
Compare the above to the original where the checks are well-documented and intuitive.
In tests, it's OK to repeat code if it makes what is being verified easier to follow. There are obviously cases where test fixtures should be used, but generalized methods need to explicitly communicate what verification they are performing.
My suggestion is to try an alternative approach or keep the existing test case structure.
@@ -340,6 +265,55 @@ private HttpResponse cacheEdr(HttpRequest request, Map<String, TransferProcessSt | |||
} | |||
} | |||
|
|||
private StartedTransferContext startTransferProcess(String assetId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unnecessary indirection
What this PR changes/adds
Refactor End-to-End (e2e) PULL Transfer Tests.
Why it does that
Please see issue description.
Linked Issue(s)
Closes #4727
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.