private void setBadAlgorithmTest() throws RestServiceException {
    List<HttpContent> httpContents = new ArrayList<HttpContent>();
    generateContent(httpContents);
    Channel channel = new MockChannel();
    NettyRequest nettyRequest = createNettyRequest(HttpMethod.POST, "/", null, channel);
    try {
      nettyRequest.setDigestAlgorithm("NonExistentAlgorithm");
      fail("Setting a digest algorithm should have failed because the algorithm isn't valid");
    } catch (NoSuchAlgorithmException e) {
      // expected. Nothing to do.
    }
    closeRequestAndValidate(nettyRequest, channel);
  }
Tests for failure when {@link NettyRequest#setDigestAlgorithm(String)} is called with an unrecognized algorithm.
@throws RestServiceException
ambry-rest/src/test/java/com/github/ambry/rest/NettyRequestTest.java