We are using sap cloud sdk to consume external OData service. In our Unit Tests we use mockito "RETURNS_DEEP_STUBS" approach to mock the service class generated by Cloud SDK but we get null pointer exception: "java.lang.NullPointerException: Cannot invoke "com.sap.cloud.sdk.datamodel.odatav4.core.NavigationPropertyCollectionQuery.select(com.sap.cloud.sdk.datamodel.odatav4.core.Property[])" because "this.delegateQuery" is null".
when(service.getAllEntities().select(Entities.FIELD_NAME).execute(destination)).thenReturn(List.of(e1, e2));
It seems the root cause is because some methods like "select" and "filter" are defined as final in the generated class by Cloud SDK.
How shall we overcome this? By the way, are there any good and complete documentation or tutorial about how to do unit tests or integration tests when we use Cloud SDK to consume OData API call? Thanks.