Skip to Content
avatar image
Former Member

Help please for Northwind and mockServer sapui5

Hi everyone!

I am setting up a Mockserver to do unit tests on a sapui5 project, but i did not understand how to Northwind worked, i have somes questions please :

- How is my data JSON ans Northwind data is linking?

- Does my data have to come from an API for mockServer?

- How do you generate our data with Northwind?

I think i understood the operation of the mockServer but not Northwind.

I hope to have been clear .

Thank you.

Best regards.

Mathieu.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 29 at 01:20 PM

    ok i understand, but if i want to define my data how can i do if i have already my json file ?

    in fact i would have given the path to Northwind to provide me the metadata of the model i want.

    manifest.json
    
    
    {
      "_version": "1.1.0",
      "sap.app": {
    	...
    	"ach": "CA-UI5-DOC",
    	"dataSources": {
    	  "myRemote": {
    		"uri": "https://services.odata.org/V2/Northwind/Northwind.svc/",
    		"type": "OData",
    		"settings": {
    		  "odataVersion": "2.0"
    		}
    	  }
    	}
      },
      "sap.ui": {
    	...
      },
      "sap.ui5": {
    	"_version": "1.1.0",
    	"rootView": "sap.ui.demo.wt.view.App",
    	"dependencies": {
    	  "minUI5Version": "1.30",
    	  "libs": {
    		"sap.m": {}
    	  }
    	},
    	"models": {
    	  "i18n": {
    		"type": "sap.ui.model.resource.ResourceModel",
    		"settings": {
    		  "bundleName": "sap.ui.demo.wt.i18n.i18n"
    		}
    	  },
    	  "mydata": {
    		"dataSource": "myRemote"
    	  }
    	}
      }
    }
    Add comment
    10|10000 characters needed characters exceeded

  • Apr 29 at 12:45 PM

    if mockserver is in place, no real service will be called.

    mockserver provide dummy data for you

    right click the metadata.xml to prepare the dummy data

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 29 at 01:36 PM

    copy your json data content to the json file generated by web ide for mockserver

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 29 at 02:14 PM

    I have create a json file with my jsonData in mockData folder, after that i will set my manifest like this :

    I understand to generate the metadata one must give the url of this project + the uri like this :

    https://webide-p2000223469trial.dispatcher.hanatrial.ondemand.com + /destinations/airportRemote/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/
    "sap.app": {
    .....
    "dataSources": { // Here
                "airportRemote": {
                    "uri": "/destinations/airportRemote/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/",
                    "type": "OData",
                    "settings": {
                        "odataVersion": "2.0"
                    }
                }
            }
        },
    
    
    "models": {
                "i18n": {
                    "type": "sap.ui.model.resource.ResourceModel",
                    "settings": {
                        "bundleName": "EuropeanairportEuropeanairport.i18n.i18n"
                    }
                },
                "JSON": { // Here 
                    "dataSource": "airportRemote"            
                }
            },
    Add comment
    10|10000 characters needed characters exceeded