Rework assertions for linked bib records tests

Description

Overview:

Assertions are the same for three of linked bib update tests in `MarcBibUpdateModifyEventHandlerTest` They are located in the end of `verifyBibRecordUpdate` method:

 

verify(getRequestCount, getRequestedFor(URL_PATH_PATTERN)); verify(putRequestCount, putRequestedFor(URL_PATH_PATTERN));

For now they are located outside of asynchronous 'handle' method execution so they run before the process finishes and so - fail (you can see that in test logs).

 

But tests don't fail because verification exception is not handled and 'context.fail(...)' is not called.

If we rewrite this assertions like this: 

try { verify(getRequestCount, getRequestedFor(URL_PATH_PATTERN)); verify(putRequestCount, putRequestedFor(URL_PATH_PATTERN)); } catch (VerificationException ex) { context.fail(ex); }

and put them inside 'whenComplete' of 'handle' completable future (right before 'async.complete();' call) - they work as expected (no errors in logs / test fails if wrong parameter passed to assertion) locally, but tests fail on build server this way with 'TimeoutException' and no stack trace (timeout after running test for 2 minutes).

Example run with test failures:

https://jenkins-aws.indexdata.com/job/folio-org/job/mod-source-record-storage/job/MODDICORE-309/1/

Possibly it could be helpful to check tests in other module to see how Wiremock verifications are made in conjunction with VertX async execution.

Purpose:

Rework this assertions so they are not ignored (these are main assertions for those tests) and tests pass on build server.

 

Environment

None

Potential Workaround

None

CSP Request Details

None

CSP Approved

None

CSP Rejection Details

None

Attachments

2
  • 14 Mar 2023, 01:16 PM
  • 14 Mar 2023, 01:15 PM

Checklist

hide

TestRail: Results

Activity

Show:

Shans Kaluhin March 14, 2023 at 1:15 PM
Edited

All tests were passed:


Assertion error example:

Done

Details

RCA Group

TBD

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Spitfire

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created February 23, 2023 at 3:38 PM
Updated March 25, 2023 at 10:52 AM
Resolved March 15, 2023 at 9:02 AM
TestRail: Cases
TestRail: Runs

Flag notifications