private void doRecoveryFailureTest(final MessageInfo info, StoreErrorCodes expectedErrorCode) {
    state.recovery = (read, startOffset, endOffset, factory) -> new MessageStoreRecovery.RecoveryResult(
        Collections.singletonList(info), null, endOffset);
    try {
      state.reloadIndex(true, false);
      fail("Loading index should have failed because recovery contains invalid info");
    } catch (StoreException e) {
      assertEquals("Unexpected StoreErrorCode", expectedErrorCode, e.getErrorCode());
    }
  }
Tests that recovery fails for {@code info}.
@param info the {@link MessageInfo} which will cause recovery to fail.
@param expectedErrorCode the {@link StoreErrorCodes} expected for the failure.
ambry-store/src/test/java/com/github/ambry/store/IndexTest.java