use of com.google.api.ads.adwords.lib.client.AdWordsSession.Builder in project googleads-java-lib by googleads.
the class AdWordsSessionTest method testReadPropertiesFromConfiguration_noUserAgent.
/**
* Tests that the builder correctly reads properties from a configuration.
*/
@Test
public void testReadPropertiesFromConfiguration_noUserAgent() throws ValidationException {
PropertiesConfiguration config = new PropertiesConfiguration();
AdWordsSession adWordsSession = build(new AdWordsSession.Builder().from(config).withDeveloperToken("devTokendevTokendevTok").withOAuth2Credential(credential));
assertEquals(AdWordsSession.UNKNOWN_USER_AGENT, adWordsSession.getUserAgent());
}
use of com.google.api.ads.adwords.lib.client.AdWordsSession.Builder in project googleads-java-lib by googleads.
the class AdWordsSessionTest method testBuilder_defaultUserAgent.
/**
* Tests that the builder builds with the 'unknown' user agent if the default user agent is
* specified.
*/
@Test
public void testBuilder_defaultUserAgent() throws Exception {
AdWordsSession adWordsSession = build(new AdWordsSession.Builder().withOAuth2Credential(credential).withEndpoint("https://www.google.com").withUserAgent("INSERT_USERAGENT_HERE").withDeveloperToken("developerToken"));
assertEquals(AdWordsSession.UNKNOWN_USER_AGENT, adWordsSession.getUserAgent());
}
Aggregations