From b443c0f07a67e281a96c2d8332a447240716f46b Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Wed, 18 May 2016 20:51:16 -0700 Subject: [PATCH] Fix styles and tests --- .../java/com/microsoft/rest/UserAgentInterceptor.java | 10 ++++++++++ .../test/java/com/microsoft/rest/UserAgentTests.java | 11 +++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/client-runtime/src/main/java/com/microsoft/rest/UserAgentInterceptor.java b/client-runtime/src/main/java/com/microsoft/rest/UserAgentInterceptor.java index 7705592ba9f72..ac4a5ec5a73c4 100644 --- a/client-runtime/src/main/java/com/microsoft/rest/UserAgentInterceptor.java +++ b/client-runtime/src/main/java/com/microsoft/rest/UserAgentInterceptor.java @@ -35,10 +35,20 @@ public UserAgentInterceptor() { this.userAgent = DEFAULT_USER_AGENT_HEADER; } + /** + * Overwrite the User-Agent header. + * + * @param userAgent the new user agent value. + */ public void setUserAgent(String userAgent) { this.userAgent = userAgent; } + /** + * Append a text to the User-Agent header. + * + * @param userAgent the user agent value to append. + */ public void appendUserAgent(String userAgent) { this.userAgent += " " + userAgent; } diff --git a/client-runtime/src/test/java/com/microsoft/rest/UserAgentTests.java b/client-runtime/src/test/java/com/microsoft/rest/UserAgentTests.java index 7949ad8433655..35970714e3a83 100644 --- a/client-runtime/src/test/java/com/microsoft/rest/UserAgentTests.java +++ b/client-runtime/src/test/java/com/microsoft/rest/UserAgentTests.java @@ -8,18 +8,17 @@ package com.microsoft.rest; import com.microsoft.rest.serializer.JacksonMapperAdapter; -import okhttp3.Interceptor; -import okhttp3.OkHttpClient; -import okhttp3.Protocol; -import okhttp3.Request; -import okhttp3.Response; -import retrofit2.Retrofit; import org.junit.Assert; import org.junit.Test; import java.io.IOException; +import okhttp3.Interceptor; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; + public class UserAgentTests { @Test public void defaultUserAgentTests() throws Exception {