### Question:
ResourceMgrDelegate extends YarnClientImpl { public QueueInfo[] getRootQueues() throws IOException, InterruptedException { return TypeConverter.fromYarnQueueInfo(super.getRootQueueInfos(), this.conf); } ResourceMgrDelegate(YarnConfiguration conf); void cancelDelegationToken(Token<DelegationTokenIdentifier> arg0); TaskTrackerInfo[] getActiveTrackers(); JobStatus[] getAllJobs(); TaskTrackerInfo[] getBlacklistedTrackers(); ClusterMetrics getClusterMetrics(); @SuppressWarnings("rawtypes") Token getDelegationToken(Text renewer); String getFilesystemName(); JobID getNewJobID(); QueueInfo getQueue(String queueName); QueueAclsInfo[] getQueueAclsForCurrentUser(); QueueInfo[] getQueues(); QueueInfo[] getRootQueues(); QueueInfo[] getChildQueues(String parent); String getStagingAreaDir(); String getSystemDir(); long getTaskTrackerExpiryInterval(); void setJobPriority(JobID arg0, String arg1); long getProtocolVersion(String arg0, long arg1); long renewDelegationToken(Token<DelegationTokenIdentifier> arg0); ApplicationId getApplicationId();  }### Answer:
@Test public void testGetRootQueues() throws IOException, InterruptedException { final ClientRMProtocol applicationsManager = Mockito.mock(ClientRMProtocol.class); GetQueueInfoResponse response = Mockito.mock(GetQueueInfoResponse.class); org.apache.hadoop.yarn.api.records.QueueInfo queueInfo = Mockito.mock(org.apache.hadoop.yarn.api.records.QueueInfo.class); Mockito.when(response.getQueueInfo()).thenReturn(queueInfo); Mockito.when(applicationsManager.getQueueInfo(Mockito.any( GetQueueInfoRequest.class))).thenReturn(response); ResourceMgrDelegate delegate = new ResourceMgrDelegate( new YarnConfiguration()) { @Override public synchronized void start() { this.rmClient = applicationsManager; } }; delegate.getRootQueues(); ArgumentCaptor<GetQueueInfoRequest> argument = ArgumentCaptor.forClass(GetQueueInfoRequest.class); Mockito.verify(applicationsManager).getQueueInfo( argument.capture()); Assert.assertTrue("Children of root queue not requested", argument.getValue().getIncludeChildQueues()); Assert.assertTrue("Request wasn't to recurse through children", argument.getValue().getRecursive()); }