java – mock adwords api

I want to test the code that connects to the Adwords API instead of actually calling Google (which costs money) Do you know how to insert a new implementation of trafficestimatorserviceinterface?

The Adwords client API uses Guice for dependency injection, but I'm not sure how to modify the injector to modify it?!

If it helps, that's how I do it now:

AdWordsServices adWordsServices = new AdWordsServices();
    AdWordsSession session = AdwordsUtils.getSession();

    TrafficEstimatorServiceInterface trafficEstimatorService =
            adWordsServices.get(session,TrafficEstimatorServiceInterface.class);

Solution

You should use test account to do this In addition, it will no longer be the charge for using the Adwords API from March 1, 2013, but you should continue to use the test account when developing the tool

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>