Bug 23998 - Messages REST API
Summary: Messages REST API
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low new feature (vote)
Assignee: Lari Taskula
QA Contact:
URL:
Keywords:
Depends on: 24016
Blocks:
  Show dependency treegraph
 
Reported: 2019-11-08 10:51 UTC by Lari Taskula
Modified: 2023-09-05 18:35 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 23998: REST API for messages - Add /api/v1/messages endpoint (34.89 KB, patch)
2019-11-12 12:45 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 23998: REST API for messages - Add /api/v1/messages endpoint (34.86 KB, patch)
2019-11-12 12:46 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 23998: REST API for messages - Add /api/v1/messages endpoint (34.95 KB, patch)
2019-11-12 13:54 UTC, Lari Taskula
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Taskula 2019-11-08 10:51:27 UTC
Expose messages table via REST API.
Comment 1 Lari Taskula 2019-11-12 12:45:41 UTC
Created attachment 95304 [details] [review]
Bug 23998: REST API for messages - Add /api/v1/messages endpoint

Exposes messages database table via REST API.

GET    /api/v1/messages
POST   /api/v1/messages
PUT    /api/v1/messages
DELETE /api/v1/messages

To test:
1. prove t/db_dependent/api/v1/messages.t

https://bugs.koha-community.org/show_bug.cgi?id=23988
Comment 2 Lari Taskula 2019-11-12 12:46:19 UTC
Created attachment 95305 [details] [review]
Bug 23998: REST API for messages - Add /api/v1/messages endpoint

Exposes messages database table via REST API.

GET    /api/v1/messages
POST   /api/v1/messages
PUT    /api/v1/messages
DELETE /api/v1/messages

To test:
1. prove t/db_dependent/api/v1/messages.t

Sponsored-by: Koha-Suomi Oy
Comment 3 Lari Taskula 2019-11-12 13:54:50 UTC
Created attachment 95310 [details] [review]
Bug 23998: REST API for messages - Add /api/v1/messages endpoint

Exposes messages database table via REST API.

GET    /api/v1/messages
POST   /api/v1/messages
PUT    /api/v1/messages
DELETE /api/v1/messages

To test:
1. prove t/db_dependent/api/v1/messages.t

Sponsored-by: Koha-Suomi Oy
Comment 4 David Nind 2020-04-02 00:50:55 UTC
Sorry, tests fail 8-(:

root@a9bc3171985d:koha(bz23998)$ prove t/db_dependent/api/v1/messages.t
t/db_dependent/api/v1/messages.t .. 2/5 
    #   Failed test 'SWAGGER3.2.1'
    #   at t/db_dependent/api/v1/messages.t line 227.
    #          got: '500'
    #     expected: '201'

    #   Failed test 'exact match for JSON Pointer "/patron_id"'
    #   at t/db_dependent/api/v1/messages.t line 227.
    #          got: undef
    #     expected: '95'

    #   Failed test 'exact match for JSON Pointer "/library_id"'
    #   at t/db_dependent/api/v1/messages.t line 227.
    #          got: undef
    #     expected: 'kayx1Yh5'

    #   Failed test 'exact match for JSON Pointer "/message_type"'
    #   at t/db_dependent/api/v1/messages.t line 227.
    #          got: undef
    #     expected: 'B'

    #   Failed test 'exact match for JSON Pointer "/message"'
    #   at t/db_dependent/api/v1/messages.t line 227.
    #          got: undef
    #     expected: 'Old Fox jumped over Cheeseboy'

    #   Failed test 'exact match for JSON Pointer "/manager_id"'
    #   at t/db_dependent/api/v1/messages.t line 227.
    #          got: undef
    #     expected: '94'

    #   Failed test 'SWAGGER3.2.1'
    #   at t/db_dependent/api/v1/messages.t line 243.
    #          got: '500'
    #     expected: '201'

    #   Failed test 'exact match for JSON Pointer "/patron_id"'
    #   at t/db_dependent/api/v1/messages.t line 243.
    #          got: undef
    #     expected: '95'

    #   Failed test 'exact match for JSON Pointer "/library_id"'
    #   at t/db_dependent/api/v1/messages.t line 243.
    #          got: undef
    #     expected: 'kayx1Yh5'

    #   Failed test 'exact match for JSON Pointer "/message_type"'
    #   at t/db_dependent/api/v1/messages.t line 243.
    #          got: undef
    #     expected: 'B'

    #   Failed test 'exact match for JSON Pointer "/message"'
    #   at t/db_dependent/api/v1/messages.t line 243.
    #          got: undef
    #     expected: 'Old Fox jumped over Cheeseboy'

    #   Failed test 'exact match for JSON Pointer "/manager_id"'
    #   at t/db_dependent/api/v1/messages.t line 243.
    #          got: undef
    #     expected: '95'

    #   Failed test 'exact match for JSON Pointer "/errors"'
    #   at t/db_dependent/api/v1/messages.t line 253.
    #     Structures begin differing at:
    #          $got->[1] = HASH(0x557190092810)
    #     $expected->[1] = Does not exist
    # Looks like you failed 13 tests of 27.

#   Failed test 'add() tests'
#   at t/db_dependent/api/v1/messages.t line 265.
t/db_dependent/api/v1/messages.t .. 5/5 # Looks like you failed 1 test of 5.
t/db_dependent/api/v1/messages.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/5 subtests 

Test Summary Report
-------------------
t/db_dependent/api/v1/messages.t (Wstat: 256 Tests: 5 Failed: 1)
  Failed test:  3
  Non-zero exit status: 1
Files=1, Tests=5, 11 wallclock secs ( 0.02 usr  0.02 sys + 10.38 cusr  1.24 csys = 11.66 CPU)
Result: FAIL