Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.09 KB | None | 0 0
  1. CraftComponent Rest testing curl commands
  2.  
  3. Test findAll:
  4. curl -X GET \
  5. http://localhost:8080/pa165/rest/craftComponents/ \
  6. -H 'authorization: Basic QURNSU46QURNSU4=' \
  7. -H 'cache-control: no-cache' \
  8. -H 'postman-token: 9ef27618-7713-6c32-60ec-9a0759600164'
  9.  
  10. Test findById:
  11. curl -X GET \
  12. http://localhost:8080/pa165/rest/craftComponents/{id} \
  13. -H 'authorization: Basic QURNSU46QURNSU4=' \
  14. -H 'cache-control: no-cache' \
  15. -H 'postman-token: 114d6edf-d8ff-bf7c-290c-1ec489fc991d'
  16.  
  17. Test create:
  18. curl -X POST \
  19. http://localhost:8080/pa165/rest/craftComponents/ \
  20. -H 'authorization: Basic QURNSU46QURNSU4=' \
  21. -H 'cache-control: no-cache' \
  22. -H 'content-type: application/json' \
  23. -H 'postman-token: c53a8050-affa-4db6-762b-19fed285fc54' \
  24. -d '{
  25. "readyToUse": false,
  26. "name": "Wing4",
  27. "spacecraft": null,
  28. "readyDate": "2017-12-22T16:40:17.629+01:00[Europe/Prague]"
  29. }'
  30.  
  31. Test update:
  32. curl -X PUT \
  33. http://localhost:8080/pa165/rest/craftComponents/ \
  34. -H 'authorization: Basic QURNSU46QURNSU4=' \
  35. -H 'cache-control: no-cache' \
  36. -H 'content-type: application/json' \
  37. -H 'postman-token: e3b45f7d-038f-fde3-8700-4f7898556b6d' \
  38. -d '{
  39. "id": "2",
  40. "readyToUse": false,
  41. "name": "Wing120",
  42. "spacecraft": null,
  43. "readyDate": "2017-12-22T16:40:17.629+01:00[Europe/Prague]"
  44. }'
  45.  
  46. User Rest testing curl commands
  47.  
  48. Test findAll:
  49. curl -X GET \
  50. http://localhost:8080/pa165/rest/users/ \
  51. -H 'authorization: Basic QURNSU46QURNSU4=' \
  52. -H 'cache-control: no-cache' \
  53. -H 'postman-token: 42d714f1-97b9-99a9-c75d-4cf71bc0d5a8'
  54.  
  55. Test findById:
  56. curl -X GET \
  57. http://localhost:8080/pa165/rest/users/{id} \
  58. -H 'authorization: Basic QURNSU46QURNSU4=' \
  59. -H 'cache-control: no-cache' \
  60. -H 'postman-token: 155b34b2-53f6-bb96-39fe-bc7335cfc476'
  61.  
  62. Test create:
  63. curl -X POST \
  64. http://localhost:8080/pa165/rest/users/ \
  65. -H 'authorization: Basic QURNSU46QURNSU4=' \
  66. -H 'cache-control: no-cache' \
  67. -H 'content-type: application/json' \
  68. -H 'postman-token: ae32cc17-776d-b46d-f925-8ae9dc39d5f4' \
  69. -d '{
  70. "name": "Gagarin",
  71. "email": "gagarin1@gmail.com",
  72. "password": "1000:7659677b31cfa20fc71876734a58491198ddbbc1c4746f52:0808b9f7fa8cc4d6fd42ef35257e2b0805e9f2ac8de75e42",
  73. "experienceLevel": 10,
  74. "acceptedMission": false,
  75. "explanation": null,
  76. "mission": null,
  77. "manager": false,
  78. "birthDate": "1934-03-09"
  79. }'
  80.  
  81. Test update:
  82. curl -X PUT \
  83. http://localhost:8080/pa165/rest/users/ \
  84. -H 'authorization: Basic QURNSU46QURNSU4=' \
  85. -H 'cache-control: no-cache' \
  86. -H 'content-type: application/json' \
  87. -H 'postman-token: 2c96e5ab-9e6a-da02-dd56-11276047d3b5' \
  88. -d '{
  89. "id": "2",
  90. "name": "Gagarin4",
  91. "email": "gagarin5@gmail.com",
  92. "password": "1000:7659677b31cfa20fc71876734a58491198ddbbc1c4746f52:0808b9f7fa8cc4d6fd42ef35257e2b0805e9f2ac8de75e42",
  93. "experienceLevel": 10,
  94. "acceptedMission": false,
  95. "explanation": null,
  96. "mission": null,
  97. "manager": false,
  98. "birthDate": "1934-03-09"
  99. }'
  100.  
  101. Test delete:
  102. curl -X DELETE \
  103. http://localhost:8080/pa165/rest/users/{id} \
  104. -H 'authorization: Basic QURNSU46QURNSU4=' \
  105. -H 'cache-control: no-cache' \
  106. -H 'postman-token: 155b34b2-53f6-bb96-39fe-bc7335cfc476'
  107.  
  108.  
  109. Test findAllAvailableAstronauts:
  110. curl -X GET \
  111. http://localhost:8080/pa165/rest/users/astronauts/available \
  112. -H 'authorization: Basic QURNSU46QURNSU4=' \
  113. -H 'cache-control: no-cache' \
  114. -H 'postman-token: 42d714f1-97b9-99a9-c75d-4cf71bc0d5a8'
  115.  
  116.  
  117. Test findAllAstronauts:
  118. curl -X GET \
  119. http://localhost:8080/pa165/rest/users/astronauts \
  120. -H 'authorization: Basic QURNSU46QURNSU4=' \
  121. -H 'cache-control: no-cache' \
  122. -H 'postman-token: 42d714f1-97b9-99a9-c75d-4cf71bc0d5a8'
  123.  
  124.  
  125. Test acceptMission:
  126. curl -X GET \
  127. http://localhost:8080/pa165/rest/users/astronauts/{id}/acceptMission \
  128. -H 'authorization: Basic QURNSU46QURNSU4=' \
  129. -H 'cache-control: no-cache' \
  130. -H 'postman-token: 42d714f1-97b9-99a9-c75d-4cf71bc0d5a8'
  131.  
  132. Test rejectMission:
  133. curl -X POST \
  134. http://localhost:8080/pa165/rest/users/astronauts/{id}/rejectMission \
  135. -H 'authorization: Basic QURNSU46QURNSU4=' \
  136. -H 'cache-control: no-cache' \
  137. -H 'postman-token: 42d714f1-97b9-99a9-c75d-4cf71bc0d5a8'
  138. -d '{"explanation": "explanation"}'
  139.  
  140.  
  141. Test findByEmail:
  142. curl -X GET \
  143. http://localhost:8080/pa165/rest/users/email \
  144. -H 'authorization: Basic QURNSU46QURNSU4=' \
  145. -H 'cache-control: no-cache' \
  146. -H 'postman-token: 42d714f1-97b9-99a9-c75d-4cf71bc0d5a8'
  147. -d '{"email": "example@example.com"}'
  148.  
  149.  
  150. Spacecraft Rest testing curl commands
  151.  
  152.  
  153. Test findAll:
  154. curl -X GET \
  155. http://localhost:8080/pa165/rest/spacecrafts/ \
  156. -H 'authorization: Basic QURNSU46QURNSU4=' \
  157. -H 'cache-control: no-cache' \
  158. -H 'postman-token: 42d714f1-97b9-99a9-c75d-4cf71bc0d5a8'
  159.  
  160. Test findById:
  161. curl -X GET \
  162. http://localhost:8080/pa165/rest/spacecrafts/{id} \
  163. -H 'authorization: Basic QURNSU46QURNSU4=' \
  164. -H 'cache-control: no-cache' \
  165. -H 'postman-token: 155b34b2-53f6-bb96-39fe-bc7335cfc476'
  166.  
  167. Test create:
  168. curl -X POST \
  169. http://localhost:8080/pa165/rest/spacecrafts/ \
  170. -H 'authorization: Basic QURNSU46QURNSU4=' \
  171. -H 'cache-control: no-cache' \
  172. -H 'content-type: application/json' \
  173. -H 'postman-token: ae32cc17-776d-b46d-f925-8ae9dc39d5f4' \
  174. -d '{
  175. "type": "Manned spacecraft",
  176. "name": "Apollo 11",
  177. "components": [
  178. {
  179. "id": 1,
  180. "readyToUse": false,
  181. "name": "Wing",
  182. "readyDate": "2017-12-23T23:33:43.206+01:00[Europe/Prague]"
  183. },
  184. {
  185. "id": 2,
  186. "readyToUse": true,
  187. "name": "Fuel tank",
  188. "readyDate": null
  189. }
  190. ]
  191. }'
  192.  
  193. Test update:
  194. curl -X PUT \
  195. http://localhost:8080/pa165/rest/spacecrafts/ \
  196. -H 'authorization: Basic QURNSU46QURNSU4=' \
  197. -H 'cache-control: no-cache' \
  198. -H 'content-type: application/json' \
  199. -H 'postman-token: 2c96e5ab-9e6a-da02-dd56-11276047d3b5' \
  200. -d '{
  201. "id" : 1,
  202. "type": "Manned spacecraft",
  203. "name": "Apollo 11",
  204. "components": [
  205. {
  206. "id": 1,
  207. "readyToUse": false,
  208. "name": "Wing",
  209. "readyDate": "2017-12-23T23:33:43.206+01:00[Europe/Prague]"
  210. },
  211. {
  212. "id": 2,
  213. "readyToUse": true,
  214. "name": "Fuel tank",
  215. "readyDate": null
  216. }
  217. ]
  218. }'
  219.  
  220. Test delete:
  221. curl -X DELETE \
  222. http://localhost:8080/pa165/rest/spacecrafts/{id} \
  223. -H 'authorization: Basic QURNSU46QURNSU4=' \
  224. -H 'cache-control: no-cache' \
  225. -H 'postman-token: 155b34b2-53f6-bb96-39fe-bc7335cfc476'
  226.  
  227.  
  228.  
  229.  
  230. Mission Rest testing curl commands
  231.  
  232.  
  233. Test findAll:
  234. curl -X GET \
  235. http://localhost:8080/pa165/rest/missions/ \
  236. -H 'authorization: Basic QURNSU46QURNSU4=' \
  237. -H 'cache-control: no-cache' \
  238. -H 'postman-token: 42d714f1-97b9-99a9-c75d-4cf71bc0d5a8'
  239.  
  240. Test findById:
  241. curl -X GET \
  242. http://localhost:8080/pa165/rest/missions/{id} \
  243. -H 'authorization: Basic QURNSU46QURNSU4=' \
  244. -H 'cache-control: no-cache' \
  245. -H 'postman-token: 155b34b2-53f6-bb96-39fe-bc7335cfc476'
  246.  
  247. Test create:
  248. curl -X POST \
  249. http://localhost:8080/pa165/rest/missions/ \
  250. -H 'authorization: Basic QURNSU46QURNSU4=' \
  251. -H 'cache-control: no-cache' \
  252. -H 'content-type: application/json' \
  253. -H 'postman-token: ae32cc17-776d-b46d-f925-8ae9dc39d5f4' \
  254. -d '{
  255. "astronauts": [
  256. {
  257. "id": 2,
  258. "name": "Gagarin",
  259. "email": "gagarin@gmail.com",
  260. "password": "1000:9a780b21a3628308cbf4ad0e78ed6e7ebc808fab27c5748d:18e2d5b17579e44801b65b25cdd253cd7ca8cada9dacfd84",
  261. "experienceLevel": 10,
  262. "acceptedMission": false,
  263. "explanation": null,
  264. "manager": false,
  265. "birthDate": "1934-03-09"
  266. }
  267. ],
  268. "spacecrafts": [
  269. {
  270. "id": 1,
  271. "type": "Manned spacecraft",
  272. "name": "Apollo 11",
  273. "components": [
  274. {
  275. "id": 1,
  276. "readyToUse": false,
  277. "name": "Wing",
  278. "readyDate": "2017-12-23T23:33:43.206+01:00[Europe/Prague]"
  279. },
  280. {
  281. "id": 2,
  282. "readyToUse": true,
  283. "name": "Fuel tank",
  284. "readyDate": null
  285. }
  286. ]
  287. }
  288. ],
  289. "name": "Mars mission",
  290. "destination": "Mars",
  291. "missionDescription": "Simple mission to colonize Mars",
  292. "active": true,
  293. "result": null,
  294. "eta": "2018-02-06T23:33:43.977+01:00[Europe/Prague]",
  295. "endDate": null
  296. }'
  297.  
  298. Test update:
  299. curl -X PUT \
  300. http://localhost:8080/pa165/rest/missions/ \
  301. -H 'authorization: Basic QURNSU46QURNSU4=' \
  302. -H 'cache-control: no-cache' \
  303. -H 'content-type: application/json' \
  304. -H 'postman-token: 2c96e5ab-9e6a-da02-dd56-11276047d3b5' \
  305. -d '{
  306. "id": 1,
  307. "astronauts": [
  308. {
  309. "id": 2,
  310. "name": "Gagarin",
  311. "email": "gagarin@gmail.com",
  312. "password": "1000:9a780b21a3628308cbf4ad0e78ed6e7ebc808fab27c5748d:18e2d5b17579e44801b65b25cdd253cd7ca8cada9dacfd84",
  313. "experienceLevel": 10,
  314. "acceptedMission": false,
  315. "explanation": null,
  316. "manager": false,
  317. "birthDate": "1934-03-09"
  318. }
  319. ],
  320. "spacecrafts": [
  321. {
  322. "id": 1,
  323. "type": "Manned spacecraft",
  324. "name": "Apollo 11",
  325. "components": [
  326. {
  327. "id": 1,
  328. "readyToUse": false,
  329. "name": "Wing",
  330. "readyDate": "2017-12-23T23:33:43.206+01:00[Europe/Prague]"
  331. },
  332. {
  333. "id": 2,
  334. "readyToUse": true,
  335. "name": "Fuel tank",
  336. "readyDate": null
  337. }
  338. ]
  339. }
  340. ],
  341. "name": "Mars mission",
  342. "destination": "Mars",
  343. "missionDescription": "Simple mission to colonize Mars",
  344. "active": true,
  345. "result": null,
  346. "eta": "2018-02-06T23:33:43.977+01:00[Europe/Prague]",
  347. "endDate": null
  348. }'
  349.  
  350. Test delete:
  351. curl -X DELETE \
  352. http://localhost:8080/pa165/rest/missions/{id} \
  353. -H 'authorization: Basic QURNSU46QURNSU4=' \
  354. -H 'cache-control: no-cache' \
  355. -H 'postman-token: 155b34b2-53f6-bb96-39fe-bc7335cfc476'
  356.  
  357.  
  358. Test archive:
  359. curl -X POST \
  360. http://localhost:8080/pa165/rest/missions/{id}/archive \
  361. -H 'authorization: Basic QURNSU46QURNSU4=' \
  362. -H 'cache-control: no-cache' \
  363. -H 'postman-token: 155b34b2-53f6-bb96-39fe-bc7335cfc476'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement