From 3adce086fff4a2f0a4048fc78fc0a85603250233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20M=C3=BCller?= <2566282+brotkrueml@users.noreply.github.com> Date: Tue, 3 Sep 2024 11:12:03 +0200 Subject: [PATCH] fix: use GET instead of HEAD to speed up connection test Interestingly, a HEAD to a JobData table (like done in the connection test) last approx > 15 sec whereas a GET ~ 1 sec. Therefore, we use GET again. --- Classes/Controller/TableTestController.php | 2 +- Tests/Unit/Controller/TableTestControllerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Controller/TableTestController.php b/Classes/Controller/TableTestController.php index 5d023b2..7321a8e 100644 --- a/Classes/Controller/TableTestController.php +++ b/Classes/Controller/TableTestController.php @@ -57,7 +57,7 @@ public function __invoke(ServerRequestInterface $request): ResponseInterface } $this->restClientFactory->create($connection)->request( - 'HEAD', + 'GET', \sprintf('application/jobdata/tables/%s/datasets', $table->tableGuid), ); return $this->buildResponse(); diff --git a/Tests/Unit/Controller/TableTestControllerTest.php b/Tests/Unit/Controller/TableTestControllerTest.php index 57f8099..13a7e66 100644 --- a/Tests/Unit/Controller/TableTestControllerTest.php +++ b/Tests/Unit/Controller/TableTestControllerTest.php @@ -172,7 +172,7 @@ public function invokeReturnsResponseWithErrorWhenExceptionIsThrown(): void $this->clientStub ->method('request') - ->with('HEAD', 'application/jobdata/tables/sometableguid/datasets') + ->with('GET', 'application/jobdata/tables/sometableguid/datasets') ->willThrowException(new \Exception('some exception message')); $this->restClientFactoryMock ->method('create')