https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43848 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208472 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208472&action=edit Bug 43848: Use the SIP server's own parsing, builders and session setup in the SIP2 message tester Koha::SIP2::MessageTester ( bug 42769 ) had its own copies of things the SIP code already does. Use the real ones, now that they can be reused: - Parse the request with C4::SIP::Sip::MsgType::parse_message to find the patron and the item to check, instead of MsgType->new on the raw request. parse_message is what handle() uses, so the checks are made on exactly what the handler reads: the error detection suffix is taken off first and a wrong checksum is refused, where before a valid request that carried the suffix was refused for a patron that "was not found" and a bad checksum went unnoticed until the handler asked for a resend. - Build the server context with build_session, shared with login_core. - Build the requests with Koha::SIP2::RequestBuilder, shared with the SIP command line emulator, instead of a second set of builders. The requests differ in small ways the server doesn't care about: an empty patron password is sent as an empty field, as the emulator does, and a checkout and a checkin carry the cancel field. Nothing else changes for the user. All the tests of the message tester pass unchanged, and the new ones cover the request suffix, the checksum and the first of two identical fields. Depends on the two previous patches of this bug and on bug 42769. To test: 1) prove t/db_dependent/Koha/SIP2/MessageTester.t 2) prove t/db_dependent/api/v1/sip2_account_test_message.t -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.