-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
59 lines (42 loc) · 1.57 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# REST Service
Prerequisites:
-------------
JDK 1.7
Maven 3+
You can build the project to generate a war file or start a standalone server through maven
> Build the project
mvn clean package
This will create a war file inside [project_home]/target put the artifact in tomcat
> Standlaone Instance
mvn clean jetty:run
This will start a standalone server instance.
Available Services:
------------------
Can be found at http://localhost:8080/RESTservice/
> User Management Service
Includes CRUD operations with GET,POST,PUT,DELETE
NOTE: includes a in-memory H2 db so please be aware of memmory usage
Usage:
-----
The accepted json format is as follows;
{
"employeeId": 1,
"firstName": "Nuwan",
"lastName": "Silva",
"salary": 100000.0,
"status": "ACTIVE"
}
Create User:
curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"employeeId":1,"firstName":"Nuwan","lastName":"Silva","salary":100000.0,"status":"ACTIVE"}' http://localhost:8080/RESTservice/user/add
View created user:
curl -X GET -H 'Content-Type:application/json' -H 'Accept:application/json' http://localhost:8080/RESTservice/user/search/1
Update user:
curl -X PUT -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"employeeId":1,"status":"BLOCKED"}' http://localhost:8080/RESTservice/user/update
Delete user:
curl -X DELETE -H 'Content-Type:application/json' -H 'Accept:application/json' http://localhost:8080/RESTservice/user/delete/1
Testing scripts:
---------------
available @ [PROJECT_HOME]/scripts
1. start the service
2. run the scripts through
./runner.sh