### Question:
AdWordsSession implements AdsSession, OAuth2Compatible { public String getUserAgent() { return userAgent; } private  AdWordsSession(Builder builder); String getClientCustomerId(); void setClientCustomerId(String clientCustomerId); @Nullable Boolean isValidateOnly(); void setValidateOnly(@Nullable Boolean isValidateOnly); String getUserAgent(); String getDeveloperToken(); @Nullable Boolean isPartialFailure(); void setPartialFailure(@Nullable Boolean isPartialFailure); @Override Credential getOAuth2Credential(); void setOAuth2Credential(Credential oAuth2Credential); @Nullable ReportingConfiguration getReportingConfiguration(); void setReportingConfiguration(@Nullable ReportingConfiguration reportingConfiguration); @Override String getEndpoint(); Builder newBuilder(); static final String DEFAULT_ENDPOINT; }### Answer:
@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()); }
@Test public void testReadPropertiesFromConfiguration_defaultUserAgent() throws ValidationException { PropertiesConfiguration config = new PropertiesConfiguration(); config.setProperty("api.adwords.userAgent", "INSERT_USERAGENT_HERE"); AdWordsSession adWordsSession = build( new AdWordsSession.Builder() .from(config) .withDeveloperToken("devTokendevTokendevTok") .withOAuth2Credential(credential)); assertEquals(AdWordsSession.UNKNOWN_USER_AGENT, adWordsSession.getUserAgent()); }
@Test public void testBuilder_noUserAgent() throws Exception { AdWordsSession adWordsSession = build( new AdWordsSession.Builder() .withOAuth2Credential(credential) .withEndpoint("https: .withDeveloperToken("developerToken")); assertEquals(AdWordsSession.UNKNOWN_USER_AGENT, adWordsSession.getUserAgent()); }
@Test public void testBuilder_defaultUserAgent() throws Exception { AdWordsSession adWordsSession = build( new AdWordsSession.Builder() .withOAuth2Credential(credential) .withEndpoint("https: .withUserAgent("INSERT_USERAGENT_HERE") .withDeveloperToken("developerToken")); assertEquals(AdWordsSession.UNKNOWN_USER_AGENT, adWordsSession.getUserAgent()); }