JUnit Jupiter:SpannerRepositoryIntegrationTests:testRestEndpoint()
MethodSource [className = 'com.example.SpannerRepositoryIntegrationTests', methodName = 'testRestEndpoint', methodParameterTypes = '']
=> java.lang.IllegalStateException: Failed to load ApplicationContext for [AotMergedContextConfiguration@4cc91e70 testClass = com.example.SpannerRepositoryIntegrationTests,
...
[...]
Caused by: org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively invoke method public synchronized int org.apache.coyote.AbstractProtocol.getNameIndex() without it being registered for runtime reflection. Add it to the reflection metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection for help.
org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.forQueriedOnlyExecutable(MissingReflectionRegistrationUtils.java:97)
java.base@17.0.7/java.lang.reflect.Method.acquireMethodAccessor(Method.java:77)
java.base@17.0.7/java.lang.reflect.Method.invoke(Method.java:566)
org.apache.tomcat.util.IntrospectionUtils.getProperty(IntrospectionUtils.java:250)
org.apache.catalina.connector.Connector.getProperty(Connector.java:298)
[...]
Command:
mvn clean test --activate-profiles native-sample-config,nativeTest --define notAllModules=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip -Dtests=com.example.SpannerRepositoryIntegrationTests#testRestEndpointPut
Results in:
Adding the following reflection configs as suggested resolves the previous error but results in an NPE at https://github.com/GoogleCloudPlatform/spring-cloud-gcp/blob/28ab0c29e5763df42e986e8c31a9fe5a22fa0416/spring-cloud-gcp-samples/spring-cloud-gcp-data-spanner-repository-sample/src/test/java/com/example/SpannerRepositoryIntegrationTests.java#L87
Stacktrace: