Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-13514

ch07lab: testSessionSpeakerFallback test has wrong expectations, does not test for correct condition

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • 7
    • en-US (English)
    • DO378 Sprint 9

      Issue description

      I double checked the solution and I am wondering how this test ever passes.

      The mock causes the speaker service to delay by 1000ms and then return getSpeakersFromService() result which always reports the speaker to be "First Last".

      However, the expectation is that a request to /sessions/s-1-1/speakers should return "Emmanuel", which will obviously never happen,  because the delay in the mocked endpoint is equal to the @Timeout set on the findSessionSpeakers() method, which means the timeout will not occur, and a fallback response is not returned.

      As I said, I checked my work against the solution and except for some whitespace, my SessionResource.java and the one in solution are the same.

      Workaround

      I have changed the mock to delay by 2000ms.

      I have recorded the VC video with this change since it does not affect what the students should do, but rather what the test expects and does, and can be updated asynchronously by a simple

              rht-eramirez Eduardo Ramirez
              gregab@p0f.net Grega Bremec
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: