/** * Removes participant (provider, consumer) from pact-broker * * @param $participantName * * @return ResponseInterface * @throws PactBrokerException */ public function removeParticipant($participantName) { $request = $this->requestBuilder->createRemoveParticipantRequest($this->baseUrl, $participantName); $response = $this->client->sendRequest($request); $this->checkIfResponseIsCorrect($response); return $response; }
function it_should_throw_exception_while_removing_participant_if_error_occurred(RequestInterface $request, ResponseInterface $response, StreamInterface $stream) { $participantName = 'Service 1'; $this->requestBuilder->createRemoveParticipantRequest($this->baseUrl, $participantName)->willReturn($request); $this->client->sendRequest($request)->willReturn($response); $response->getStatusCode()->willReturn(500); $response->getBody()->willReturn($stream); $stream->getContents()->willReturn('Error'); $this->shouldThrow(PactBrokerException::class)->during('removeParticipant', [$participantName]); }