47
47
import com .google .firebase .TestOnlyImplFirebaseTrampolines ;
48
48
import com .google .firebase .auth .MockGoogleCredentials ;
49
49
import com .google .firebase .internal .TestApiClientUtils ;
50
+ import com .google .firebase .internal .SdkUtils ;
50
51
import com .google .firebase .testing .MultiRequestMockHttpTransport ;
51
52
import com .google .firebase .testing .TestUtils ;
52
53
import java .io .ByteArrayOutputStream ;
@@ -72,6 +73,7 @@ public class FirebaseProjectManagementServiceImplTest {
72
73
private static final String IOS_APP_ID = "test-ios-app-id" ;
73
74
private static final String IOS_APP_RESOURCE_NAME = "ios/11111" ;
74
75
private static final String ANDROID_APP_RESOURCE_NAME = "android/11111" ;
76
+ private static final String CLIENT_VERSION = "Java/Admin/" + SdkUtils .getVersion ();
75
77
private static final IosAppMetadata IOS_APP_METADATA =
76
78
new IosAppMetadata (IOS_APP_RESOURCE_NAME , IOS_APP_ID , DISPLAY_NAME , PROJECT_ID , BUNDLE_ID );
77
79
private static final AndroidAppMetadata ANDROID_APP_METADATA =
@@ -1104,7 +1106,7 @@ private static FirebaseProjectManagementServiceImpl initServiceImplWithFaultyTra
1104
1106
.setHttpTransport (TestUtils .createFaultyHttpTransport ())
1105
1107
.build ();
1106
1108
FirebaseApp app = FirebaseApp .initializeApp (options );
1107
- return new FirebaseProjectManagementServiceImpl (app , new MockSleeper (), new MockScheduler () );
1109
+ return new FirebaseProjectManagementServiceImpl (app );
1108
1110
}
1109
1111
1110
1112
private void checkRequestHeader (String expectedUrl , HttpMethod httpMethod ) {
@@ -1119,6 +1121,7 @@ private void checkRequestHeader(int index, String expectedUrl, HttpMethod httpMe
1119
1121
assertEquals (httpMethod .name (), request .getRequestMethod ());
1120
1122
assertEquals (expectedUrl , request .getUrl ().toString ());
1121
1123
assertEquals ("Bearer test-token" , request .getHeaders ().getAuthorization ());
1124
+ assertEquals (CLIENT_VERSION , request .getHeaders ().get ("X-Client-Version" ));
1122
1125
}
1123
1126
1124
1127
private void checkRequestPayload (Map <String , String > expected ) throws IOException {
0 commit comments