@@ -72,6 +72,8 @@ public class TestHTTPClient {
7272
7373 private static final int PORT = 1080 ;
7474 private static final String BEARER_AUTH_TOKEN = "auth_token" ;
75+ private static final String USER_AGENT = "User-Agent" ;
76+ private static final String TEST_USER_AGENT = "Test-User-Agent" ;
7577 private static final String URI = String .format ("http://127.0.0.1:%d" , PORT );
7678 private static final ObjectMapper MAPPER = RESTObjectMapper .mapper ();
7779
@@ -96,7 +98,10 @@ public static class TLSConfigurerMissingNoArgCtor implements TLSConfigurer {
9698 public static void beforeClass () {
9799 mockServer = startClientAndServer (PORT );
98100 restClient =
99- HTTPClient .builder (ImmutableMap .of ()).uri (URI ).withAuthSession (AuthSession .EMPTY ).build ();
101+ HTTPClient .builder (ImmutableMap .of (HTTPClient .REST_USER_AGENT , TEST_USER_AGENT ))
102+ .uri (URI )
103+ .withAuthSession (AuthSession .EMPTY )
104+ .build ();
100105 icebergBuildGitCommitShort = IcebergBuild .gitCommitShortId ();
101106 icebergBuildFullVersion = IcebergBuild .fullVersion ();
102107 }
@@ -516,7 +521,8 @@ private static String addRequestTestCaseAndGetPath(HttpMethod method, Item body,
516521 .withMethod (method .name ().toUpperCase (Locale .ROOT ))
517522 .withHeader ("Authorization" , "Bearer " + BEARER_AUTH_TOKEN )
518523 .withHeader (HTTPClient .CLIENT_VERSION_HEADER , icebergBuildFullVersion )
519- .withHeader (HTTPClient .CLIENT_GIT_COMMIT_SHORT_HEADER , icebergBuildGitCommitShort );
524+ .withHeader (HTTPClient .CLIENT_GIT_COMMIT_SHORT_HEADER , icebergBuildGitCommitShort )
525+ .withHeader (USER_AGENT , TEST_USER_AGENT );
520526
521527 if (method .usesRequestBody ()) {
522528 mockRequest = mockRequest .withBody (asJson );
0 commit comments