mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-21 11:45:42 +00:00
test: exclude provider test if there is a server exception
This commit is contained in:
parent
1ed2275ac1
commit
6d6119a490
@ -15,6 +15,7 @@ use App\Tests\Service\RDAPServiceTest;
|
|||||||
use App\Tests\State\WatchListUpdateProcessorTest;
|
use App\Tests\State\WatchListUpdateProcessorTest;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use PHPUnit\Framework\Attributes\DependsExternal;
|
use PHPUnit\Framework\Attributes\DependsExternal;
|
||||||
|
use Symfony\Component\HttpClient\Exception\ServerException;
|
||||||
use Symfony\Component\Uid\UuidV4;
|
use Symfony\Component\Uid\UuidV4;
|
||||||
|
|
||||||
class AbstractProviderTest extends ApiTestCase
|
class AbstractProviderTest extends ApiTestCase
|
||||||
@ -75,6 +76,7 @@ class AbstractProviderTest extends ApiTestCase
|
|||||||
|
|
||||||
private function testGenericProvider(ConnectorProvider $connectorProvider, array $authData): void
|
private function testGenericProvider(ConnectorProvider $connectorProvider, array $authData): void
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
// Create a Connector
|
// Create a Connector
|
||||||
$client = ConnectorControllerTest::createClientWithCredentials(ConnectorControllerTest::getToken(UserFactory::createOne()));
|
$client = ConnectorControllerTest::createClientWithCredentials(ConnectorControllerTest::getToken(UserFactory::createOne()));
|
||||||
$response = $client->request('POST', '/api/connectors', ['json' => [
|
$response = $client->request('POST', '/api/connectors', ['json' => [
|
||||||
@ -111,5 +113,8 @@ class AbstractProviderTest extends ApiTestCase
|
|||||||
$orderDomainHandler($message);
|
$orderDomainHandler($message);
|
||||||
|
|
||||||
$this->assertResponseStatusCodeSame(200);
|
$this->assertResponseStatusCodeSame(200);
|
||||||
|
} catch (ServerException $e) {
|
||||||
|
$this->markTestSkipped('Provider '.$connectorProvider->value.' is not ready. Response HTTP '.$e->getResponse()->getStatusCode());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user