Lab Assignment:: 8 - GayathreeIyer/Advanced-Software-Engineering GitHub Wiki

Name: Gayathree Natarajan Iyer

UMKC ID: 16227784

Class ID: 20

Lab Assignment 8::


Question 1: Implement a web server proxy (related to your own project) to integrate data from at least two Rest services.


Answer:

--> I have used 2 rest services:

1)Calculation of calorie in body with inputs - height, weight and age of a person. 2)Calculation of Fat, Protein, Carbs with input - calorie. The third page includes the mashup of these 2 rest services- Json data of both rest services.

MainPage


--> Calculation of amount of calorie in the body. Input to this formula is weight, height and age of that person.

Calorie Calculation Formula


--> Calculation of amount of fat, protein, carbs in the body. Input to this formula is calorie.

Fat, Protein, Carb calculation Formula


--> JsonData

Json Data


--> Mashup.

Mashup


--> Enabling cross-origin resource sharing.

Cors


--> Filled main page with calculated values.

Output


--> One more example.

Example-2



Question 2: Write at least two suitable Junit Test cases for the classes created.


Answer:

Junit Testing

--> Positive test for calorie calculation.

Junit Testing-positive


--> Negative test for calorie calculation.

Junit Testing-negative


--> One more Junit Testing

One more Junit Testing