-
Notifications
You must be signed in to change notification settings - Fork 159
Hackathon integration tests for checkout Test environment #2037
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| <integration_test_guidelines> | ||
| ## Scope | ||
|
|
||
| These instructions apply to files under `src/integration-test`. | ||
|
|
||
| ## Before Writing a Test | ||
|
|
||
| - Read `src/integration-test/README.md`. | ||
| - Verify the public service method and model types in `src/main/java`. | ||
| - Do not edit generated production models or services to make an integration test pass. | ||
| - Determine whether the test is automated external coverage or requires manual infrastructure. | ||
|
|
||
| ## Structure | ||
|
|
||
| - Mirror the production package under `src/integration-test/java`. | ||
| - Name integration-test classes `*IT` so Maven Failsafe discovers them. | ||
| - Extend `BaseIntegrationTest` and use its typed configuration accessors. | ||
| - Annotate external tests with `@Tag(IntegrationTestTags.EXTERNAL)`. | ||
| - Also annotate tests requiring a person, terminal, or other dedicated infrastructure with | ||
| `@Tag(IntegrationTestTags.MANUAL)`. | ||
| - Use behavior-focused names such as `shouldReturnValidationErrorWhenReferenceIsMissing`. | ||
| - Keep one observable behavior per test and use Arrange, Act, Assert sections. | ||
| - Prefer explicit imports, response types, and checked exceptions. Do not use wildcard imports, | ||
| `var`, or `throws Exception`. | ||
|
|
||
| ## Reliability and Safety | ||
|
|
||
| - Generate unique references and idempotency keys for requests that create remote state. | ||
| - Do not share mutable state or depend on test execution order. | ||
| - Clean up remotely created resources when the API supports cleanup. | ||
| - For eventually consistent APIs, use bounded polling rather than fixed sleeps. | ||
| - Add a suitable timeout when an operation can otherwise wait indefinitely. | ||
| - Tests containing Adyen test cards or other TEST-only data must call `requireTestEnvironment()` in | ||
| `@BeforeEach`. | ||
| - Do not use `@Disabled` as the normal opt-in mechanism. Use the Maven profiles and JUnit tags. | ||
| - Do not run an external integration test unless the user explicitly asks for that API call. | ||
|
|
||
| ## Assertions and Comments | ||
|
|
||
| - Assert stable contract fields, identifiers, statuses, and documented error codes. | ||
| - Assert exact error messages only when the wording is part of the documented contract. | ||
| - Include assertion messages that explain the violated contract. | ||
| - Extract repeated request construction and response assertions into focused helpers. | ||
| - Keep comments limited to prerequisites, non-obvious API constraints, and Arrange, Act, Assert | ||
| markers. Do not narrate straightforward Java. | ||
|
|
||
| ## Validation | ||
|
|
||
| Validate generated tests without contacting Adyen: | ||
|
|
||
| ```bash | ||
| mvn spotless:apply | ||
| mvn -Pintegration-tests -DskipTests test-compile | ||
| mvn spotless:check checkstyle:check -DskipTests | ||
| ``` | ||
|
|
||
| Use the opt-in execution commands from `src/integration-test/README.md` only when external execution | ||
| is explicitly requested. | ||
| </integration_test_guidelines> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The XML-like tags
<integration_test_guidelines>at the beginning of the file and</integration_test_guidelines>at the end of the file appear to be system prompt artifacts that were accidentally committed. They should be removed to keep the markdown clean and professional.