Repository: mesos Updated Branches: refs/heads/master 9ea22dc74 -> 85083af3f
Cleaned up creation of HTTP auth headers in tests. Review: https://reviews.apache.org/r/41223/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/78afe996 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/78afe996 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/78afe996 Branch: refs/heads/master Commit: 78afe996dd1c2b1954406e5745cd5c801e75b15a Parents: 9ea22dc Author: Neil Conway <[email protected]> Authored: Sat Dec 12 11:10:34 2015 -0800 Committer: Joris Van Remoortere <[email protected]> Committed: Sat Dec 12 11:11:35 2015 -0800 ---------------------------------------------------------------------- src/tests/master_quota_tests.cpp | 10 ---------- src/tests/mesos.hpp | 11 +++++++++++ src/tests/persistent_volume_endpoints_tests.cpp | 10 ---------- src/tests/reservation_endpoints_tests.cpp | 10 ---------- 4 files changed, 11 insertions(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/78afe996/src/tests/master_quota_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/master_quota_tests.cpp b/src/tests/master_quota_tests.cpp index 12820fc..0473869 100644 --- a/src/tests/master_quota_tests.cpp +++ b/src/tests/master_quota_tests.cpp @@ -98,16 +98,6 @@ protected: return flags; } - process::http::Headers createBasicAuthHeaders( - const Credential& credential) const - { - return process::http::Headers{{ - "Authorization", - "Basic " + - base64::encode(credential.principal() + ":" + credential.secret()) - }}; - } - // Creates a FrameworkInfo with the specified role. FrameworkInfo createFrameworkInfo(const string& role) { http://git-wip-us.apache.org/repos/asf/mesos/blob/78afe996/src/tests/mesos.hpp ---------------------------------------------------------------------- diff --git a/src/tests/mesos.hpp b/src/tests/mesos.hpp index 2429ac5..efa4dd0 100644 --- a/src/tests/mesos.hpp +++ b/src/tests/mesos.hpp @@ -533,6 +533,17 @@ inline Resource createPersistentVolume( } +inline process::http::Headers createBasicAuthHeaders( + const Credential& credential) +{ + return process::http::Headers{{ + "Authorization", + "Basic " + + base64::encode(credential.principal() + ":" + credential.secret()) + }}; +} + + // Helpers for creating reserve operations. inline Offer::Operation RESERVE(const Resources& resources) { http://git-wip-us.apache.org/repos/asf/mesos/blob/78afe996/src/tests/persistent_volume_endpoints_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/persistent_volume_endpoints_tests.cpp b/src/tests/persistent_volume_endpoints_tests.cpp index 0a03b5f..c0feede 100644 --- a/src/tests/persistent_volume_endpoints_tests.cpp +++ b/src/tests/persistent_volume_endpoints_tests.cpp @@ -86,16 +86,6 @@ public: return info; } - process::http::Headers createBasicAuthHeaders( - const Credential& credential) const - { - return process::http::Headers{{ - "Authorization", - "Basic " + - base64::encode(credential.principal() + ":" + credential.secret()) - }}; - } - string createRequestBody( const SlaveID& slaveId, const string& resourceKey, http://git-wip-us.apache.org/repos/asf/mesos/blob/78afe996/src/tests/reservation_endpoints_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/reservation_endpoints_tests.cpp b/src/tests/reservation_endpoints_tests.cpp index d5d2aa7..b8edd6f 100644 --- a/src/tests/reservation_endpoints_tests.cpp +++ b/src/tests/reservation_endpoints_tests.cpp @@ -84,16 +84,6 @@ public: return info; } - process::http::Headers createBasicAuthHeaders( - const Credential& credential) const - { - return process::http::Headers{{ - "Authorization", - "Basic " + - base64::encode(credential.principal() + ":" + credential.secret()) - }}; - } - string createRequestBody( const SlaveID& slaveId, const RepeatedPtrField<Resource>& resources) const {
