We are currently building our integration test. One of our test demand that we expect out test expect to receive (a callback response) from one of our services.
Stuff look like this
describe 'Integration Test' do
before(:each) do
@replies = { '/callback' => [200, {}, ["Callback Received"]] }
end
context 'Callback' do
it 'should receive a callback response' do
StubServer.open('4567', @replies) do |server|
server.wait until server.recorded_reqs.any?
req_body = JSON.parse(server.recorded_reqs.first["REQUEST_BODY"]).symbolize_keys
expect(req_body[:data]).not_to be_nil
end
end
end
end
Service 1 trigger a callback to → Integration Test (Stub Server Running) → Integration Stub server intercept the request and run the matched expectation.
When Locally, we run StubServer (stub server running at http://localhost:4567) and we validate the acceptance test for the callback response callback response or a request originated from Service 1
If, I have to simulate the above behavior in Circle CI. I would need an endpoint along with port to run my stub server which should accessible from outside i.e from Service 1
Any Clue on this?