MCPcopy Create free account
hub / github.com/apache/mesos / TEST_P

Function TEST_P

src/tests/scheduler_http_api_tests.cpp:192–212  ·  view source on GitHub ↗

This test sends a malformed body that cannot be deserialized into a valid protobuf resulting in a BadRequest.

Source from the content-addressed store, hash-verified

190// This test sends a malformed body that cannot be deserialized
191// into a valid protobuf resulting in a BadRequest.
192TEST_P(SchedulerHttpApiTest, MalformedContent)
193{
194 Try<Owned<cluster::Master>> master = StartMaster();
195 ASSERT_SOME(master);
196
197 const string body = "MALFORMED_CONTENT";
198
199 const string contentType = GetParam();
200
201 process::http::Headers headers = createBasicAuthHeaders(DEFAULT_CREDENTIAL);
202 headers["Accept"] = contentType;
203
204 Future<Response> response = process::http::post(
205 master.get()->pid,
206 "api/v1/scheduler",
207 headers,
208 body,
209 contentType);
210
211 AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
212}
213
214
215// This test sets an unsupported media type as Content-Type. This

Callers

nothing calls this directly

Calls 15

createBasicAuthHeadersFunction · 0.85
BadRequestClass · 0.85
OKClass · 0.85
randomFunction · 0.85
WeeksClass · 0.85
errorFunction · 0.85
FutureSatisfyFunction · 0.85
NotAcceptableClass · 0.85
CopyFromMethod · 0.80
atMethod · 0.80
typeMethod · 0.80

Tested by

no test coverage detected