Skip to Content
0

Help please for Northwind and mockServer sapui5

Apr 29 at 12:19 PM

28

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

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

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"
	  }
	}
  }
}
Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Apr 29 at 12:45 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Apr 29 at 01:36 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 29 at 02:14 PM
0

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"            
            }
        },
Share
10 |10000 characters needed characters left characters exceeded