How to execute integrationtests for own OData service in SAP Cloud SDK

Tim L.

We currently provide an own OData service in our Spring Boot application with the SAP Cloud Platform Provisioning SDK which is part of the SAP Cloud SDK. We are creating integration tests in the respective maven module, but when executing this via Maven it fails with the following stack trace:

[http-nio-auto-1-exec-1] ERROR com.sap.cloud.sdk.service.prov.v2.rt.cdx.CDXRuntimeDelegate - Error initializing the service <service-name>
java.lang.IllegalArgumentException: URI is not hierarchical
        at java.io.File.<init>(File.java:418)
        at com.sap.cloud.sdk.service.prov.v2.rt.cdx.CDXRuntimeDelegate.getFilefromFileName(CDXRuntimeDelegate.java:410)
        at com.sap.cloud.sdk.service.prov.v2.rt.cdx.CDXRuntimeDelegate.getFileForService(CDXRuntimeDelegate.java:387)
        at com.sap.cloud.sdk.service.prov.v2.rt.cdx.CDXRuntimeDelegate.initialize(CDXRuntimeDelegate.java:252)
        at com.sap.cloud.sdk.service.prov.v2.rt.cdx.CDXRuntimeDelegate.getModelProvider(CDXRuntimeDelegate.java:204)
        at com.sap.gateway.core.api.provider.delegate.ProviderFactory.createModelProvider(ProviderFactory.java:202)
        at com.sap.gateway.core.api.provider.delegate.ProviderFactory.getEdmModelProvider(ProviderFactory.java:128)
        at com.sap.gateway.core.odata4sap.ServiceFactory.createService(ServiceFactory.java:135)

Looking at the code this seems to be related to the following post:

Why is my URI not hierarchical?

In the SDK the OData EDMX file is read as a file however since during maven execution it is in a separate JAR file (of the application module) it cannot be accessed that way. Instead it would need to be read as a stream, which in turn seems to require some refactoring.

As a workaround I copied the EDMX file to the src/test/resources/edmx of the integration-tests module.

I'm now wondering if I am missing something here, or if the execution of the integration-tests as usually done per SAP Cloud SDK is not compatible with the provisioning framework?

Alexander Dümont

Although I'm not too familiar with the use case you explained, I would recommend checking out the Maven documentation on additional resource folders. You can probably point your integration-tests module to the respective /resources folder of application modules, in addition to its own /resources folder. I think relative paths should be possible.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I access OData service using the SAP S/4HANA Cloud SDK in existing application?

From Java

How to avoid a DestinationAccessException when sending a POST request to an OData service using SAP Cloud SDK version 3.2.0

From Java

SAP Cloud SDK method for output service in OData form

From Java

Send POST request to OData service using SAP Cloud SDK version 3.2.0

From Dev

Use SAP Cloud SDK to integrate with a custom backend service (oData) based on VDM Generator

From Dev

com.sap.cloud.sdk.datamodel.odata render empty fields

From Dev

How to ping sap s4 service endpoint from cloud sdk?

From Dev

S/4HANA Cloud SDK :com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces does not exist

From Dev

Unable to access private classes in com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces

From Dev

OData navigation returns exception when using SAP APM and S/4HANA Cloud SDK

From Dev

SAP Cloud SDK JavaScript URL encoding ODATA filter (API_PRODUCT_SRV)

From Dev

SAP Cloud SDK for Javascript: difference between pre-delivered OData services VS self-generated clients

From Dev

SAP Java SDK OData results are sometimes multiplied

From Java

How to fix a DestinationAccessException thrown by the SAP Cloud SDK during application startup

From Dev

How to get user info and authorities in SAP Cloud SDK 3.0 and above

From Dev

Return delta from SAP OData Sample service

From Dev

How to deal with odata service created with 1000 rows of hana table in SAP hana XS app

From Dev

How to read an aggregated entity from Odata Service SAP ui5

From Dev

OData service authentication with SAP Gateway service OpenUI5

From Java

Execute IntegrationTests in an already running Hybris server

From Dev

Unable to fetch the metadata : Failed to execute OData Metadata request. error after deploying s4sdk to cloud foundry

From Dev

Securing a JS application built with SAP Cloud SDK

From Dev

SAP Cloud SDK Spring Security JARS

From Dev

SAP Cloud SDK for javascript using the destination

From Java

Perform filter on expanded entity with SAP Cloud SDK

From Dev

Root cause & Propagation of Exception in SAP Cloud SDK

From Dev

How to execute Google Cloud Run service every N minutes?

From Dev

How to execute Google Cloud Run service every day?

From Dev

How to change the thresholds for failure and warning on SAP S/4HANA Cloud SDK Pipeline?

Related Related

  1. 1

    How do I access OData service using the SAP S/4HANA Cloud SDK in existing application?

  2. 2

    How to avoid a DestinationAccessException when sending a POST request to an OData service using SAP Cloud SDK version 3.2.0

  3. 3

    SAP Cloud SDK method for output service in OData form

  4. 4

    Send POST request to OData service using SAP Cloud SDK version 3.2.0

  5. 5

    Use SAP Cloud SDK to integrate with a custom backend service (oData) based on VDM Generator

  6. 6

    com.sap.cloud.sdk.datamodel.odata render empty fields

  7. 7

    How to ping sap s4 service endpoint from cloud sdk?

  8. 8

    S/4HANA Cloud SDK :com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces does not exist

  9. 9

    Unable to access private classes in com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces

  10. 10

    OData navigation returns exception when using SAP APM and S/4HANA Cloud SDK

  11. 11

    SAP Cloud SDK JavaScript URL encoding ODATA filter (API_PRODUCT_SRV)

  12. 12

    SAP Cloud SDK for Javascript: difference between pre-delivered OData services VS self-generated clients

  13. 13

    SAP Java SDK OData results are sometimes multiplied

  14. 14

    How to fix a DestinationAccessException thrown by the SAP Cloud SDK during application startup

  15. 15

    How to get user info and authorities in SAP Cloud SDK 3.0 and above

  16. 16

    Return delta from SAP OData Sample service

  17. 17

    How to deal with odata service created with 1000 rows of hana table in SAP hana XS app

  18. 18

    How to read an aggregated entity from Odata Service SAP ui5

  19. 19

    OData service authentication with SAP Gateway service OpenUI5

  20. 20

    Execute IntegrationTests in an already running Hybris server

  21. 21

    Unable to fetch the metadata : Failed to execute OData Metadata request. error after deploying s4sdk to cloud foundry

  22. 22

    Securing a JS application built with SAP Cloud SDK

  23. 23

    SAP Cloud SDK Spring Security JARS

  24. 24

    SAP Cloud SDK for javascript using the destination

  25. 25

    Perform filter on expanded entity with SAP Cloud SDK

  26. 26

    Root cause & Propagation of Exception in SAP Cloud SDK

  27. 27

    How to execute Google Cloud Run service every N minutes?

  28. 28

    How to execute Google Cloud Run service every day?

  29. 29

    How to change the thresholds for failure and warning on SAP S/4HANA Cloud SDK Pipeline?

HotTag

Archive