From f82fd7214f5fd79cd6ed2c3667d7f8a563a53f5b 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 c187dc0..841448a 100644 --- a/Classes/Controller/TableTestController.php +++ b/Classes/Controller/TableTestController.php @@ -59,7 +59,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')