private void testConversionFailure(IdConverter idConverter, RestRequest restRequest, String input,
      RestServiceErrorCode expectedErrorCode) throws Exception {
    IdConversionCallback callback = new IdConversionCallback();
    try {
      idConverter.convert(restRequest, input, callback).get();
      fail("ID conversion should have failed because IdConverter is closed");
    } catch (ExecutionException e) {
      RestServiceException re = (RestServiceException) e.getCause();
      assertEquals("Unexpected RestServerErrorCode (Future)", expectedErrorCode, re.getErrorCode());
      re = (RestServiceException) callback.exception;
      assertEquals("Unexpected RestServerErrorCode (Callback)", expectedErrorCode, re.getErrorCode());
    }
  }
Test when id conversion is expected to fail
@param idConverter the {@link IdConverter} instance to use.
@param restRequest the {@link RestRequest} to use.
@param input the input string
@param expectedErrorCode the expected {@link RestServiceErrorCode}.
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/AmbryIdConverterFactoryTest.java