Repository navigation
[balanceplatform] Code generation: update services and models - #409
AdyenAutomationBot wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the get_sweep_executions method to the CustomPayoutSchedulesSweepsApi class, enabling users to retrieve executions of a custom payout schedule. It also updates the SDK generation metadata. The feedback highlights the need to add a corresponding unit test in spec/balance_platform_spec.rb to ensure the new endpoint is thoroughly tested and adheres to existing codebase conventions.
| def get_sweep_executions(balance_account_id, sweep_id, headers: {}, query_params: {}) | ||
| endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}/executions', balance_account_id, sweep_id) | ||
| endpoint += create_query_string(query_params) | ||
| action = { method: 'get', url: endpoint } | ||
| @client.call_adyen_api(@service, action, {}, headers, @version) | ||
| end |
There was a problem hiding this comment.
The new method get_sweep_executions is added to CustomPayoutSchedulesSweepsApi, but there is no corresponding unit test in spec/balance_platform_spec.rb. Please add a test case to verify that this endpoint is called correctly with the expected parameters, following the existing test patterns (e.g., asserting both be_a Adyen::HashWithAccessors and be_a_kind_of Hash for response hashes).
Example test case:
it 'makes a get_sweep_executions GET call' do
response_body = json_from_file('mocks/responses/BalancePlatform/get_sweep_executions.json')
url = @shared_values[:client].service_url(
@shared_values[:service],
'balanceAccounts/balanceAccountID/sweeps/sweepID/executions',
@shared_values[:client].balance_platform.version
)
WebMock.stub_request(:get, url)
.with(
query: { 'limit' => 5 },
headers: { 'x-api-key' => @shared_values[:client].api_key }
)
.to_return(body: response_body)
result = @shared_values[:client].balance_platform.custom_payout_schedules_sweeps_api
.get_sweep_executions('balanceAccountID', 'sweepID', query_params: { 'limit' => 5 })
response_hash = result.response
expect(result.status).to eq(200)
expect(response_hash).to eq(JSON.parse(response_body))
expect(response_hash).to be_a Adyen::HashWithAccessors
expect(response_hash).to be_a_kind_of Hash
endReferences
- Follow existing codebase conventions in tests, such as asserting both
be_a Adyen::HashWithAccessorsandbe_a_kind_of Hashfor response hashes, even if they seem redundant.
f32c50b to
c27bf2a
Compare
c27bf2a to
9132e6f
Compare
|
|
Do not merge, waiting for patchable fix |



This PR contains the automated changes for the
balanceplatformservice.Adyen/adyen-openapi@2c1f3ab
The commit history of this PR reflects the
adyen-openapicommits that have been applied.