You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gr...@apache.org on 2018/02/16 02:12:56 UTC

mesos git commit: Removed a redundant authorization helper class from the tests.

Repository: mesos
Updated Branches:
  refs/heads/master 1c937b323 -> 9a42cf84f


Removed a redundant authorization helper class from the tests.

Review: https://reviews.apache.org/r/65315/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9a42cf84
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9a42cf84
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9a42cf84

Branch: refs/heads/master
Commit: 9a42cf84f86181712958e35079168b0cf75eb96a
Parents: 1c937b3
Author: Greg Mann <gr...@mesosphere.io>
Authored: Thu Feb 15 17:48:52 2018 -0800
Committer: Greg Mann <gr...@gmail.com>
Committed: Thu Feb 15 17:48:52 2018 -0800

----------------------------------------------------------------------
 src/tests/mesos.cpp | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/9a42cf84/src/tests/mesos.cpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
index f8c3904..d829631 100644
--- a/src/tests/mesos.cpp
+++ b/src/tests/mesos.cpp
@@ -31,6 +31,8 @@
 #include <stout/stringify.hpp>
 #include <stout/uuid.hpp>
 
+#include "common/http.hpp"
+
 #ifdef __linux__
 #include "linux/cgroups.hpp"
 #endif
@@ -663,17 +665,6 @@ MockExecutor::~MockExecutor() {}
 
 MockAuthorizer::MockAuthorizer()
 {
-  // Implementation of the ObjectApprover interface authorizing all objects.
-  class ObjectApproverAll : public ObjectApprover
-  {
-  public:
-    virtual Try<bool> approved(
-        const Option<ObjectApprover::Object>& object) const noexcept override
-    {
-      return true;
-    }
-  };
-
   // NOTE: We use 'EXPECT_CALL' and 'WillRepeatedly' here instead of
   // 'ON_CALL' and 'WillByDefault'. See 'TestContainerizer::SetUp()'
   // for more details.
@@ -681,7 +672,8 @@ MockAuthorizer::MockAuthorizer()
     .WillRepeatedly(Return(true));
 
   EXPECT_CALL(*this, getObjectApprover(_, _))
-    .WillRepeatedly(Return(Owned<ObjectApprover>(new ObjectApproverAll())));
+    .WillRepeatedly(Return(Owned<ObjectApprover>(
+        new AcceptingObjectApprover())));
 }