Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ def get_sweep(balance_account_id, sweep_id, headers: {})
@client.call_adyen_api(@service, action, {}, headers, @version)
end

# View executions of a custom payout schedule
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
Comment on lines +48 to +53

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
end
References
  1. Follow existing codebase conventions in tests, such as asserting both be_a Adyen::HashWithAccessors and be_a_kind_of Hash for response hashes, even if they seem redundant.


# Update a sweep
def update_sweep(request, balance_account_id, sweep_id, headers: {})
endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}', balance_account_id, sweep_id)
Expand Down
8 changes: 4 additions & 4 deletions sdk-generation-log/balanceplatform.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"service": "balanceplatform",
"project": "ruby",
"generatedAt": "2026-07-31T12:01:02Z",
"openapiCommitSha": "425d65d12163ebd4fe6fa6d2f859075817c81cba",
"automationCommitSha": "0c108bd8050cf480d2710b78b770afdfbdd89397",
"libraryCommitSha": "7f77a7b7aca2c2b22147ba4b996ada979f9decd9"
"generatedAt": "2026-10-22T14:18:30Z",
"openapiCommitSha": "2c1f3ab1e0385815899db9364a95e5aa5cf5568a",
"automationCommitSha": "b78db5c1f857f1d7d8d45116ce61f6266043fa60",
"libraryCommitSha": "773b42b07b93eceb706d79d666496a2c864f62fe"
}
Loading