@Test
public void testCountersFromHistoryServer() throws Exception {                                 

  MRClientProtocol historyServerProxy = mock(MRClientProtocol.class);                           
  when(historyServerProxy.getCounters(getCountersRequest())).thenReturn(                      
      getCountersResponseFromHistoryServer());
  ResourceMgrDelegate rm = mock(ResourceMgrDelegate.class);                                     
  when(rm.getApplicationReport(TypeConverter.toYarn(oldJobId).getAppId()))                      
      .thenReturn(null);                                                                        
  ClientServiceDelegate clientServiceDelegate = getClientServiceDelegate(                       
      historyServerProxy, rm);
  Counters counters = TypeConverter.toYarn(clientServiceDelegate.getJobCounters(oldJobId));
  Assert.assertNotNull(counters);
  Assert.assertEquals(1001, counters.getCounterGroup("dummyCounters").getCounter("dummyCounter").getValue());                               
}