Skip to content

Commit 4993cd7

Browse files
Unit test for appgroup prepaid balance (#451)
1 parent fb6604a commit 4993cd7

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
/*
4+
* Copyright 2025 Google LLC
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
namespace Apigee\Edge\Tests\Api\ApigeeX\Controller;
20+
21+
use Apigee\Edge\Api\ApigeeX\Controller\AppGroupPrepaidBalanceController;
22+
use Apigee\Edge\ClientInterface;
23+
use Apigee\Edge\Tests\Test\Controller\EntityControllerTester;
24+
use Apigee\Edge\Tests\Test\Controller\EntityControllerTesterInterface;
25+
26+
/**
27+
* Class AppGroupPrepaidBalanceControllerTest.
28+
*
29+
* @group controller
30+
* @group monetization
31+
*/
32+
class AppGroupPrepaidBalanceControllerTest extends PrepaidBalanceControllerTestBase
33+
{
34+
protected static $appGroupName = 'phpunit';
35+
36+
/**
37+
* {@inheritdoc}
38+
*/
39+
protected static function entityController(?ClientInterface $client = null): EntityControllerTesterInterface
40+
{
41+
$client = $client ?? static::defaultAPIClient();
42+
43+
return new EntityControllerTester(new AppGroupPrepaidBalanceController(self::$appGroupName, static::defaultTestOrganization($client), $client));
44+
}
45+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"wallets": [
3+
{
4+
"balance": {
5+
"currencyCode": "USD",
6+
"units": "30",
7+
"nanos": 200000000
8+
},
9+
"lastCreditTime": "1633595340380"
10+
}
11+
]
12+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"wallets": [
3+
{
4+
"balance": {
5+
"currencyCode": "AUD",
6+
"units": "15",
7+
"nanos": 200000000
8+
},
9+
"lastCreditTime": "1643317863972",
10+
"id" : "AUD"
11+
},
12+
{
13+
"balance": {
14+
"currencyCode": "USD",
15+
"units": "12",
16+
"nanos": 345000000
17+
},
18+
"lastCreditTime": "1643038805286",
19+
"id" : "USD"
20+
}
21+
]
22+
}

0 commit comments

Comments
 (0)