santize service health and reasy url

This commit is contained in:
amrita
2024-12-31 15:06:16 +05:45
parent 3011eaa515
commit acc993ab36
6 changed files with 147 additions and 106 deletions
+24 -1
View File
@@ -213,7 +213,7 @@ class AuthContext implements Context {
* @throws Exception
*/
public function userRequestsEndpointsWithNoAuthentication(string $method, TableNode $table): void {
$this->featureContext->verifyTableNodeColumns($table, ['endpoint'], ['service']);
$this->featureContext->verifyTableNodeColumns($table, ['endpoint']);
foreach ($table->getHash() as $row) {
$this->featureContext->setResponse(
$this->sendRequest(
@@ -225,6 +225,29 @@ class AuthContext implements Context {
}
}
/**
* @When a user requests these URLs with :method and no authentication
*
* @param $method
* @param TableNode $table
*
* @return void
* @throws Exception
*/
public function aUserRequestsTheseUrlsWithAndNoAuthentication($method, TableNode $table): void {
$this->featureContext->verifyTableNodeColumns($table, ['endpoint'], ['service']);
foreach ($table->getHash() as $row) {
$this->featureContext->setResponse(
HttpRequestHelper::sendRequest(
$this->featureContext->substituteInLineCodes($row['endpoint']),
$this->featureContext->getStepLineRef(),
$method
)
);
$this->featureContext->pushToLastStatusCodesArrays();
}
}
/**
* @When the user :user requests these endpoints with :method with basic auth
*