instance.setAutoCreateAccountant(false);
AdWordsUser testUser = new AdWordsUser("test_data/test.properties");
CampaignServiceInterface campaignService =
testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
campaignService.get(new CampaignSelector());
assertNull("No service accountant should be created.", instance
.getServiceAccountant(campaignService));
ServiceAccountant serviceAccountant =
ServiceAccountantManager.createServiceAccountant(((Stub) campaignService)._getService());
assertTrue("Service accountant should be empty.", serviceAccountant.getTotalUnitCount() == 0);
campaignService.get(new CampaignSelector());
long totalUnits = serviceAccountant.getTotalUnitCount();
assertTrue("Service accountant not used.", totalUnits > 0);
instance.clear();
campaignService.get(new CampaignSelector());
assertEquals("Service accountant still used.", totalUnits, serviceAccountant
.getTotalUnitCount());
}