diff --git a/src/Service/App.php b/src/Service/App.php index ad34de8..29dedfe 100644 --- a/src/Service/App.php +++ b/src/Service/App.php @@ -9,7 +9,7 @@ class App extends AbstractService public const V2_APP_LIST_URL = "/v2/app/"; public const V2_APP_DETAIL_URL = "/v2/app/%s/"; public const V2_APP_CANCEL_URL = "/v2/app/%s/cancel/"; - public const V2_APP_BRANCHER_URL = "/v2/app/%s/brancher/"; + public const V2_BRANCHER_APP_URL = "/v2/brancher/app/%s/"; public const V1_APP_FLOWS_URL = "/logbook/v1/logbooks/%s/flows/"; /** diff --git a/src/Service/BrancherApp.php b/src/Service/BrancherApp.php index 94a238e..5e85108 100644 --- a/src/Service/BrancherApp.php +++ b/src/Service/BrancherApp.php @@ -20,7 +20,7 @@ class BrancherApp extends AbstractService */ public function create(string $app, ?array $data = null): string { - $url = sprintf(App::V2_APP_BRANCHER_URL, $app); + $url = sprintf(App::V2_BRANCHER_APP_URL, $app); $response = $this->client->api->post($url, [], $data ? json_encode($data) : null); diff --git a/tests/unit/Service/BrancherAppTest.php b/tests/unit/Service/BrancherAppTest.php index 36d9461..b2020c6 100644 --- a/tests/unit/Service/BrancherAppTest.php +++ b/tests/unit/Service/BrancherAppTest.php @@ -25,7 +25,7 @@ public function testCreateBrancherApp() $request = $this->responses->getLastRequest(); $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals('/v2/app/johndoe/brancher/', $request->getUri()); + $this->assertEquals('/v2/brancher/app/johndoe/', $request->getUri()); $this->assertEquals('johndoe-eph123456', $brancherAppName); } @@ -46,7 +46,7 @@ public function testCreateBrancherAppWithData() $request = $this->responses->getLastRequest(); $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals('/v2/app/johndoe/brancher/', $request->getUri()); + $this->assertEquals('/v2/brancher/app/johndoe/', $request->getUri()); $this->assertEquals('johndoe-eph123456', $brancherAppName); $this->assertJson((string)$request->getBody()); $this->assertEquals(