MCPcopy Create free account
hub / github.com/Snapchat/Valdi / performRequest

Method performRequest

valdi/test/utils/RequestManagerMock.cpp:109–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 auto weakThis = weak_from_this();
108 _queue->async([=]() {
109 auto strongThis = weakThis.lock();
110 if (strongThis != nullptr) {
111 strongThis->_mockedSuffixResponses.emplace_back(request, response);
112 }
113 });
114}
115
116void RequestManagerMock::addMockedResponse(const snap::valdi_core::HTTPRequest& request,
117 const snap::valdi_core::HTTPResponse& response) {
118 addMockedResponse(request, Result<snap::valdi_core::HTTPResponse>(response));
119}
120
121void RequestManagerMock::addMockedResponse(const snap::valdi_core::HTTPRequest& request,
122 const Result<snap::valdi_core::HTTPResponse>& response) {
123 auto weakThis = weak_from_this();
124 _queue->async([=]() {
125 auto strongThis = weakThis.lock();
126 if (strongThis != nullptr) {
127 strongThis->_mockedResponses.emplace_back(request, response);
128 }
129 });

Callers

nothing calls this directly

Calls 4

getResponseMethod · 0.65
asyncMethod · 0.45
lockMethod · 0.45
completeMethod · 0.45

Tested by

no test coverage detected