From 1052b746c580dc5d06cd353a2986272fcdcdb90d Mon Sep 17 00:00:00 2001 From: louannecostes Date: Thu, 19 Dec 2024 15:58:59 +0100 Subject: [PATCH] first test pass --- .../GaelOWsiProcessingService.php | 3 ++- .../TestServices/GaelOWsiProcessingServiceTest.php | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/GaelO2/app/GaelO/Services/GaelOWsiProcessingService/GaelOWsiProcessingService.php b/GaelO2/app/GaelO/Services/GaelOWsiProcessingService/GaelOWsiProcessingService.php index bacea4ddd..1740942ad 100644 --- a/GaelO2/app/GaelO/Services/GaelOWsiProcessingService/GaelOWsiProcessingService.php +++ b/GaelO2/app/GaelO/Services/GaelOWsiProcessingService/GaelOWsiProcessingService.php @@ -33,6 +33,7 @@ public function setParams(): void public function getWelcomeGaeloWsiProcessing() { $request = $this->httpClientInterface->rawRequest("GET", "/", null, null); - return $request->getBody(); + return $request; } + } \ No newline at end of file diff --git a/GaelO2/tests/Unit/TestServices/GaelOWsiProcessingServiceTest.php b/GaelO2/tests/Unit/TestServices/GaelOWsiProcessingServiceTest.php index 3f3f2bc09..f89a3b2dd 100644 --- a/GaelO2/tests/Unit/TestServices/GaelOWsiProcessingServiceTest.php +++ b/GaelO2/tests/Unit/TestServices/GaelOWsiProcessingServiceTest.php @@ -6,6 +6,7 @@ use Tests\TestCase; use Illuminate\Support\Facades\App; + class GaelOWsiProcessingServiceTest extends TestCase { private GaelOWsiProcessingService $gaeloWsiProcessingService; @@ -14,12 +15,16 @@ protected function setUp():void{ parent::setUp(); $this->gaeloWsiProcessingService = App::make(GaelOWsiProcessingService::class); - // $this->markTestSkipped(); } public function testWelcome() { - $resultat=$this->gaeloWsiProcessingService->getWelcomeGaeloWsiProcessing(); - $resultat->assertStatus(200); + // Call the service method + $resultat = $this->gaeloWsiProcessingService->getWelcomeGaeloWsiProcessing(); + + // Assert the status code and the response body + $this->assertEquals(200, $resultat->getStatusCode()); + $this->assertEquals('Welcome to GaelO Pathology Processing Backend !', $resultat->getBody()); } } +