@@ -29,6 +29,7 @@ final class SpannerFeature implements Feature {
2929
3030 private static final String SPANNER_CLASS = "com.google.spanner.v1.SpannerGrpc" ;
3131 private static final String SPANNER_TEST_CLASS = "com.google.cloud.spanner.GceTestEnvConfig" ;
32+ private static final String MOCK_CLASS = "com.google.cloud.spanner.MockDatabaseAdminServiceImpl" ;
3233 private static final String CLIENT_SIDE_IMPL_CLASS =
3334 "com.google.cloud.spanner.connection.ClientSideStatementImpl" ;
3435 private static final String CLIENT_SIDE_VALUE_CONVERTER =
@@ -50,10 +51,7 @@ final class SpannerFeature implements Feature {
5051
5152 @ Override
5253 public void beforeAnalysis (BeforeAnalysisAccess access ) {
53- Class <?> spannerTestClass = access .findClassByName (SPANNER_TEST_CLASS );
54- if (spannerTestClass != null ) {
55- NativeImageUtils .registerConstructorsForReflection (access , SPANNER_TEST_CLASS );
56- }
54+ registerSpannerTestClasses (access );
5755 if (access .findClassByName (CLIENT_SIDE_IMPL_CLASS ) != null ) {
5856 NativeImageUtils .registerClassHierarchyForReflection (access , CLIENT_SIDE_IMPL_CLASS );
5957 }
@@ -103,4 +101,16 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
103101 "\\ Qcom/google/cloud/spanner/connection/ITSqlScriptTest_TestQueryOptions.sql\\ E" );
104102 }
105103 }
104+
105+ private void registerSpannerTestClasses (BeforeAnalysisAccess access ) {
106+ Class <?> spannerTestClass = access .findClassByName (SPANNER_TEST_CLASS );
107+ if (spannerTestClass != null ) {
108+ NativeImageUtils .registerConstructorsForReflection (access , SPANNER_TEST_CLASS );
109+ }
110+ Class <?> mockClass = access .findClassByName (MOCK_CLASS );
111+ if (mockClass != null ) {
112+ NativeImageUtils .registerClassForReflection (
113+ access , "com.google.cloud.spanner.MockDatabaseAdminServiceImpl$MockBackup" );
114+ }
115+ }
106116}
0 commit comments