@Test
public void writesErrorIfScanFailed() throws ViewChangedException {

  when(eventHelper.claimLastSource()).thenReturn(sourceNode);
  when(rootNodeFinder.getRootNodeFromSource(any())).thenReturn(rootNode);
  when(axeScanner.scanWithAxe(eq(rootNode), any())).thenReturn(null);
  testSubject.fulfillRequest(onRequestFulfilledMock);
  verify(responseWriter, times(1))
      .writeErrorResponse(argThat((e) -> e.getMessage() == "Scanner returned no data"));
  verifyOnRequestFulfilledCalled();
}