Пример #1
0
        private Schedulable MockCall(string id)
        {
            Schedulable          mockCall = Org.Mockito.Mockito.Mock <Schedulable>();
            UserGroupInformation ugi      = Org.Mockito.Mockito.Mock <UserGroupInformation>();

            Org.Mockito.Mockito.When(ugi.GetUserName()).ThenReturn(id);
            Org.Mockito.Mockito.When(mockCall.GetUserGroupInformation()).ThenReturn(ugi);
            return(mockCall);
        }
Пример #2
0
        public virtual string MakeIdentity(Schedulable obj)
        {
            UserGroupInformation ugi = obj.GetUserGroupInformation();

            if (ugi == null)
            {
                return(null);
            }
            return(ugi.GetUserName());
        }