Skip to content

Instantly share code, notes, and snippets.

@psturc
Created May 10, 2018 14:40
Show Gist options
  • Select an option

  • Save psturc/95f8dd10beeb11f825524fb1fd6aab25 to your computer and use it in GitHub Desktop.

Select an option

Save psturc/95f8dd10beeb11f825524fb1fd6aab25 to your computer and use it in GitHub Desktop.
Bug: Deletion of variant using id of non-existing app works
✅ Should get all variants of the specific app
λ ~/ curl -s http://localhost:18081/rest/applications/cdcd7b5d-9a3d-4a7c-93bf-c04df04e7316
{"id":"c1a79257-dfb7-431d-9486-476201cd0992","name":"testapp","description":null,"pushApplicationID":"cdcd7b5d-9a3d-4a7c-93bf-c04df04e7316","masterSecret":"edc5d4f4-feff-4d61-bb67-79a05575a403","developer":"admin","variants":[{"id":"c95d2e29-7432-41e9-9807-bc65e1f61adb","name":"android-variant","description":null,"variantID":"2cc9de5f-62f6-4f04-bdb7-3044064f4100","secret":"7d6935bc-18b9-4025-b873-11eecc0d18e9","developer":"admin","googleKey":"asdf","projectNumber":"ios-variant","type":"android"},{"id":"dc54f4af-229b-4c0b-9e99-79f9712bcb3c","name":"ios-variant","description":null,"variantID":"26da6dd3-6b64-4b4b-8e17-0cffb36e7392","secret":"318ae357-0b8b-4f7e-aeaa-994075123f31","developer":"admin","production":false,"type":"ios"}]}%
✅ Should not get any variants of non existing app
λ ~/ curl -s http://localhost:18081/rest/applications/whatever
Could not find requested PushApplicationEntity%
✅ Should get ios variants of the specific app
λ ~/ curl -s http://localhost:18081/rest/applications/cdcd7b5d-9a3d-4a7c-93bf-c04df04e7316/ios
[{"id":"dc54f4af-229b-4c0b-9e99-79f9712bcb3c","name":"ios-variant","description":null,"variantID":"26da6dd3-6b64-4b4b-8e17-0cffb36e7392","secret":"318ae357-0b8b-4f7e-aeaa-994075123f31","developer":"admin","production":false,"type":"ios"}]%
✅ Should not get ios variants of nonexisting app
λ ~/ curl -s http://localhost:18081/rest/applications/whatever/ios
<html><head><title>Error</title></head><body>Internal Server Error</body></html>%
❌ Should not get details of specific variant with id of non existing app
λ ~/ curl -s http://localhost:18081/rest/applications/whatever/ios/26da6dd3-6b64-4b4b-8e17-0cffb36e7392
{"id":"dc54f4af-229b-4c0b-9e99-79f9712bcb3c","name":"ios-variant","description":null,"variantID":"26da6dd3-6b64-4b4b-8e17-0cffb36e7392","secret":"318ae357-0b8b-4f7e-aeaa-994075123f31","developer":"admin","production":false,"type":"ios"}%
❌ Should not be able to delete the specific variant with using id of non existing app
λ ~/ curl -X DELETE -s http://localhost:18081/rest/applications/whatever/ios/26da6dd3-6b64-4b4b-8e17-0cffb36e7392
(Check if it was really deleted)
λ ~/ curl -s http://localhost:18081/rest/applications/cdcd7b5d-9a3d-4a7c-93bf-c04df04e7316/ios/26da6dd3-6b64-4b4b-8e17-0cffb36e7392
Could not find requested Variant%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment