Data generator of ecFeed can create results in JSON format. In order to get results from a HTTP POST request should be sent to the following address:
https://[ecFeed-generator-address].com/testCaseServiceJson
As [ecFeed-generator-address] a valid ecFeed generator address should be provided.
Parameters of HTTP request are:
?Content-Type=application/json&requestType=requestData
Example of request:
POST https://[ecFeed-generator-address]/testCaseServiceJson?Content-Type=application%2Fjson&requestType=requestData HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/json
Content-Length: 260
Host: develop-gen.ecfeed.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
In order to get access to the server and user's models a keystore should be generated. Follow instructions on ecFeed site > Tutorials > Documentation > General > Security. Generated file: security.p12 should be registered in third-party software which sends the request. Refer to the manual of this software, to get the instructions how to register the keystore.
Example:
{
"responseFormat":"JSON1",
"method":"method1",
"model":"XXXX-XXXX-XXXX-XXXX-XXXX",
"userData":"{'dataSource':'genNWise', 'constraints':'NONE'}",
"sessionId":0
}
Request body has JSON format.
Property: responseFormat should be defined as JSON1 or JSON2.
The remaining fields are according to the ecFeed standard generator request syntax, which is described in another tutorial.
The general format format of the response is:
HTTP/1.1 200 Content-Type: application/json Transfer-Encoding: chunked Date: Tue, 22 Feb 2022 08:48:43 GMT
[ {test-case-1}, {test-case-2} ...... ]
Test case in this format has the following structure:
{
"choice-name-1":"value-1",
......
"choice-name-x":"value-x"
}
Assignments, which are the results of evaluation of constraints look as follows:
"@assignment1":"true"
"@assignment2":"true"
Assignments are numbered starting from one.
Example:
{
"Norway":"Norway",
"t-Shirt":"t-Shirt",
"lowQuantity":"2",
"@assignment1":"true"
}
The order of fields in this test case matches the order of parameters in method, from which the test cases have been generated.
So for the example above, the first parameter would be: country, the second: productName etc.
Test case in this format has the following structure:
{
"parameter-name-1":"value-1",
......
"parameter-name-x":"value-x"
}
Example:
{ country:"Norway", "productName":"t-Shirt", "quantity":"2", "orderStatus":"true" }